Problems, need help? Have a tip or advice? Post it here.
8 posts Page 1 of 1
Hello,
As i only know some html/css coding, i was looking a long time for an easy-use CMS, i finally found COUCH, the amazing !
So, after the design/slice of my website, i followed the tuto based on AURELIUS and i really enjoy the simply way to transform an html site in a CMS.

I am at the point to configure the portfolio, but before doing this, i have a problem to show the latest (3 dates & titles) in a sidebar wich is on non-clonable pages. I suppose there is a better way to configure my website, but it was html ready to be online before i discoverde COUCH.

So, my nav menu is
- home
- pet-hotel
- services
- prices
- rules
- blog
- portfolio
- for sale

Well, only blog.php is set clonable, i succed in showing the latest news in the single-view of entry but not in the other pages, the div is blank. I have copy/past the code in "blog-list.php" but nothing appears....I must missed or not understood something.
Here some screeshot:

Image

Image

Image

the code copy/past from my "blog_list.php" is

Code: Select all
<div id="quoi">
<p class="quoi" >Quoi de neuf ?</p>
<cms:if k_is_page >
<cms:pages masterpage='blog.php' limit='3'>
  <li class="news" ><cms:excerptHTML count='10' ignore='img'>>> <a href="<cms:show k_page_link />"><cms:date k_page_date format='%d/%m/%y' locale='french' /></a> <cms:show k_page_title /></cms:excerptHTML></li>
</cms:pages >
</cms:if >
</div>


Shoul you help me ??
Salut coeur2louve et bienvenue sur notre site :)

The problem with your code seems to be the <cms:if k_is_page > .. </cms:if > check you have placed around the cms:pages loop.

The check essentially sees if the view we are in is a page-view and runs the cms:pages loop only if it is.
The crux is that this 'page-view' v/s 'list-view' stuff pertains to only clonable templates.
Non-clonable templates, the ones on which you see the problem, do not have a page-view so the check always fails and there is no output.

As a rectification, simply remove the if check and that should do it. So the code would now become -
Code: Select all
<div id="quoi">
<p class="quoi" >Quoi de neuf ?</p>

<cms:pages masterpage='blog.php' limit='3'>
  <li class="news" ><cms:excerptHTML count='10' ignore='img'>>> <a href="<cms:show k_page_link />"><cms:date k_page_date format='%d/%m/%y' locale='french' /></a> <cms:show k_page_title /></cms:excerptHTML></li>
</cms:pages >

</div>

Hope this helps.
Do let us know.

Thanks.
Salut KK, merci pour l'acceuil en français ;)

Thanks a lot for your useful help. Removing (cms:if) is ok, the latest news appears in the sidebar on all pages except on "blog.php". What's wrong now ??
the latest news appears in the sidebar on all pages except on "blog.php".
That is strange. If you are using the same code on blog.php, you should get the same output.

Can you please paste in the exact code as it appears on blog.php?

Thanks
Here it is :

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'
crop='1'
width='400'
height='150'
type='image'/>
<cms:folder name="pension" title="Pension">
<cms:folder name="locaux" title="Locaux" />
<cms:folder name="clients" title="Clients" />
</cms:folder>
<cms:folder name="elevage" title="Elevage" >
<cms:folder name="chiens" title="Chiens" />
<cms:folder name="chats" title="Chats" />
<cms:folder name="oiseaux" title="Oiseaux" />
<cms:folder name="chevaux" title="Chevaux" />
<cms:folder name="moutons" title="Moutons" />
</cms:folder>
</cms:template>

<cms:if k_is_page >

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//FR" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet"  href="css/try.css" type="text/css" />
<link rel="stylesheet"  href="css/aurelius.css" type="text/css" />
<link href="css/jquery.mCustomScrollbar.css" rel="stylesheet" type="text/css" />
<link rel="icon" href="images/favicon.ico" />

