Forum Discussion

dgreen's avatar
dgreen
Contributor
12 years ago
Solved

#global for using variables across multiple custom content modules

Hi all,

 

Wondering if any one has done this before or come knows off a better way to do it.

 

I need to grab an assigned variable from one custom content to use in another.

 

I know in freemarker #assign means the variable is scoped only to that template. However I thought #global should allow access in all templates. This does not seem to be the case on our lithium pages it just throws the normal error, if the variable is referenced from a different custom content that it was initilised in.

 

IE

 

In custom content1 I am putting

 

<#assign navTitle1="Competition" />

 

And in custom content2 i am putting

 

${navTitle1}

 

Which is throwing an error, any help would be great

 

Cheers

 

Dom

2 Replies