Forum for discussing general topics related to Couch.
6 posts Page 1 of 1
hi All,

I'm having a problem, I started using the pages:archive as per the docs, which works, it creates the list of months / years with link, then click on the link, it shows the news articles for that time period, but when I first access the page via the archive link, it creates a new news article? which I don't want, why ?

my archive list is displayed on the news.php page, and links to a different page to view those news articles.

the actual link to the archive page displays like this : http://localhost/projectname/news_artic ... p?d=201411

my code for displaying the items :

Code: Select all
            <cms:pages masterpage='news_articles_industry.php'
                  start_on=k_archive_date
                  stop_before=k_next_archive_date
                  limit='25'>
                  
                 <div class="news_home_img newspagefloat"><img src="<cms:show ind_image />"></div>
               <div class="news_title"><cms:show k_page_title /></div>
               <div class="news_bold"><cms:show ind_subtitle /></div>
               <div class="news_aritcle"><cms:show ind_desc /></div>
               <div class="news_link"><a href="<cms:show ind_link />" target="_blank"><cms:show ind_link /></a></div>
               <div class="news_article" style="text-align:right; margin-top:3px; margin-bottom:3px; font-size:10px; color: #efefef">Published on : <cms:date k_page_date format='jS M, Y'/></div>
               <div class="news_break clearfix"></div>
            </cms:pages>
Hi Devan,
but when I first access the page via the archive link, it creates a new news article
Can you please let us know more about this strange happening? Which template do you access when this happens. In which template does the new page get added to? Can you post a screen shot of the admin-panel showing the new page listed?

Thanks.
hi KK,

Ok, 2 attachements, news_page where the news articles are listed and below it the archive links, then you click on the archive link, you are taken to the 2nd page to view the results.

I use the 2nd page to add news articles, for search results relating to it and now to display the archive news items. but now when I click on the archive link, it creates the "Default page for news_articles_industry.php * PLEASE CHANGE THIS TITLE *" page, which I dont want.

my page's full code :

Code: Select all

<?php require_once( 'myadmin/cms.php' ); ?>
<cms:template title='News Articles Industry' clonable='1'/>

<!DOCTYPE html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>new project</title>

<link href="css/layout.css" rel="stylesheet" type="text/css" />
<link href="css/pages.css" rel="stylesheet" type="text/css" />
</head>

<body>


<cms:editable
name='ind_image'
label='News Image'
desc=''
type='image'
width='220'
hidden='1'>
</cms:editable>


<cms:editable
name='ind_subtitle'
label='News Sub Title'
desc=''
type='text'
hidden='1'>
</cms:editable>

<cms:editable
name='ind_desc'
label='News Description'
desc=''
type='textarea'
hidden='1'>
</cms:editable>

<cms:editable
name='ind_link'
label='News Link'
desc=''
type='text'
hidden='1'>
</cms:editable>


   <div class="search_bar" style="height:65px">
      <div style="width:960px; margin-left:auto; margin-right:auto; height:65px">
         <!-- SEARCH FORM -->

         <form id="k_search_form" method="get" action="http://localhost/gravel/search.php" accept-charset="utf-8">
            <div class="search_button" style="margin-top:11px; margin-left:-1px"><input type="image" name="submit" src="images/search.jpg" border="0"></div>   
            <div class="search_text"  style="margin-top:11px"><input type="text" placeholder="search for films" class="txtfield" name="s"></div>   
         </form>

         <!-- SEARCH FORM -->
         
         <?php include('inc/socialp.php'); ?>
         
         <div class="search_button" style="float: left; margin-top: 0px"><img src="images/sml_logo_sml.jpg" alt="" height="55" width="251"></div>

               <div class="footer_wrap" style="padding-top:18px">
                  <?php  include('inc/header.php'); ?>
               </div>         
         
      </div>
   </div>
   <div class="div_space"></div>

   <div class="page_wrap_films">
      <div class="main_wrap" style="margin-top:32px">
         <div class="page_title" style="margin-bottom:0px">DISPLAYING SEARCH RESULT</div>
         
            <div class="page_sub_title2" style="display:inline-block; float: left; margin-left: 20px; width:910px">INDUSTRY NEWS</div>
         
   
         <div class="news_left" style="height:450px; max-width:905px; width:905px">

            <cms:pages masterpage='news_articles_industry.php'
                  start_on=k_archive_date
                  stop_before=k_next_archive_date
                  limit='25'>

                 <div class="news_home_img newspagefloat"><img src="<cms:show ind_image />"></div>
               <div class="news_title"><cms:show k_page_title /></div>
               <div class="news_bold"><cms:show ind_subtitle /></div>
               <div class="news_aritcle"><cms:show ind_desc /></div>
               <div class="news_link"><a href="<cms:show ind_link />" target="_blank"><cms:show ind_link /></a></div>
               <div class="news_article" style="text-align:right; margin-top:3px; margin-bottom:3px; font-size:10px; color: #efefef">Published on : <cms:date k_page_date format='jS M, Y'/></div>
               <div class="news_break clearfix"></div>
            </cms:pages> 
 
         </div>

   
         
         </div>
         

      </div>
   </div>
   
   <div class="footer_wrap_pages">
   <?php  include('inc/footer_pages.php'); ?>
   </div>


</body>

</html>
<?php COUCH::invoke(); ?>

Attachments

Thanks.

Please go into the 'news_articles_industry.php' section in the admin-panel. You'll see the *Default page - PLEASE CHANGE THIS TITLE * page listed in there. Click on this page to edit it. From the 'Advanced settings' dropdown, unpublish this page.

That'll get rid of it from the display.
Don't delete it as Couch will simply create it again.

Hope this helps.
hi KK,

thank you, that took care of that problem :-)

just one last question, I have 2 news pages ( company news | Industry news )

can I link them together under the 'archives page' to display both news pages for that time period?

thanks again
can I link them together under the 'archives page' to display both news pages for that time period?
You can use two cms:pages blocks on the same page with different 'masterpage' parameter.

However, if you wish to have a single listing showing pages from two templates, I am afraid it won't be straightforward. Can be done but will require framing a custom query.
6 posts Page 1 of 1
cron