Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
Hey everyone!

I would like to do something like that: On the left, let's say with 50% width, there should be a container with all the links to my entries, displayed with their title - like a directory. Within a second container with also 50% width on the right, I want to show the content. So, if I click on the first link, the content of this link should appear in the right container. The second link should change the right container to show the content of this entry. Do you know what I mean?

Do you have any idea on how to do this? I would really appreciate any help!

Greets
Hi JJ :)

The 50% width is totally a front-end thing and you are free to code it as you wish.

Couch can help you with displaying the list on the left and the single chosen page on the right and this can be done in several different ways. The most straight-forward would be to use the 'page_view' where we show the current page on the right and a list of all pages on the left. Here is some sample code -
Code: Select all
<!-- in the list view, redirect to the first page -->
<cms:if k_is_list >
    <cms:pages limit='1'>
        <cms:redirect k_page_link />
    </cms:pages>
</cms:if>

<cms:if k_is_page>
    <!-- on the left, show a list of pages -->
    <div id="left">
        <cms:set my_current_page = k_page_name 'global' />
        <ul>
        <cms:pages>
            <li <cms:if k_page_name=my_current_page>class='active'</cms:if>><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></li>
        </cms:pages>
        </ul>
    </div>
   
    <!-- on the right, show the current page -->
    <div id="right">
        <h1><cms:show k_page_title /></h1>
        .. values from other regions can be shown here..
    </div>
</cms:if>

In the code above, we are making the 'list_view' redirect to the 'page_view' of the first page as that is where all the action lies.

Hope this helps.
2 posts Page 1 of 1