Forum for discussing general topics related to Couch.
4 posts Page 1 of 1
Hi,

Currently trying out things on a revamp of a football website and have noticed a strange issues (bug?).
Basically it is an archive of News Items displayed on an embed sidebar. It displays fine on the New Listing page (news.html),
and on the actual Article page (news-item.php) but when it come to the search page (search.php) it only displays one month for 2018, not the two and none for 2017.

Not sure why this is, have checked the source and should be ok (probably missing the obvious).
Hopefully have screenshot attached and code below.

News / Article Pages
Code: Select all
http://nairncountyfc.co.uk/images/1.png


Search Page
Image

The embed code
Code: Select all
<!--Sidebar section-->
<aside>
  <cms:embed "sidebar.html" />
</aside>


sidebar.html
Code: Select all
<!--Archived list of Articles, Grouped by Year. Displays the Months when year is selected-->
<div class="archives">
   <h4>Archives</h4>
   <ul class="sidebar-menu" id="accordion">
      <cms:archives masterpage="news-item.php" type="yearly">
         <li>
           <a href="<cms:show k_archive_link />" style="font-weight: bold;"><cms:date k_archive_date format="Y" /></a>
            <ul style="list-style:none;">
               <cms:archives start_on=k_archive_date
                                       stop_before=k_next_archive_date
                                       type="monthly">
                  <li><a href="<cms:show k_archive_link />"><cms:date k_archive_date format="F" /></a></li>
               </cms:archives>
            </ul>
         </li>
      </cms:archives>
   </ul>
</div>


<script>
  $(function() {
      $("#accordion").accordion();
   });
</script>


Not a major issue but a strange one.
Thanks
Hi,

Your inner <cms:archives> tag is missing the 'masterpage' parameter.
Without an explicit value, it would default to using the current template - which explains the discrepancy in results on different templates.

Please set "news-item.php" as its masterpage and that should resolve the issue.

Hope this helps.
Thanks KK, seems to have done the trick.
Hate these simple solutions to problems, feel like an idiot. :roll:
Hate these simple solutions to problems, feel like an idiot. :roll:
Take heart :) This happens to every single of us.
A second pair of eyes always helps.
4 posts Page 1 of 1
cron