Problems, need help? Have a tip or advice? Post it here.
15 posts Page 2 of 2
Hi,

It is not working because the code is using the <cms:show content /> within the list-view (i.e. not the page-view) and as we have discussed earlier, in the list-view there is no page in context and hence no content to show. We'll have to use the 'pages' tag to list the pages and within this we can use the excerptHTML.
The revised code could be -
Code: Select all
<div class="contenido">
<cms:if k_is_page>
    <h1 class="titulo"><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></h1>
    <div class="post"><div class="parrafo"><cms:show content /></div></div>
<cms:else />
    <cms:pages>
        <cms:excerptHTML count='130'>
            <cms:show content />
        </cms:excerptHTML>
    </cms:pages>
</cms:if>
</div>
Mmm, not... i can't make it work :oops:

Here's the index.php so you can take a look, thanks again!

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="autor" label="Autor del Post" desc="Selecciona una"
  opt_values='(Vacio)=0 | DoctorMalboro=1 | Anónimo=2'
  opt_selected = '1'
  type='dropdown'
/>
   <cms:folder name='anuncios' title='Anuncios' />
   <cms:folder name='basurero' title='Basurero' />
   <cms:folder name='programacion' title='Programaci&oacute;n' />
   <cms:folder name='php' title='PHP' />
   <cms:folder name='html' title='HTML' />
   <cms:folder name='css' title='CSS' />
   <cms:folder name='javascript' title='Javascript' />
   <cms:folder name='geek' title='Rincon del Geek' />
   <cms:folder name='popurri' title='Apps y Sitios de Interes' />
</cms:template>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>DoctorMalboro - El crack de la internet</title>
<script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>
<link href="http://fonts.googleapis.com/css?family=Calligraffitti" rel="stylesheet" type="text/css" />
<link href="http://fonts.googleapis.com/css?family=Permanent+Marker" rel="stylesheet" type="text/css" />
<link href="http://fonts.googleapis.com/css?family=Cuprum" rel="stylesheet" type="text/css" />
<link href="http://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet" type="text/css" />
<link href="css/estilo.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div class="container" id="container">
           <div class="header">DoctorMalboro</div>
              <div class="slogan">El crack de la
                     internet.</div>
               <div class="menu">
                  <ul>
                       <li><a href="index.php">Inicio</a></li>
                     <li><a href="#">Freebies</a></li>
                     <li><a href="#">Modificaciones de SMF</a></li>
                     <li><a href="registro.php">Registro</a></li>
                     <li><a href="#">Creaci&oacute;n del blog</a></li>
                  </ul>
               </div>
</div>
<div class="body">
         <div class="feed"><img src="img/icons/rss.png" alt="" /> Rss Feed: (TO-DO).</div>
</div>
      <div class="categorias">
            <table>
                    <tr>
                           <th scope="row"><img src="img/icons/book.png" alt="" /> Categor&iacute;as</th>
                    </tr>
                          <cms:folders masterpage='index.php' >
                    <tr>
                            <td><a href="<cms:show k_folder_link />"><cms:show k_folder_title /></a></td>
                    </tr>
                          </cms:folders>
            </table>
      </div>


<div class="contenido">
<cms:if k_is_page>
    <h1 class="titulo"><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></h1>
    <div class="post"><div class="parrafo"><cms:show content /></div></div>
<cms:else />
    <cms:pages>
        <cms:excerptHTML count='130'>
            <cms:show content />
        </cms:excerptHTML>
    </cms:pages>
</cms:if>
<ul class="info">
            <li class="leermas"><img src="img/icons/book_open.png" alt="" /> Leer M&aacute;s...</li>
               <cms:if k_page_foldertitle>
                   <cms:set  my_category=k_page_foldertitle />
               <cms:else />
                   <cms:set my_category="Sin Categorizar" />
               </cms:if>
            <li><img src="img/icons/book.png" alt="" /> Categor&iacute;a: <cms:show my_category /></li>
            <li><img src="img/icons/user_comment.png" alt="" /> Autor: <cms:show autor_del_post /></li>
            <li><img src="img/icons/date.png" alt="" /> Fecha de Creaci&oacute;n: <cms:show k_page_date format="jS M, y" /></li>
