Problems, need help? Have a tip or advice? Post it here.
11 posts Page 1 of 2
After cloning a page, I want each page cloned to be listed on the default page if that makes sense? How would I do that?
Hi,

You need to place <cms:pages> tag (that does the listing) in the proper view e.g. as follows
Code: Select all
<cms:if k_is_page>
    <!-- Show a single cloned page here e.g. -->
    <h1><cms:show k_page_title /></h1>
    ..
<cms:else />
    <!-- Show a list of cloned pages here -->
     <cms:pages>
        <h1><cms:show k_page_title /></h1>
        ..
    </cms:pages>
</cms:if>

In case you need more info on views, perhaps the following links would be useful -
http://docs.couchcms.com/concepts/cloned-pages.html
http://docs.couchcms.com/concepts/views.html
http://docs.couchcms.com/concepts/varia ... views.html
http://docs.couchcms.com/concepts/listing-pages.html

Hope it helps.
Thank you! I have done this already but it appears at the top right of the page and doesnt serve as a link to the article. It is just a heading, how would I move it around and make sure it links to that article?

Attachments

With due respects, may if I take the liberty of asking you a question?

Have you been through our tutorial where we build a complete site from scratch? - http://docs.couchcms.com/tutorials/portfolio-site.html

If not, I'd strongly advice you to please take a look at it (just browse through it).
It'll quickly give you all the basics you'll need to work productively with Couch.

Reason I'm asking this is that if I set out to post a detailed answer to your current question I don't think I'd be able to explain things any more or any better than what I've already tried doing in the tutorial (notably the 'blog' section there).

I do hope you do not take offense at my answer. Trust me, it is a sincere request.
Do let us know if something remains unclear even after that.

Thanks.
Of course you may ask that question.

I have followed the blog tutorial, but am lost after the snippet html thing, since on my website I dont have a list of articles, it all gets confusing from there.
If you've read the tutorials but are still stuck, I think the best we can do to help would be for you to post the templates code here so we may see where you're getting stuck and to help get you back on track.
Image
<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='film 60s' clonable='1'></cms:template>
<cms:if k_is_page>
<!-- Show a single cloned page here e.g. -->
<h1><cms:show k_page_title /></h1>
..
<cms:else />
<!-- Show a list of cloned pages here -->
<cms:pages>
<h1><cms:show k_page_title /></h1>
..
</cms:pages>
</cms:if>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>TPE -TV & Film</title>
<link href='styles.css' rel='stylesheet' type='text/css' />
</head>
<body>
<div class="wrapper">
<div class="logo">ThePulseEntertainment</div>
<div class="menu">
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="tv.php" class="active">TV & Film</a></li>
<li><a href="interviews.php">Interviews</a></li>
<li><a href="music.php">Music & Theatre</a></li>
<li><a href="contact.php">Contact Us</a></li>
</ul>
</div>
<div class="header">
<h1>"Straight from the heart of the entertainment Industry"</h1>
</div>
<div class="banner-container">
<div class="banner-top"></div>
<div class="banner-middle"> <img src="image4.jpg" align="center" /> </div>
<div class="banner-bottom"></div>
</div>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<div class="columns-container">
<div class="columns-wrapper">
<div class="left-column">
<div class="left-column-panel">
<div class="left-column-panel-top"></div>
<div class="left-column-panel-middle">
<h1>Search</h1>
<h2>Search the site</h2>
<div class="search">
<ul>
<li class="search-input">
<input type="text" class="search-input-textfield" />
</li>
<li class="search-button"><a href="#"><img src="search-icon.png"/></a></li>
</ul>
</div>
</div>
<div class="left-column-panel-bottom"></div>
</div>
<div class="left-column-panel">
<div class="left-column-panel-top"></div>
<div class="left-column-panel-middle">
<h1></h1>
<h2 class="Film">Film</h2>
<div class="sub-menu">
<ul>
<li><a href="60s.php" class="active">60's</a></li>
<li><a href="#">70's</a></li>
<li><a href="#">80's</a></li>
<li><a href="#">90's</a></li>
<li><a href="#">00's</a></li>
<li><a href="#">10's</a></li>
<li><a href="#">New Releases</a></li>
<li><a href="#">Independant</a></li>
<h1></h1>
<h2 class="Film">TV</h2>
<div class="sub-menu">
<li><a href="#">80's</a></li>
<li><a href="#">90's</a></li>
<li><a href="#">00's</a></li>
<li><a href="#">New Releases</a>
<li><a href="#">Series</a></li>
</ul>
</div>
</div>
</div>
<div class="left-column-panel-bottom"></div>
</div>
</div>
<div class="right-column">
<div class="right-column-heading">
</div>
<div class="right-column-content">
<cms:editable name='Article' type='richtext'><h1>Article</h1>
<p>Space for articles</p></cms:editable>
<div class="right-column-content">
<div class="right-column-content noborder">
</div>
</div>
</div>
<div class="footer">
</div>
</body>
</html>
<?php COUCH::invoke(); ?>

I just want cloned pages to be listed on this page (which is the main one) with a link to said cloned page.
Okay, one look tells me that you have pasted some code from a tutorial or documentation page at the top of your template and that's it. Though you placed the invoke correctly at the bottom of the template so hope is not lost;

Please go through the getting started pages one by one and build the aurelius tutorial site in order to easily grasp how to incorporate couch into your site.

If you do the entire getting started tutorial you will see where you went wrong with this code. if you get stuck at any step of the tutorial feel free to ask and remember to paste code snippets along with questions so we may efficiently and adequately help you.

Also, you can post your code inside of the bbcode tags, click the "code" button on the top of the post box. Your code will look like this:
Code: Select all
code goes here
tags to help us read it better.

Good luck and I'm sure once completed you will see how simple couch is to use :)
Image
Thanks for your reply. I have done the blog tutorial, but my website is unlike the one they've built (obviously) so I dont have a single.html or a list.html (to list the articles) This is where I am getting stuck.
You do not need seperate files, this serves just to clean the template up and make it easier to manage.

Code: Select all
<cms:if k_is_page>
<!-- Show a single cloned page here e.g. -->
<h1><cms:show k_page_title /></h1>
..
<cms:else />
<!-- Show a list of cloned pages here -->
<cms:pages>
<h1><cms:show k_page_title /></h1>
..
</cms:pages>
</cms:if>


All of your code should be between this if statement. If it's a "page-view" (displaying just one of the cloned pages from the template) it should be between the
Code: Select all
<cms:if k_is_page>
<!-- Show a single cloned page here e.g. -->
<h1><cms:show k_page_title /></h1>
..
<cms:else />


If it's the "list-view" it should be between the after the <cms:else />

Code: Select all
<cms:else />
<!-- Show a list of cloned pages here -->
<cms:pages>
<h1><cms:show k_page_title /></h1>
..
</cms:pages>
</cms:if>


So, your entire html output for the page that lists all of the cloned pages should be within the second part (after the <cms:else />). Then you can place your
Code: Select all
<cms:pages>
<h1><cms:show k_page_title /></h1>
..
</cms:pages>


Anywhere within the html inside that and it will output a list of the pages.
Image
11 posts Page 1 of 2