<script src="http://code.jquery.com/jquery-1.6.4.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="js/jquery.lightbox_me.js"></script>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>

<script type="text/javascript">
$(document).ready(function() {
var myLatlng = new google.maps.LatLng(43.69312,4.31991);
var mapOptions = {
center: new google.maps.LatLng(43.720001,4.355021),
zoom: 11,mapTypeId: google.maps.MapTypeId.ROADMAP};    
var map = new google.maps.Map(document.getElementById('map'), mapOptions);
var marker_1 = new google.maps.Marker({
   position: myLatlng,
   map: map,
   title: 'Pension**** La ColoNiche'     
  });

google.maps.event.addListener(marker_1, 'click', function() {
infowindow.open(map,marker_1);
  });

    window.setTimeout(function() {
$('#map').css('display', 'none').css('visibility', 'visible');
}, 500);
$('#pins').click(function() {
$('#map').lightbox_me();
});
});

</script>

<title>Pension La ColoNiche : Blog  </title>
<meta name="keywords" content="pension animaux 30, pension chiens, pension chats gard, hotel pour animaux nimes, garderie pour animaux, coloniche.com, pension soleil" />
<META NAME="Audience" CONTENT="General" />
<meta name=revisit-after CONTENT="15 days" />
<meta name="description" content="Pension 4 étoiles chiens, chats et autres animaux en Languedoc-Roussillon Nimes Gard - Règlement intérieur" />
<META NAME="subject" CONTENT="Pension 4 étoiles La ColoNiche Nimes" />
<META NAME="identifier-url" CONTENT="http://www.coloniche.com" />
<META NAME="Robots" CONTENT="all" />
<meta name="Robots" content="index,follow"  />
<META NAME="Rating" CONTENT="General" />
<META NAME="contactZip" CONTENT="30640" />
<META NAME="contactCity" CONTENT="BEAUVOISIN" />
<META NAME="contactState" CONTENT="FRANCE" />
<META NAME="expires" CONTENT="never" />
<meta name="document-type" content="Public" />
<meta name="document-rating" content="General" />
<meta name="document-distribution" content="Global" />
<META HTTP-EQUIV="pragma" CONTENT="no-cache" />
</head>

<body id="body" onLoad="init()" >

<!--Debut container-->

<div id="container">

<!--Bebut Header-->
<a href="http://facebook.com/Coloniche"><span>
<div class="topcadreG"></div></span></a>

<div id="topcadreD"><p> Pension Tous Animaux<br />
  <span class="zapf">****</span></p> </div>

<div id="resa">
  <p class="resa"><a href="#">Réservez en ligne</a></p></div>

<div id="colo"></div>

<div id="menuG"><span class="phone"> 04 66 01 39 14</span></div>
<!--DebutNav-->
<div id="menuM">
  <ul>
    <li><a href="index.php" > Accueil</a></li>
    <li class="padding">l
    </li><li id="retour" class="active"><a href="pension.html">Pension</a></li>
    <li class="padding">l</li>
    <li><a href="services.php">Services</a></li>
    <li class="padding">l</li>
    <li><a href="#">Blog</a></li>
    <li class="padding"></li>
    <li class="padding">l</li>
   <li><a href="#">Galerie</a></li>
   <li class="padding">l</li>
   <li><a href="#">Vide-Grenier</a></li>
</ul>
</div>
<!--Fin menuM-->

<!--Debut menuD-->
<div id="menuD"></div>
<!--fin menuD-->

<!--Debut colG-->
<div id="colG">
<div id="adresse"><p><span class="adresse">Adresse<br />
  </span>Mas Franco-Italien<br />
  30640 BEAUVOISIN
</p>
<div id="pins"></div>
    <div id="map"></div>
