Geek & Mild by Sean Sperte
ExpressionEngine and the Power of URL Segments
I had need today to serve a separated RSS feed of just my blog articles – sans links and quick-posts. At first I thought I’d simply duplicate my RSS template and call it something like rss-blog.php.
Yeah right. Not with ExpressionEngine and its support for URL segment conditionals around. Ladies and gentlemen, pay attention, because this is all it took: if segment_3 != 'blog'
Now, the when the URL is http://seansperte.com/rss/blog I can show unique content by placing it inside the if statement, like so:
- weblog="blog1{if segment_3 != 'blog'}|blog2{/if}"
See how that works? See how easy?
24-Apr 2007
© 2012 Sean Sperte, please don't steal. More info.
Handcrafted using Espresso, powered by ExpressionEngine.