I don't want to set list of blog posts (blog_list) in snippits folder as homepage in couch cms. I want to set a post as homepage. That is whenever a user types my website url, one blog post should appear. I have set my blog template as index.html. Thank You
one blog post should appear
If you know which post (and it is present and not un-published), then put on top of the template
- Code: Select all
<!-- Do not allow anything other than page-view -->
<cms:if "<cms:not k_is_page />">
<cms:redirect "<cms:link masterpage='index.php' page='some-blog-post-page-name' />" />
</cms:if>
<!-- Now we should be on page-view with all variables for a blog post available -->
<h1 id="blog_post_title"><cms:show k_page_title /></h1>
If you need to send vitior to latest post, then put on top of the template
- Code: Select all
<!-- Do not allow anything other than page-view -->
<cms:if "<cms:not k_is_page />">
<!-- Find most recent page -->
<cms:pages masterpage='index.php' orderby='publish_date' order='desc' limit='1' show_future_entries='1' >
<cms:redirect k_page_link />
<!-- Show message if no cloned pages exist -->
<cms:no_results><cms:abort is_404='1' msg='Blog empty.' /></cms:no_results>
</cms:pages>
</cms:if>
<!-- Now we should be on page-view with all variables for a blog post available -->
<h1 id="blog_post_title"><cms:show k_page_title /></h1>
If the idea is to redirect visitors to a page-view all the time, then code will do it.