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.

General Questions /

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

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

Tokenized use of variables in page content


Reply


3 Posts   951 Views

Avatar
NateW

Community Member, 2 Posts

18 June 2010 at 9:19am

Hi everyone, I'm just getting to grips with SilverStripe for a new client. I want the client to be able to choose where to put a list of latest items from an RSS feed on a page by using something like the variables in a template -- like being able to use $MyExternalRSSFeed in the CMS and have it treat it as it would if it were in Page.ss. I think I'm pretty much there pulling in the RSS feed by integrating SimplePie (thanks to another post in the forums), but I'm not sure about the best way to go about it so that my client can call a variable in the CMS.

I found [url=http://silverstripe.org/general-questions/show/274567#post274567]this post from 2009[/url] suggesting that it 2.4 would have some kind of tokenized support for this. I don't really have any idea what tokenized support means.

Did this make it into 2.4 and how would I go about doing this? If it didn't, I'm fine with using [url=http://doc.silverstripe.org/recipes:customising-content-in-your-templates]the suggestion posted in that thread[/url]. But if there's a preferred way to do this, I'd like to learn to use that as I hope to use SilverStripe for future projects as well.

Thanks for any advice you can provide.

Avatar
Willr

Forum Moderator, 5513 Posts

18 June 2010 at 4:09pm

Hi NateW,

Welcome to the forums! I made that orignal post. Yes its in 2.4. Its called 'ShortCodes' which does what I was explaining. A short tutorial is available on ssbits.

http://doc.silverstripe.org/shortcodes
http://ssbits.com/2-4-using-short-codes-to-embed-a-youtube-video/

Avatar
NateW

Community Member, 2 Posts

18 June 2010 at 11:24pm

Thanks Will, I will give it a try tonight.