I have a typical blog template with a richtext area that holds a story. There is also an RSS feed linked to this blog. The RSS feed uses the cms:pages tag to display stories in the feed.
What I want to do is use a shortcode in the richtext field that will conditionally show code depending on whether the current page is the blog page or the RSS feed.
The problem I'm having is finding the correct variable. From within the cms:pages loop, k_template_name returns the loop's masterpage, not the current template. How can I access the current template from within a cms:pages loop?
References
RSS Feed:
http://docs.couchcms.com/concepts/rss-feeds.html
Embed shortcode:
viewtopic.php?f=8&t=7950
- Code: Select all
<cms:pages masterpage='stories.php'>
<item>
<title><cms:show k_page_title /></title>
<link><cms:show k_page_link /></link>
<pubDate><cms:date k_page_date format='l F j, Y H:i' /></pubDate>
<description>
<cms:html_encode>
<cms:do_shortcodes><cms:show blog /></cms:do_shortcodes>
</cms:html_encode>
</description>
</item>
</cms:pages>
What I want to do is use a shortcode in the richtext field that will conditionally show code depending on whether the current page is the blog page or the RSS feed.
- Code: Select all
[embed code='<cms:if k_template_name == "rss.php" >This is the Feed<cms:else />This is the Page</cms:if>']
The problem I'm having is finding the correct variable. From within the cms:pages loop, k_template_name returns the loop's masterpage, not the current template. How can I access the current template from within a cms:pages loop?
References
RSS Feed:
http://docs.couchcms.com/concepts/rss-feeds.html
Embed shortcode:
viewtopic.php?f=8&t=7950