Skip to main content
Tweeted twitter.com/#!/StackTridion/status/569230805123387393
added code user has already tried based on their comments
Source Link
Chris Morgan
  • 7.3k
  • 17
  • 32

I am pushing keywords onto the package with keys like

Keyword1Title

and pulling them out in my DWT using

@@Keyword{$TemplateRepeatIndex}Title@@

The problem is I want to test the contents of the variable (i.e. not empty) before writing the surrounding HTML. Like:

<!-- TemplateBeginIf cond="StringLength(TemplateRepeatIndexBasedKey) > 0" -->
<p>@@Keyword{$TemplateRepeatIndex}Title@@</p>
<!-- TemplateEndIf -->

So far I have tried StringLength(KeywordTemplateRepeatIndexTitle) but itFollowup to Nuno's comment: StringLength(KeywordTemplateRepeatIndexTitle) always returns false.

Is this possible?

I am pushing keywords onto the package with keys like

Keyword1Title

and pulling them out in my DWT using

@@Keyword{$TemplateRepeatIndex}Title@@

The problem is I want to test the contents of the variable (i.e. not empty) before writing the surrounding HTML. Like:

<!-- TemplateBeginIf cond="StringLength(TemplateRepeatIndexBasedKey) > 0" -->
<p>@@Keyword{$TemplateRepeatIndex}Title@@</p>
<!-- TemplateEndIf -->

So far I have tried StringLength(KeywordTemplateRepeatIndexTitle) but it always returns false.

Is this possible?

I am pushing keywords onto the package with keys like

Keyword1Title

and pulling them out in my DWT using

@@Keyword{$TemplateRepeatIndex}Title@@

The problem is I want to test the contents of the variable (i.e. not empty) before writing the surrounding HTML. Like:

<!-- TemplateBeginIf cond="StringLength(TemplateRepeatIndexBasedKey) > 0" -->
<p>@@Keyword{$TemplateRepeatIndex}Title@@</p>
<!-- TemplateEndIf -->

Followup to Nuno's comment: StringLength(KeywordTemplateRepeatIndexTitle) always returns false.

Is this possible?

added code user has already tried based on their comments
Source Link

I am pushing keywords onto the package with keys like

Keyword1Title

and pulling them out in my DWT using

@@Keyword{$TemplateRepeatIndex}Title@@

The problem is I want to test the contents of the variable (i.e. not empty) before writing the surrounding HTML. Like:

<!-- TemplateBeginIf cond="StringLength(TemplateRepeatIndexBasedKey) > 0" -->
<p>@@Keyword{$TemplateRepeatIndex}Title@@</p>
<!-- TemplateEndIf -->

So far I have tried StringLength(KeywordTemplateRepeatIndexTitle) but it always returns false.

Is this possible?

I am pushing keywords onto the package with keys like

Keyword1Title

and pulling them out in my DWT using

@@Keyword{$TemplateRepeatIndex}Title@@

The problem is I want to test the contents of the variable (i.e. not empty) before writing the surrounding HTML. Like:

<!-- TemplateBeginIf cond="StringLength(TemplateRepeatIndexBasedKey) > 0" -->
<p>@@Keyword{$TemplateRepeatIndex}Title@@</p>
<!-- TemplateEndIf -->

Is this possible?

I am pushing keywords onto the package with keys like

Keyword1Title

and pulling them out in my DWT using

@@Keyword{$TemplateRepeatIndex}Title@@

The problem is I want to test the contents of the variable (i.e. not empty) before writing the surrounding HTML. Like:

<!-- TemplateBeginIf cond="StringLength(TemplateRepeatIndexBasedKey) > 0" -->
<p>@@Keyword{$TemplateRepeatIndex}Title@@</p>
<!-- TemplateEndIf -->

So far I have tried StringLength(KeywordTemplateRepeatIndexTitle) but it always returns false.

Is this possible?

Source Link
Chris Morgan
  • 7.3k
  • 17
  • 32

DWT Syntax TemplateBeginIf & TemplateRepeatIndex

I am pushing keywords onto the package with keys like

Keyword1Title

and pulling them out in my DWT using

@@Keyword{$TemplateRepeatIndex}Title@@

The problem is I want to test the contents of the variable (i.e. not empty) before writing the surrounding HTML. Like:

<!-- TemplateBeginIf cond="StringLength(TemplateRepeatIndexBasedKey) > 0" -->
<p>@@Keyword{$TemplateRepeatIndex}Title@@</p>
<!-- TemplateEndIf -->

Is this possible?