</ul>
   <cms:if k_comment_count>
      <div class="comentarios"><img src="img/Comment-64.png" alt="" /></div>
            <div class="cantcomentarios"><cms:show k_comment_count /></div>
              <cms:else />
      <div class="comentarios"><img src="img/Comment-64.png" alt="" /></div>
            <div class="cantcomentarios">0</div>
   </cms:if>
<cms:else />
   <cms:pages>
      <h1 class="titulo"><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></h1>
         <div class="post"><div class="parrafo"><cms:show blog_content /></div></div>
      <ul class="info">
               <cms:if k_page_foldertitle>
                   <cms:set  my_category=k_page_foldertitle />
               <cms:else />
                   <cms:set my_category="Sin Categorizar" />
               </cms:if>
            <li><img src="img/icons/book.png" alt="" /> Categor&iacute;a: <cms:show my_category /></li>
            <li><img src="img/icons/user_comment.png" alt="" /> Autor:</li>
            <li><img src="img/icons/date.png" alt="" /> Fecha de Creaci&oacute;n: <cms:show k_page_date format="jS M, y" /></li>
      </ul>
      <div class="comentarios"><img src="img/Comment-64.png" alt="" /></div>
            <div class="cantcomentarios"><cms:show k_comment_count /></div>
   </cms:pages>
</div>

<div class="footer"><div class="entradas"><img src="img/icons/arrow_left.png" alt="" /> Entradas antiguas</div></div>

<div class="copyright">
            Creado Por <a href="www.doctormalboro.in" target="_blank">Leandro Poblet</a>. Todos los derechos reservados.<br />
      <a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img src="img/icons/css_valid.png" alt="¡Valido para CSS3!" title="¡Válido para CSS3!" /></a>
      <a href="http://validator.w3.org/" target="_blank"><img src="img/icons/html_valid.png" alt="Valido para HTML5!" title="¡Válido para HTML5!" /></a>
</div>
</body>
</html>
<?php COUCH::invoke(); ?>
Hi,

Here is the rectified code -
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="autor" label="Autor del Post" desc="Selecciona una"
  opt_values='(Vacio)=0 | DoctorMalboro=1 | Anónimo=2'
  opt_selected = '1'
  type='dropdown'
/>
   <cms:folder name='anuncios' title='Anuncios' />
   <cms:folder name='basurero' title='Basurero' />
   <cms:folder name='programacion' title='Programaci&oacute;n' />
   <cms:folder name='php' title='PHP' />
   <cms:folder name='html' title='HTML' />
   <cms:folder name='css' title='CSS' />
   <cms:folder name='javascript' title='Javascript' />
   <cms:folder name='geek' title='Rincon del Geek' />
   <cms:folder name='popurri' title='Apps y Sitios de Interes' />
</cms:template>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>DoctorMalboro - El crack de la internet</title>
<script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>
<link href="http://fonts.googleapis.com/css?family=Calligraffitti" rel="stylesheet" type="text/css" />
<link href="http://fonts.googleapis.com/css?family=Permanent+Marker" rel="stylesheet" type="text/css" />
<link href="http://fonts.googleapis.com/css?family=Cuprum" rel="stylesheet" type="text/css" />
<link href="http://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet" type="text/css" />
<link href="css/estilo.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div class="container" id="container">
           <div class="header">DoctorMalboro</div>
              <div class="slogan">El crack de la
                     internet.</div>
               <div class="menu">
                  <ul>
                       <li><a href="index.php">Inicio</a></li>
                     <li><a href="#">Freebies</a></li>
                     <li><a href="#">Modificaciones de SMF</a></li>
                     <li><a href="registro.php">Registro</a></li>
                     <li><a href="#">Creaci&oacute;n del blog</a></li>
                  </ul>
               </div>
