Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
Hello,

Sorry if this has been asked before, I searched but couldn't find anything on it.

I've got 2 places on a site that need the blog list from the same clonable blog.php file - the main index.php, and another Blog_List page that has the list which will point to the same clonable blog.php).
Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Blog' clonable='1' commentable='1'>
   <cms:editable name='blog_content' type='richtext' />

   <cms:editable name='blog_image'
       type='image'
    />
   <cms:folder name="marketing" title="Title1" />
   <cms:folder name="nhs-sales-teams" title="Title2" />
   <cms:folder name="nhs-suppliers" title="Title3" />

</cms:template>

<cms:if k_is_page >
   <cms:embed 'blog_page.html' />
<cms:else />
   <cms:embed 'blog_list.html' />
</cms:if>

My question is what would be a good way to share the same clonable blog.php with 2 separate blog_list.php's ?

Thanks !
Hi,

On index.php, you may place the following -
Code: Select all
<cms:pages masterpage='blog.php' limit='10'>
    .. you'll get a list of blog posts here ..
</cms:pages>

It will list out the top 10 blog posts for you. You may format them with whatever HTML/CSS you like.

Hope it helps.
2 posts Page 1 of 1
cron