Problems, need help? Have a tip or advice? Post it here.
16 posts Page 1 of 2
On one of my pages which I had originally created as just 'clonable', I decided to add the 'nested_pages' attribute in order to be able to organize them as I saw fit. Previously, whenever the page was accessed without specifying the page id in the URL, I would display all the cloned pages paginated. Once I switched from using the '<cms:pages>' to the <cms:nested_pages>' tags, I ended up with my content repeated more than once.

To make my point clear, if before I would have a paginated view like this:

-page1
-page2
-page3

Now I have ended up with:

-page1
-page2
-page3
-page1
-page2
-page3
-page1
-page2
-page3

Please help!
Hi,
You have not, by any chance, set the 'extended_info' parameter to '1', have you?

Anyways, could you please paste in the exact code block? Will have to take a look at it to find out what is going wrong.

Thanks.
No I didn't set the extended_info on. The code below is from the snippet I am embedding when the main page is accessed without page id:

Code: Select all
<cms:nested_pages masterpage="documentation.php" include_custom_fields='1' childof='methods' paginate='1'>
   <div class="docItemHeader">
              <span class="title"><cms:show k_page_title /></span>
              <cms:if documentation_method_type == 'GET'>
              <span class="get">GET</span>
              <cms:else />
                 <cms:if documentation_method_type == 'POST'>
                    <span class="post">POST</span>
                 </cms:if>
              </cms:if>
              <input class="apiURL" value="<cms:show documentation_api_url />" readonly></input>
           </div>
           <div class="docItemContentContainer">
              <div class="docItemSection">
               <H3>Description</H3>
                 <div><cms:show content_description /></div>
              </div>
              <div class="docItemContent">
               
               <cms:show_repeatable 'request_parameters' startcount='1'>
                  <cms:if k_count eq '1'>
                     <div class="docItemSection">
                        <H3>Request Parameters</H3>
                        <div>
                        <div class="parameterTable alternateHighlight">
                           <div class="tableHeader">
                              <div>Parameter Name</div>
                              <div>Required</div>
                              <div>Description</div>
                           </div>
                  </cms:if>
                           <div>
                              <div class="mono ital"><cms:show parameter_name /></div>
                              <div><cms:show parameter_required /></div>
                              <div><cms:show parameter_description /></div>
                           </div>
                        <cms:if k_count = k_total_records>
                        </div>
                     </div>
                     </div>
                        </cms:if>
               </cms:show_repeatable>
               
               <cms:show_repeatable 'response_codes' startcount='1'>
                  <cms:if k_count eq '1'>
                     <div class="docItemSection">
                        <H3>Response Codes</H3>
                        <div>
                        <div class="responseTable alternateHighlight">
                           <div class="tableHeader">
                              <div>Code</div>
                              <div>Description</div>
                           </div>
                  </cms:if>   
                           <div>
                              <div class="mono bold"><cms:show response_code /></div>
                              <div><cms:show response_description /></div>
                           </div>
                  <cms:if k_count = k_total_records>
                        </div>
                        </div>
                     </div>
                  </cms:if>
               </cms:show_repeatable>                  
               
               <cms:if response_body>
                  <div class="docItemSection">
                     <H3>Response Body</H3>
                     <div><cms:show response_body /></div>
                  </div>
               </cms:if>
               
               <cms:if errors>
                  <div class="docItemSection">
                     <H3>Errors</H3>
                     <div><cms:show errors /> </div>
                     </br>
                     <cms:show_repeatable 'error_codes' startcount='1'>
                        <cms:if k_count eq '1'>
                           <H3>Error Codes</H3>
                           <div class="responseTable alternateHighlight">
                              <div class="tableHeader">
                                 <div>Error</div>
                                 <div>Description</div>
                              </div>
                        </cms:if>
                              <div>
                                 <div class="mono ital"><cms:show error_code /></div>
                                 <div><cms:show error_description /></div>
                              </div>
                        <cms:if k_count = k_total_records>
                           </div>
                        </cms:if>
                     </cms:show_repeatable>
                  </div>
               </cms:if>   
               <div class="docItemSection collapsed">
                  <h3>Sample Request</h3>
                  <div class="sampleSection">
                     <pre><code><cms:show sample_request /></code></pre>
                  </div>
               </div>
               <div class="docItemSection collapsed">
                  <h3>Sample Response</h3>
                  <div class="sampleSection">
                     <pre><code><cms:show sample_response /></code></pre>
                  </div>
               </div>            
               <div class="docItemSection collapsed">
               <h3>Request Demo</h3>
                 <div class="demoFormDiv">
                    
                  <cms:embed sample_filename />
                  <pre class="resultPane"><code class="result"></code></pre>
               </div>
               </div>
              </div>
           </div>
