Problems, need help? Have a tip or advice? Post it here.
8 posts Page 1 of 1
Hello: I started web development this year and was happy to discover couch. I enjoy the possibilities it holds. I have been using the forum to help find ways in solving problems as i go along but now I am currently in a fix and in need of a bit assistance. I have a few other questions and would like to start with this.

This side menu Code below works well on page.php?f=1 (folder page) But Does not work on page.php?p=1 (cloned page).
I am sure i am not doing something right. Your assistance will be greatly appreciated.
Code: Select all
<cms:if k_is_folder>
    <cms:folders order='asc' depth='1' root=k_folder_name>
    <li class="title">
    <a href="<cms:show k_folder_link />"><cms:show k_folder_title /></a>   
      </cms:folders>
      <cms:pages  folder=k_folder_name order='asc'>
     <ul class="multilevel-linkul-0" >
            <li id="#<cms:show k_page_title />"><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></li>
    </ul>
    </cms:pages>
   </li>   
    </cms:if>
Hi,

Your code checks if it is executing in a 'folder_view' and if it is, it shows that folder's info plus pages belonging to that folder.
In that sense it is working exactly as expected - 'page.php?p=1 (cloned page)' that you mentioned is a 'page_view' and not a 'folder_view' so the code will not do anything there.

The question now is what do you wish to display in a page_view?
Depending on that we can make changes to the code.

One possible answer that I anticipate is that you'd like to show the folder info (and some pages) of the folder that the page belongs to - assuming the page does belong to a folder.

Please let us know.
Thank you for your response.

In page view i would like it to show the folder name and other pages of the folder that the page belongs to.
Any Help..... :( :( :(
gustav wrote: In page view i would like it to show ... other pages of the folder

Kinda strange.. Didn't you rethink what you actually need?
active topics, google
Free support is never free.. Donate!
Feedback solicited: [NEW] Couch Constructor
@gustav, as @trendoman expressed, it shouldn't be that difficult.
As a tip, if you are uncertain about which variables are available for use, place <cms:dump_all /> or <cms:dump /> at the point where you wish to use them and you'll get a list of all available variables.

Anyway, for folder-view the following is a slightly modified version of your original code (additional <cms:folders> was not needed) -
Code: Select all
<cms:if k_is_folder>
    <li class="title">
        <a href="<cms:show k_folder_link />"><cms:show k_folder_title /></a>   

        <cms:pages folder=k_folder_name order='asc'>
            <ul class="multilevel-linkul-0" >
                <li id="#<cms:show k_page_title />"><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></li>
            </ul>
        </cms:pages>
   </li>   
</cms:if>

For page-view, following should work -
Code: Select all
<cms:if k_is_page>
    <cms:if k_page_foldername>
        <li class="title">
            <a href="<cms:show k_page_folderlink />"><cms:show k_page_foldertitle /></a>   

            <cms:pages folder=k_page_foldername page_name="NOT <cms:show k_page_name />" order='asc'>
                <ul class="multilevel-linkul-0" >
                    <li id="#<cms:show k_page_title />"><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></li>
                </ul>
            </cms:pages>
       </li>
   </cms:if>
</cms:if>

Please notice how we first check if the page indeed belongs to any folder before going ahead with the listing. Also, how we exclude the current page from the listing.

Hope this helps.
:D :D :D :D :D :D

Thank you Thank you....

was a little bit confused there. But it all work out well - GREAT

you wont believe how Happy I am at the moment.

Today is Day 49 since i started using couch.

Thank you very Much KK you are a LIVING SAINT
Thank you :) I am glad I could help.
8 posts Page 1 of 1

Who is online

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

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