Problems, need help? Have a tip or advice? Post it here.
7 posts Page 1 of 1
Dear couch users!

I'n using couch for the first time and loving it so far! But i've come across some problems that i can't seem to solve on my own..

What i want is to display my blog post list on my index.php page so vistors can quickly see my last posts! I've got this working but now I don't know how to inplement a dynamic menu. In the documentation it says that we need to use index.php so the url's will make logic (mysite.com/about f.e).

But when I try to make the index.php clonable and nested for the menu and create a new menu page all blog posts from the home page are also being cloned in the new page. So there are no editable regions.

I've made a new 'blank' menu.php with the editable regions for the pages created for the menu, this is more or less working but it gives me ugly urls like: mysite.com/menu/about instead I would like mysite.com/about and stil have my blog posts list on my homepage.

Is there any way of getting this working in couch cms?

Thanks in advance!
Hi Jimver :)

It seems you are trying to use a single template (index.php) for both as the blog and also the menu.

I suggest you use two separate templates, e.g. as follows -

For blog, use a template named blog.php. So now the URL for blog posts would be
http://www.yoursite.com/blog/
http://www.yoursite.com/blog/some-post.html

For the menu, use another template named 'index.php'.
Now, as documented at http://www.couchcms.com/docs/concepts/n ... maker.html, make one of the cloned pages of index.php (say named 'blog') point to the blog template above.

Does this help?
Adding to my previous post, I'm sorry I missed addressing one problem you mentioned -
you wished to list the blog posts on the homepage.

OK, so the homepage of your site is now the 'home-view' of index.php.
In your index.php, if you place the following code, it will fetch and show latest ten pages from blog.php template -
Code: Select all
<cms:if k_is_home>
    <cms:pages masterpage='blog.php' limit='10'>
        <!-- latest 10 blog posts will be displayed here -->
        <h2><cms:show k_page_title /></h2>
        .. show other regions from blog template ..
    </cms:pages>
</cms:if>

You can change the markup used to show the pages as you desire.

Hope it helps.
Thanks that worked perfectly!!

I have one more question, is it possible to remove the link from the parent menu links?

I have an html example of what i want to accomplish: http://athena.fhict.nl/users/i272879/helmond_sport/

I can't seem to get the styling of the menu right
is it possible to remove the link from the parent menu links? .. I can't seem to get the styling of the menu right

I suggest you use cms:nested_pages tag (instead of cms:menu) to build the menu -
http://docs.couchcms.com/tags-reference ... _pages-tag

This way you'll have 100% control on your markup and what gets outputted.

Hope it helps.
Thanks! got the styling working!

One question remains :oops: can i remove the links of the parent menu items? So u can only click on the sub-menu items?


But thanks anyway you already helped me a lot! :D
My last answer covered removing the parent-menu item links as well - since the markup is now being generated entirely by you (assuming you are using cms:nested_pages), it is now in your hands to output whatever you like. In this, case it would be the parent items without a link.

As is the norm with Couch, you should begin with a static HTML markup of the menu. Use cms:nested_pages to output the identical menu dynamically.

If you have any difficulty doing that, post your static menu's markup here (the one where the parent items are without links) and I'll show you how to produce the same using Couch tags.
7 posts Page 1 of 1
cron