Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
I have created a blog with couchcms on my localserver (WAMP). When testing the blog on the server my left aside menu links that were populated using the masterpage tag are not working. when i hover over them they correctly identify the page-id [http://localhost/mashariki-finance/projects.php?f=22] but when i click on any of the links it takes me back to the masterpage. What am i doing wrong? Thank you for your help.

Here is my code:
---------------------------------------
<ul class="blognav bx_fix">
<cms:folders masterpage='projects.php' >
<li>
<a href="<cms:show k_folder_link />">
<cms:show k_folder_title />
</a>
</li>
</cms:folders >
</ul>
when i click on any of the links it takes me back to the masterpage
Takes back like redirects to the masterpage? Does the URL change? Or is it that all pages get listed (as opposed to only those of the folder)?

Please post in the code of your template that does the listing (i.e. the cms:pages block).

Thanks.
Code: Select all
<?php require_once( 'couchcms/cms.php' ); ?>

<cms:template title='Projects' clonable='1' commentable='1'>
    <cms:editable name='proj_content' type='richtext' />
   
    <cms:editable name='proj_image'
            crop='1'
            width='950'
            height='400'
            type='image'
    />
   
    <cms:editable name='my_post_cat_class'
            label='A class to filter the post (fa-financial access si-scopeinsight col-collaboration [REQUIRED])'
            desc='Select one'
            opt_values='fa | si | col'
            type='dropdown'
    />
   
    <cms:editable name='my_post_cat_class2'
            label='A second class to filter the post (fa- si- col- [OPTIONAL])'
            desc='Select one'
            opt_values='fa | si | col'
            type='dropdown'
    />
   
    <cms:editable name='my_post_cat_id'
      label='Post numbers'
      desc='Select one'
      opt_values='01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 '
      type='dropdown'
    />
   
     <cms:editable
      name='my_post_filt_id'
      label='Post Category'
      desc='Select one'
      opt_values='farmers | lenders'
      type='dropdown'
    />
   
    <cms:folder name="capacity" title="Capacity" />
   <cms:folder name="network" title="Finance Network" />
   <cms:folder name="scoring" title="Credit Scoring" />
   <cms:folder name="insurance" title="Insurance" />
   <cms:folder name="finance" title="Finance Company" />
   <cms:folder name="atic-center" title="Loans Center" />
</cms:template>

<cms:if k_is_page >
<cms:embed 'doc_type.inc' />
<head>
   <meta charset="utf-8">
   
   <!-- PAGE TITLE AND DESCRIPTION
  ================================================== -->
   <title>Projects | <cms:show k_page_title /> </title>
   
   
   <!-- DESIGN AND LAYOUT
  ==================================================
   <cms:embed 'doc_header.inc' />
</head>

<body>
   <!--/FACEBOOK SDK/-->
   <cms:embed 'face_book_SDK.inc' />
   
   <!-- Primary Page Layout
   ================================================== -->
   <!--/Global Wrapper/-->
   
   <div class="contentwrapper">   
   
   <!--/header/-->
   <cms:embed 'header.inc' />
   
   <!--/navigation/-->
   <cms:embed 'nav.inc' />
   
   <!--/content/-->
   
   <div class="row bgrd_4">
      <div class="bgrd_1 h_10"></div>
      <div class="toppad_1"></div>
      <div class="container">         
         <div class="twelve columns alpha bdr_lg_b">
               
                <h3 class="title-headings bx_fix bgrd_2">
                    <span>
                       <cms:show k_page_title />
                    </span>
                </h3>
               
                <div class="clear"></div>

            <!--/*[code][/code]IMAGE SLIDER*/-->
            <div class="bx_fix bdr_lg ">
               <img src="<cms:show proj_image />"  alt="" class="content-img"/>
            </div>
                 
                <div class="bx_fix bgrd_0">
                   <span class="sub">You are here:
                    <a href="<cms:link masterpage='projects.php' />">Our Projects </a> /
                    <a href="#"><cms:show k_page_title /></a>
                    </span>
                   
                    <div class="clear"></div>
                   
                </div>
               <div class="clear marg_b_10"></div>
            
                <!--START CONTENT-->
            <div class="marg_b_10">
               <cms:show proj_content />
               
                    <br class="clear" />
            </div>
               
                <div class="bdr_lg_t clearfix">&nbsp;</div>   
               
                <!--<h3 class="title-headings bx_fix bgrd_0">
                    <span>
                    Comments
                    </span>
                </h3>
               
                <div class="clear"></div>
               
                <cms:if k_comments_count >
               
                <ol class="commentlist">
                    <cms:comments page_id=k_page_id order='asc' limit='5' paginate='1' >
                    <li class="comment">
                        <div class="gravatar">
                            <cms:gravatar email="<cms:show k_comment_author_email />" size="60" />
                            <a name="<cms:show k_comment_anchor />">
                        </div>
                        <div class="comment_content">
                            <div class="clearfix">
                                <cite class="author_name"><a href=""><cms:show k_comment_author /></a></cite>       
                                <div class="comment-meta commentmetadata"><cms:date k_comment_date format='F j, Y'/> at <cms:date k_comment_date format='h:ia'/></a></div>
                            </div>
                            <div class="comment_text">
                                <p><cms:show k_comment /></p>
                            </div>
                        </div>
                    </li>
                    <cms:paginator />
                    </cms:comments>
                </ol>
                 
                <cms:else />
                    No discussions exist in the forum. Discuss?
                </cms:if>
                <div class="clear pad_on">
                <cms:embed 'comments_form.inc' />
                </div>-->
               
           
            <!--END CONTENT-->
         </div>
         
         <div class="unique-right columns omega ">
               <ul class="blognav bx_fix">
                       <cms:folders masterpage='projects.php' >
                     <li><a href="<cms:show k_folder_link />"><cms:show k_folder_title /></a></li>
                          </cms:folders >                                       
               </ul>
                    <div class="clear"></div>
         </div>
         <div class="clear"></div>
      </div>
      <div class="clear"></div>
   </div>   
<cms:embed 'proj_footer.inc' />
<cms:else />
   <cms:embed 'project.inc' />
</cms:if>
<?php COUCH::invoke(); ?>


What happens is, i have a default project page that lists all the entrys. using the if else statement i am able to display the list by default. from the said list i can be able to click on a read more link that leads to the specific entry. On the specific entry i have an aside menu that populates folder... when i click on this menu the page does seem to load by default backs to the list view although the address (on the address bar) changes to reflect the new entry id.
The portion of the code that I was interested in is the one that you have not posted - i.e. the one that lists the page :)

Anyways, I got what I was looking for - the URL changes to reflect that we are within a folder-view bur we still get a full listing.

Please take a look at the code where you are doing the listing (should be in the embedded 'project.inc'). It would be something like this -
Code: Select all
<cms:pages masterpage='projects.php' limit='10' paginate='1' >
    .. list pages here ..
</cms:pages>

To make that block handle the folder-view, please make sure you have the following highlighted part in your code.-
<cms:pages masterpage='projects.php' limit='10' paginate='1' folder=k_folder_name >

For details please see http://www.couchcms.com/docs/concepts/l ... pages.html

Hope this helps.
:D Very Excited!

Doing the following fixed my problem.

Code: Select all
<ul class="blognav bx_fix">
      <cms:pages masterpage='projects.php' limit='10' paginate='1' folder=k_folder_name >
      <li>
                        <a href="<cms:show k_page_link />">
                        <cms:show k_page_title />
                        </a>
      </li>
       </cms:pages >                                       
</ul>


I think my mistake was calling the k_folder_link instead of the k_page_link.

Thanks for guiding me to the solution and the exemplary support you provide to the CouchCMS community.
5 posts Page 1 of 1
cron