Forum for discussing general topics related to Couch.
5 posts Page 1 of 1
Please refer following screenshots.

Image

I tried to make the navigation like the portfolio tutorial, http://www.couchcms.com/docs/tutorials/ ... folio.html. It's pretty okay for this case only one problem, as you can see in the screenshot above, the main title(catalog1, 2, 3, 4, 5, 6) is created in folder view, can I make the folder to be selected as linkable or non-linkable?

I mean when the category have submenu, then the main title is not linkable, just like normal text (ex: catalog1, 2). When the category that does not have submenu (ex: catalog 3, 4, 5, 6), the main title will become linkable, like a hyperlink (link page function like cloned product pages). The reason I do this, as you can see from the screenshot the most of the main title and submenu have same "label", ex: Main title: Our Company, Subtitle: Our Company, I tried to prevent this from happening.

It should look like this:
Image

And for the footer links too.

And this is how cloned pages looked like:

Image

As you can see, the cloned pages is all listed at sidebar, It is annoying to put so many main title and subtitle that share same "label" at one place.

Or is there any good suggestions that you can give me??
What is the code you are using to create the navigation? Could you please post it here?

Drop a <cms:dump /> in the loop and you'll see all variables in that context. I'm sure you'll notice the one that gives the count of pages within the folder. You can use it with cms:if to output the kind of link you want for folders with 0 count.

Hope this helps.
Here is the code:

Code: Select all
<?php require_once( '../admin/cms.php' ); ?>
<cms:template title='Portfolio' clonable='1'  dynamic_folders='1'>

      <cms:folder name='cat_1' title='Personal' />
      <cms:folder name='cat_2' title='Corporate' />
      <cms:folder name='cat_3' title='Employees Benefits' />
</cms:template>

<cms:if k_is_page >

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="">
<meta name="author" content="">

</head>

<body>

...

</body>
</html>

<cms:else />
   <cms:embed 'portfolio_list.html' />
</cms:if>
<?php COUCH::invoke(); ?>



Here is the shippet file:

Code: Select all
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="">
<meta name="author" content="">
</head>

<body>

<!-- Content -->
       
        <cms:folders masterpage='html/motor.php'>
        <div class="probox">
            <h4 id="subtitle">
               <cms:show k_folder_title /></h4>
               
               <ul>
                    <cms:pages masterpage='html/motor.php' folder=k_folder_name>
            <li><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></li>

            </cms:pages>
               </ul>
        </div>
       

        </cms:folders>
       
</body>
</html>



I not sure how to make the folder to be choose as linkable and non-likable, you probably need to show me some sample code. Thanks.
just realized that if I make the folder linkable, can it be edited like cloned page in admin panel??

I supposed it does not work that way, right?
Assuming that the folders without sub-menus are the ones that do not have any pages within them, we can use the following code to first check for a folder's pagecount and then vary the output accordingly -
Code: Select all
<cms:folders masterpage='html/motor.php'>
    <div class="probox">
        <cms:if k_folder_totalpagecount >
            <h4 id="subtitle"><cms:show k_folder_title /></h4>

            <ul>
                <cms:pages masterpage='html/motor.php' folder=k_folder_name>
                    <li><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></li>
                </cms:pages>
            </ul>
        <cms:else />   
            <h4 id="subtitle"><a href="<cms:show k_folder_link />"><cms:show k_folder_title /></a></h4>
        </cms:if>
    </div>
</cms:folders>

Does this help?
5 posts Page 1 of 1
cron