</cms:nested_pages>
Hmm.. can't see anything wrong with the code.
Could you please grant me admin access to your site? Would like to see the problem first hand.

If not, please try debugging the problem piece-meal.
Begin by placing just the following statement in an template
Code: Select all
<cms:nested_pages masterpage="documentation.php" >
    <cms:dump />
</cms:nested_pages>

See if this fetches the right number of pages. Move on to adding more params
Code: Select all
<cms:nested_pages masterpage="documentation.php" include_custom_fields='1' childof='methods' paginate='1'>
   <cms:dump />
</cms:nested_pages>

..and so on.
I'm sure you'll be able to pinpoint the part that is causing the mess up.

Please keep me informed. Thanks.
I did just that, and the dump info was correct (i.e. it showed the pages only once). Then I went ahead and re-pasted the actual content ... AND VOILA` it worked! :oops:

Must have been something to do with caching maybe? Anyway thanks for the help (as usual!)

:)
Not an unusual phenomenon for coders.
I usually attribute such happenings to the gremlins in my box and move on :)
Mine must be then infested with drunken leprechauns judging by the frequency with which unlogical glitches tend to happen!
@KK, what is the logic behind duplication of page names wiht extended_info='1'?

Also spotted a bug (1.4.7). If I select a page with checkbox, then hit 'Delete selected' button - page is not deleted. Hitting a pictogram to the right and it is deleted okay.
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
Also, how to predict the output order of nested pages, while using normal <cms:pages> tag? It doesn't seem to be in asc/desc order, maybe it is sorted by date of creation? Thanks..
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
@trendoman
@KK, what is the logic behind duplication of page names wiht extended_info='1'?

I think you'll find that easier to understand with cms:folders where we make use of 'extended_info' to create UL/LI menu -
Code: Select all
<cms:folders masterpage='news.php' childof='world' hierarchical='1' extended_info='1'>
    <cms:if k_level_start ><UL></cms:if>
    <cms:if k_element_start ><LI>
        <cms:show k_folder_title />
    </cms:if>
    <cms:if k_element_end ></LI></cms:if>
    <cms:if k_level_end ></UL></cms:if>
</cms:folders>

The code above would result in outputting something like the following -
Code: Select all
<ul>
    <li>
        Asian News
        <ul>
            <li>China News</li>
            <li>Japan News</li>
        </ul>
    </li>
    <li>
        North American News
        <ul>
            <li>
                United States News
                <ul>
                    <li>Nevada News</li>
                    <li>Ohio News</li>
                </ul>
            </li>
        </ul>
    </li>
</ul>

As you can see, with this setting the cms:folders tag does not simply iterate through the folders sequentially - rather it also reports the changes in 'levels' (reflecting the hierarchy of the folders as it goes through them). This makes it easy to output the <LI> and <UL>s.

Exactly the same thing applies to cms:nested_pages as well.

Does this explanation makes things any clearer? Please let me know.

Also spotted a bug (1.4.7). If I select a page with checkbox, then hit 'Delete selected' button - page is not deleted
Yup. It is a known bug and was present in 1.4.5 too. Has been rectified for the next version.

Also, how to predict the output order of nested pages, while using normal <cms:pages> tag?
cms:pages, by default, uses the publish_date for sorting. Other valid values are given in the documentation - http://docs.couchcms.com/tags-reference ... ml#orderby
16 posts Page 1 of 2