Timeline for DWT Syntax TemplateBeginIf & TemplateRepeatIndex
Current License: CC BY-SA 3.0
18 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 21, 2015 at 20:22 | history | tweeted | twitter.com/#!/StackTridion/status/569230805123387393 | ||
Feb 18, 2015 at 12:00 | answer | added | sudhanshu | timeline score: 1 | |
Mar 8, 2013 at 18:14 | vote | accept | Chris Morgan | ||
Mar 8, 2013 at 18:07 | comment | added | Chris Morgan | Yes, it seems like it should be possible! I just can't quite find the right syntax :( | |
Mar 8, 2013 at 13:38 | comment | added | Ant P |
Seems like something you ought to be able to do within a TemplateBeginIf , but after playing around I can't figure out how to get the templating engine to interpret this in the way intended. I have a sneaking suspicion that it'll be possible if you get creative, but it seems that the details of how these things are actually parsed are still pretty obscure to most.
|
|
Mar 8, 2013 at 13:27 | answer | added | Bart Koopman | timeline score: 7 | |
Mar 8, 2013 at 12:07 | comment | added | Frank van Puffelen |
Keep in mind that the cond of a TemplateBeginIf is interpreted as JScript, so there is a lot you can do in there. I'm just not sure anymore how you would check the value of a variable (like TemplateRepeatIndex and the compound `"Keyword" + ${TemplateReleatedIndex} + "Title"). Sorry. :-/
|
|
S Mar 7, 2013 at 22:05 | history | edited | Chris Morgan | CC BY-SA 3.0 |
added code user has already tried based on their comments
|
S Mar 7, 2013 at 22:05 | history | suggested | Glenn Stevens | CC BY-SA 3.0 |
added code user has already tried based on their comments
|
Mar 7, 2013 at 21:50 | comment | added | Chris Morgan | Thanks @user254, but, I add multiple items for each Keyword to the package (title & meta fields), so I cannot simply remove the empty keys. My loop is on a collection of "dummy" Keyword TCMIds, then within the loop I write out the "value" keys. | |
Mar 7, 2013 at 21:06 | review | Suggested edits | |||
Mar 7, 2013 at 22:05 | |||||
Mar 7, 2013 at 20:54 | comment | added | user254 | Hi Chris, I dont think this is possible. The problem is you would need to append the TemplateRepeatIndex value with your current variable within the TemplateBeginIf condition. This is not possible as far as I'm aware. One way to work around this is to possibly write a C# tbb that loops through and perhaps remove all empty keys? That way you won't have to do the check for empty string. | |
Mar 7, 2013 at 20:45 | comment | added | Chris Morgan | Maybe the "correct" answer is no :) | |
Mar 7, 2013 at 20:44 | comment | added | Chris Morgan | I have tried StringLength(KeywordTemplateRepeatIndexTitle) - always false I to thought this would work, based on my error messages from StringLength(Keyword$TemplateRepeatIndexTitle) - error Sorry for risking the 100% record :) | |
Mar 7, 2013 at 20:36 | comment | added | Alvin Reyes | Hey Chris, welcome to TridionStackExchange. +1 for the question and thanks for asking (and compelling us to answer to keep 100% answered)! ;-) | |
Mar 7, 2013 at 20:28 | comment | added | Nuno Linhares♦ | Did you try it? I think you can use cond="StringLength(KeywordTemplateRepeatIndexTitle)" in there, due to the order in which it gets evaluated - TemplateRepeatIndex gets converted to the actual value before evaluating the condition - but not sure. | |
Mar 7, 2013 at 20:26 | review | First posts | |||
Mar 7, 2013 at 21:06 | |||||
Mar 7, 2013 at 20:08 | history | asked | Chris Morgan | CC BY-SA 3.0 |