Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Using array data in a cms html text area?


Go to End


3 Posts   973 Views

Avatar
JonShutt

Community Member, 244 Posts

30 August 2011 at 12:03pm

Hello

I've got a function in my page controller that returns an array of details of a user out of 3rd party marketing system - firstname, lastname, email etc.

I can use this info in the SS template, but I would like to I would like to be able to input something like "hello $firstname $lastname, how are you " into a text field the CMS.

Any ideas how I can make the cms text field merge the details from the array?

thanks

Avatar
Willr

Forum Moderator, 5523 Posts

30 August 2011 at 2:57pm

Perhaps try using short codes. SSBits has a good tutorial - http://www.ssbits.com/tutorials/2010/2-4-using-short-codes-to-embed-a-youtube-video/

Avatar
JonShutt

Community Member, 244 Posts

5 September 2011 at 12:45pm

Thanks Will,

got something working based on that.

Cheers