Forum for discussing general topics related to Couch.
4 posts Page 1 of 1
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.
Sir Is there any other way to do it other than redirecting? I am converting my static website to couch cms. My website url is 2nd result on first page of google search for a keyword. I don't want to loose that rank. If I redirect, then anybody who types my website url, http://www.mywebsiteurl.com gets redirected to http://www.mywebsiteurl.com/some-post-name.html and there will be no content left at http://www.mywebsiteurl.com and i will loose that page rank. I want that particular blogpost to appear at homepage url http://www.mywebsiteurl.com and not at http://www.mywebsiteurl.com/some-post-name.html. Sir I don't want to do it by snippits folder method because then the post will get out of couch template. Any changes to template won't take effect to file in snippit folder. And it can't be edited like other posts. Thank You sir!
@dp121, I posted an answer on your other thread - viewtopic.php?f=4&p=28753#p28753
4 posts Page 1 of 1

Who is online

In total there are 3 users online :: 1 registered, 0 hidden and 2 guests
(based on users active over the past 5 minutes)

Users browsing this forum: Google [Bot] and 2 guests