Forum Discussion
santosh_csc
8 years agoGuide
@petelu
Thanks for the response.
The code which I wrote also Velocity code only.
I have referred https://stackoverflow.com/questions/6843882/replace-a-substring-of-a-string-in-velocity-template-language to replace the string. But it's not working with text-keys.
It's working for a local variable like below.
#set ($abc="Hi Hello") #set ($footer1=$abc.replace("l","p")) ${footer1}
Above code prints Hi Heppo which is expected. Why it's not working text keys alone.
I have verified that text-keys are not coming null inside template.
ChiaraS
8 years agoLithium Alumni (Retired)
Hi santosh_csc
this should work:
#set ($footer1 = "${footer}") #set ($footer1=$footer1.replace("communityTitle",$community.title)) $footer1
- santosh_csc8 years agoGuide
Getting the below error when I run the above code what you have suggested.
The component causing the issue is: component.content.studio-title (content). If you have recently made changes to this page or component, please use this link to be taken to the Page Editor in Studio. If this is not the case, please contact your Administrator.
- ChiaraS8 years agoLithium Alumni (Retired)
Wondering if could be related to what is in the footer text key, try to replace the {} brackets with something else...
Related Content
- 2 years ago
- 2 years ago
- 2 years ago
- 6 years ago