Developer forum

Forum » Development » DwTemplateTags required for Datetime to work in loop?

DwTemplateTags required for Datetime to work in loop?

Jais Edelmann
Reply

For some reason my tags in a loop that are set with Datetime doesent work without dwtemplatetags' tag present in the loop? Is it mismatch off some files on my end or is it a general bug i wonder? (Rest of the tags inside and outside the loop work's fine without the dwtemplatetag)

 

Content version 20.0.2.2

Assembly versions

Dynamicweb.dll 8.0.2.2

8.0.2.2 Dynamicweb, Version=8.0.0.0, Culture=neutral, PublicKeyToken=null

Dynamicweb.Admin.dll 8.0.2.2

Dynamicweb.Admin, Version=8.0.0.0, Culture=neutral, PublicKeyToken=null

Dynamicweb.Controls.dll 8.0.2.2

Dynamicweb.Controls, Version=8.0.0.0, Culture=neutral, PublicKeyToken=null

Build date on, 25 apr 2012 13:11

.NET Runtime version v4.0.30319

Application bit version 32Bit

 


Replies

 
Jais Edelmann
Reply

Dates dont seem to work for me outside the loop eigther without dwtemplatetags present.

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Jais,

 

Can you post the code you're using? Also, have you tried upgrading to the latest release to see if the problem then goes away?

Cheers,

Imar

 
Jais Edelmann
Reply

Hi Imar, heres a code snippet from GetContent 

 

 public override string GetContent()
        {
            Template template = new Template("codesquare/twitter/" + Properties.get_Value("template"));
            string username =  this.Properties.get_Value("username");
            var statuses = Twitter.Managers.StatusManager.GetAllStatuses(username);
            User u = Managers.UserManager.GetUserInformation(username);

            template.SetTag("codesquare-twitter:username", username);
            template.SetTag("codesquare-twitter:userCreateDate", u.CreateDate);
            template.SetTag("codesquare-twitter:userDescription", u.Description);
            template.SetTag("codesquare-twitter:followersCount", u.FollowersCount);
            template.SetTag("codesquare-twitter:userId", u.Id);
            template.SetTag("codesquare-twitter:userImageUrl", u.ImageUrl);
            template.SetTag("codesquare-twitter:userLocation", u.Location);
            template.SetTag("codesquare-twitter:userStatusCount", u.StatusCount);
            template.SetTag("codesquare-twitter:userUrl", u.Url);

            SetTagItemLoop(template, statuses);
            return template.Output();
        }

 

The CreateDate  property on the user object is a DateTime object.


According to http://developer.dynamicweb-cms.com/downloads/dynamicweb-8.aspx i'm running the latest stable version i believe? Should i go for a "unstable" version? 
 

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
This post has been marked as an answer

I see what you mean, and I can reproduce the problem. This looks like a bug to me that you may want to report, I can work around it by not using - in the tag name, but a period. E.g.:
 

template.SetTag("codesquare.twitter:userCreateDate", u.CreateDate);


>> Should i go for a "unstable" version? 

I think for new sites (not upgrades) the 8.1 branch is considered stable as well.

 

Cheers,

Imar

Votes for this answer: 0
 
Jais Edelmann
Reply

Thats so strange that it will work with . instead off - but thanks Imar, ill make sure to notify dynamicweb of this.

 

You must be logged in to post in the forum