</div>
<div class="body">
         <div class="feed"><img src="img/icons/rss.png" alt="" /> Rss Feed: (TO-DO).</div>
</div>
      <div class="categorias">
            <table>
                    <tr>
                           <th scope="row"><img src="img/icons/book.png" alt="" /> Categor&iacute;as</th>
                    </tr>
                          <cms:folders masterpage='index.php' >
                    <tr>
                            <td><a href="<cms:show k_folder_link />"><cms:show k_folder_title /></a></td>
                    </tr>
                          </cms:folders>
            </table>
      </div>


<div class="contenido">
<cms:if k_is_page>
    <h1 class="titulo"><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></h1>
    <div class="post"><div class="parrafo"><cms:show blog_content /></div></div>

<ul class="info">
            <li class="leermas"><img src="img/icons/book_open.png" alt="" /> Leer M&aacute;s...</li>
               <cms:if k_page_foldertitle>
                   <cms:set  my_category=k_page_foldertitle />
               <cms:else />
                   <cms:set my_category="Sin Categorizar" />
               </cms:if>
            <li><img src="img/icons/book.png" alt="" /> Categor&iacute;a: <cms:show my_category /></li>
            <li><img src="img/icons/user_comment.png" alt="" /> Autor: <cms:show autor /></li>
            <li><img src="img/icons/date.png" alt="" /> Fecha de Creaci&oacute;n: <cms:show k_page_date format="jS M, y" /></li>
</ul>
   <cms:if k_comment_count>
      <div class="comentarios"><img src="img/Comment-64.png" alt="" /></div>
            <div class="cantcomentarios"><cms:show k_comment_count /></div>
              <cms:else />
      <div class="comentarios"><img src="img/Comment-64.png" alt="" /></div>
            <div class="cantcomentarios">0</div>
   </cms:if>
<cms:else />
   <cms:pages>
      <h1 class="titulo"><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></h1>
         <div class="post"><div class="parrafo">
         <cms:excerptHTML count='20' trail="&nbsp;(<a href=\"<cms:show k_page_link />\">read more..</a>)"><cms:show blog_content /></cms:excerptHTML>
       </div></div>
      <ul class="info">
               <cms:if k_page_foldertitle>
                   <cms:set  my_category=k_page_foldertitle />
               <cms:else />
                   <cms:set my_category="Sin Categorizar" />
               </cms:if>
            <li><img src="img/icons/book.png" alt="" /> Categor&iacute;a: <cms:show my_category /></li>
            <li><img src="img/icons/user_comment.png" alt="" /> Autor: <cms:show autor /></li>
            <li><img src="img/icons/date.png" alt="" /> Fecha de Creaci&oacute;n: <cms:show k_page_date format="jS M, y" /></li>
      </ul>
      <div class="comentarios"><img src="img/Comment-64.png" alt="" /></div>
            <div class="cantcomentarios"><cms:show k_comment_count /></div>
   </cms:pages>
</cms:if >
</div>

<div class="footer"><div class="entradas"><img src="img/icons/arrow_left.png" alt="" /> Entradas antiguas</div></div>

<div class="copyright">
            Creado Por <a href="www.doctormalboro.in" target="_blank">Leandro Poblet</a>. Todos los derechos reservados.<br />
      <a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img src="img/icons/css_valid.png" alt="¡Valido para CSS3!" title="¡Válido para CSS3!" /></a>
      <a href="http://validator.w3.org/" target="_blank"><img src="img/icons/html_valid.png" alt="Valido para HTML5!" title="¡Válido para HTML5!" /></a>
</div>
</body>
</html>
<?php COUCH::invoke(); ?>


Please let me know it it helps.
Nope, i overwrite what you gave me with the old code and still the same... should i clean my cache to see any changes?
Yes, try doing that. It is working on my system.
15 posts Page 2 of 2

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 2 guests

cron