Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Hello everyone,

I am new to Couch and I'm glad I found this excellent CMS.

I have been following the tutorial to get an existing site compatible with Couch but I've run into a hitch that I can't come out. I've been at this for 2 days now and believe it's time I sought expert help/guidance.

I'm stuck in the part that has to do with getting a page to list the blog entries. I named my blog post news-post.php and it works, I can read details of news on that page, but when I use that as the name of the masterpage within the index.php it gives this error:

ERROR: Tag "pages": masterpage 'news-post.php' not found

I have tried renaming it blog, just to see but nothing works. Here's the code I used in the index.php page as found in the tutorial:
Code: Select all
<cms:pages masterpage='news-post.php' 
                  folder=k_folder_name
                  start_on=k_archive_date
                  stop_before=k_next_archive_date
                  paginate='1'
                  limit='5' >

I did use this in the news-post.php page:
Code: Select all
<?php require_once( '../coeus/cms.php' ); ?>
<cms:template title='News Posts' clonable='1'>

<cms:editable name='news_summary' type='text' />
<cms:editable name='news_content' type='richtext' />


<cms:editable name='news_image'
         crop='1'
         width='920'
         height='444'
         type='image'
/>   
      
<cms:folder name="news" title="News" />
<cms:folder name="speech" title="Speech" />

</cms:template>

<cms:if k_is_page >

I'll deeply appreciate any help offered. Thank you!
Hi :)

Following statement from your 'news-post.php' template suggests that the template resides in a sub-folder (as opposed to residing directly within the site root) -
Code: Select all
<?php require_once( '../coeus/cms.php' ); ?>

The names of such templates have their folder hierarchy contained within them e.g. the setup below has three templates -
Code: Select all
www
    |_couch
    blog.php
    news
        |_index.php
    articles
        |_old
            |_index.php

Following is how Couch would know them -
1. blog.php
2. news/index.php
3. articles/old/index.php

Please notice how the names of the last two templates contain the names of their parent folders also.

A tip for you-
for knowing the name of a template (as understood by Couch), please hover your mouse on the name of that template in admin-panel sidebar. You should see a tooltip showing the name.

Please use the correct name for the template and your code should work.

Hope it helps.
Ah, this is incredible! Not only is your response quick, but it has solved the problem. I can't thank you enough Chief. You deserve a glass of beer and more for being so helpful.

I would hate to ruin my expression of gratitude by making further requests but I'm held back by one final thing and if I can get that to work, it would mean everything.

The default view of the list is vertical. If I wanted the display of the items horizontal, could you please point me to any resource here on the forum where this has been answered. I have searched but can't find anything exactly.
You are welcome :)
And thanks for the kind words.

Regarding the 'horizontal' view, Couch is actually totally agnostic about how you choose to display your data.
So, you may (should, rather) use your own markup to show the pages horizontally or any other way you desire.

Please begin with a static design that matches your view and then introduce Couch tags within it to make it dynamic.

If you have such a design and are having difficulty in making it dynamic, please feel free to post it here and we'll come up with suggestions.
Thank you again KK. You deserve a medal.

I finally sorted myself out, using code you shared in this thread: viewtopic.php?f=4&t=9729&p=21923&hilit=show+last+post#p21923

<cms:pages masterpage='blog.php' limit='5' offset='1'>
... will skip the top latest post and fetch next five after that ..
</cms:pages>

I have my posts well lined up now. I will share site once I'm done in the show site section.

All the best in the days ahead.

NS
5 posts Page 1 of 1