</div>
<div id="horaires"><p class="ouvert">Ouvert toute l'année</p>
  <p class="centre heure underline">Lun. Mar. Jeu. Ven.
    <br />
    Sam. Dim.</p>
  <p class="centre heure ">10.00 / 14.00<br />
    16.00 / 18.00</p>
  <p class="centre heure underline ">Les 24 et 31/12</p>
  <p class="centre heure ">10.00 / 16.00<br />
  </p>
  <p class="ouvert">Fermeture    </p>
  <p class="centre heure ">Mercredi & Jours Fériés</p>
</div>

<div id="quoi">
<p class="quoi" >Quoi de neuf ?</p>

<cms:pages masterpage='blog.php' limit='3'>
  <li class="news" ><cms:excerptHTML count='10' ignore='img'>>> <a href="<cms:show k_page_link />"><cms:date k_page_date format='%d/%m/%y' locale='french' /> </a> <cms:show k_page_title /></cms:excerptHTML></li>
</cms:pages >

</div>


<div id="leblog">
  <p class="info">> voir le blog</p></div>
<div id="copyright"><p class="copy">© La ColoNiche 2004/2013<br />
    <a href="http://www.couchcms.com/" title="Un CMS simple et gratuit"><img src="images/couch.gif" width="150" height="22" alt="logo couch" longdesc="images/couch.gif" /></a></p></div>
    </div>

<!--fin colG-->
<!--Fin NAV-->

<!--Debut Content-->

<div id="content">
  <div id="blog">
  <div id="entry">
   <div class="post">

<!-- Post Title -->
      <div class="hrHaut clearfix">&nbsp;</div>     
   <h3 class="title"><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></h3>

<!-- Post Data -->
<cms:if k_page_foldertitle>
<cms:set my_category=k_page_foldertitle />
<cms:else />
<cms:set my_category='Divers' />
</cms:if>            
               
<p class="sub">Posté dans <a href="#"><cms:show my_category />
</a> &bull; <cms:date k_page_date format='%d/%m/%Y' locale='french' /> &bull; <a href="#">
<cms:show k_comments_count/></a></p>
               
  <!-- Post Image -->
   <img class="thumb" alt="" src="<cms:show blog_image />" />
            
<!-- Post Content -->
<cms:show blog_content/>

<p class="clearfix"><a href="<cms:link masterpage='blog.php' />" class="button float">&lt;&lt; Retour Blog </a>
<a href="#commentform" class="button right" >Commenter &gt;&gt;</a>
</p>
</div>

<div class="hr clearfix"></div>
<!-- Comment's List-->
    <cms:embed 'comments_data.html' />

<!-- Comment Form -->
  <cms:embed 'comments_form.html' />

</div>
    </div>

<cms:embed 'blog_sidebar.html' />
  </div><!--fin content-->
</div><!--fin container-->
</body>


<script src="js/jquery.mCustomScrollbar.concat.min.js"></script>

<script>
    (function($){
        $(window).load(function(){
            $("#entry").mCustomScrollbar();
        });
    })(jQuery);
</script>
</html>
<cms:else />
<cms:embed 'blog_list.html' />
</cms:if>
<?php COUCH::invoke(); ?>
Thanks.

From what I could see in the code, the cms:pages loop in 'Quoi de neuf ?' section should show the listing in the page-view (i.e. when visiting one of the cloned pages of blog.php)

The list-view (i.e. when visiting blog.php itself as opposed to one of its page) is handled by the snippet 'blog_list.html'. Please take a look at the code in that snippet. I think you have missed removing the page-view check there.
Hi again KK,

As english is not my mother language, it's been hard to understand your instruction... now i know what you meant and it is very clear indeed !

So, i removed <cms:if >....</cms:if > in "Quoi de neuf" div of blog_list.html and seems to be magic ! My latest news are on all pages.

Ha, ha, ha , I am soooo happy with COUCH !

And, let me say, YOU are wonderful too !
You are welcome, coeur2louve.
And thank you very much indeed for those kind words :)
8 posts Page 1 of 1
cron