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

I have completed the tutorial and created the site, just got a couple of issues

The first is the index.php does not display the logo in the top left but the other pages does

Second, still can't work out how to add a new page and add that new page to a sub menu in the nav menu?

Kind regards

Ian
Hi Ian,

That logo is a simple text string in H1. I think the template you are using for the index page is missing the string. Please check and add it if required.

As for your second question - now that you are through with the tutorial, I am sure you'll be able to follow the article at http://www.couchcms.com/docs/concepts/n ... maker.html which discusses how to implement a dynamic menu.

Please take a look at it and let me know if you need help with anything in there.

Thanks.
Hi

Thank you for the reply, when you say string, do you mean the <cms:embed 'header.html' /> as got that in the index.php file?

I am just leaving the office but as soon as I get home I will have a look at the link you sent and work it out now got the tutorial site to work with

Hopefully I get it lol

Kind regards

Ian
Hi

Sorry am stuck, I have made a new php page called new_page.php and put that in the root of the site - the code is below

Code: Select all
<?php require_once( 'cms/cms.php' ); ?>
<cms:template clonable='1' nested_pages='1' >
<cms:editable name='main_content' type='richtext'>
<cms:editable name='new_page_image'
      crop='1'
      width='610'
      height='150'
      type='image'
   />
   
    <cms:folder name="new page" title="new page" />

</cms:template>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<title>Aurelius | New Page</title>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   
   <!-- Stylesheets -->
   <link rel="stylesheet" href="css/reset.css" />
   <link rel="stylesheet" href="css/styles.css" />

   <!-- Scripts -->
   <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
   <!--[if IE 6]>
   <script src="js/DD_belatedPNG_0.0.8a-min.js"></script>
   <script>
     /* EXAMPLE */
     DD_belatedPNG.fix('.button');
    
     /* string argument can be any CSS selector */
     /* .png_bg example is unnecessary */
     /* change it to what suits you! */
   </script>
   <![endif]-->

</head>
<body>

<div id="wrapper" class="container_12 clearfix">

<cms:embed 'header.html' />

<div class="hr grid_12 clearfix">&nbsp;</div>
         
      <!-- Caption Line -->
      <h2 class="grid_12 caption">Learn <span>about us</span> and what we do best.</h2>
      
      <div class="hr grid_12 clearfix">&nbsp;</div>

      <!-- Column 1 / Content -->
       
        <div class="grid_8">
       
        </div>

</cms:editable>

<!-- Footer -->
      <p class="grid_12 footer clearfix">
         <span class="float"><b>&copy; Copyright</b> <a href="">QwibbleDesigns</a> - remove upon purchase.</span>
         <a class="float right" href="#">top</a>
      </p>
      
   </div><!--end wrapper-->

</body>
</html>
<cms:embed 'new_page_list.html' />
<?php COUCH::invoke(); ?>


I then made a html file called new_page_list.html and put that in the snippets folder - the code is below

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <title><cms:get_custom_field 'site_name' masterpage='globals.php' /> | Blog</title>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

   <!-- Stylesheets -->
   <link rel="stylesheet" href="<cms:show k_site_link />css/reset.css" />
   <link rel="stylesheet" href="<cms:show k_site_link />css/styles.css" />
   <!-- Scripts -->
   <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
   <!--[if IE 6]>
   <script src="js/DD_belatedPNG_0.0.8a-min.js"></script>
   <script>
     /* EXAMPLE */
     DD_belatedPNG.fix('.button');

     /* string argument can be any CSS selector */
     /* .png_bg example is unnecessary */
     /* change it to what suits you! */
   </script>
   <![endif]-->
</head>

<body>

   <div id="wrapper" class="container_12 clearfix">

      <cms:embed 'header.html' />

      <div class="hr grid_12 clearfix">&nbsp;</div>

      <!-- Caption Line -->
      <h2 class="grid_12 caption clearfix">New Page</h2>

      <div class="hr grid_12 clearfix">&nbsp;</div>

      <!-- Column 1 /Content -->
      <div class="grid_8">

         <cms:pages masterpage='new_page.php'>

            <div class="post">
               <h3 class="title"><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></h3>
               
               
            </div>
            <div class="hr clearfix">&nbsp;</div>

            

         </cms:pages >

      </div>

      <!-- Footer -->
      <p class="grid_12 footer clearfix">
         <span class="float"><b>&copy; Copyright</b> <a href="">QwibbleDesigns</a> - remove upon purchase.</span>
         <a class="float right" href="#">top</a>
      </p>

   </div><!--end wrapper-->

</body>
</html>


I refreshed the admin side expecting it to show in the side panel bit but is not, just can't work it out, sorry

Kind regards

Ian
I uploaded new_page.php and got the following error

ERROR! Closing tag "template" has no matching opening tag (line: 9 char: 207)

Can't work out what is open with no closing tag, all looks lined up to me

Can anyone help please

Kind regards

Ian
If you take a look at the original code that you posted, the cms:template block begin with the following line
Code: Select all
<cms:template clonable='1' nested_pages='1' >

and ends with the following
Code: Select all
</cms:template> 

I think you have managed to delete one tag of the pair.

Incidentally, in the same code the closing tag of the following
Code: Select all
<cms:editable name='main_content' type='richtext'>
is situated way down in the template enclosing other editable tags - clearly this was not what you intended.

In case you are unclear about the tags syntax, please take a look at -
http://www.couchcms.com/docs/concepts/tags.html

Finally, it seems you are getting confused by the combination of existing HTML tags and Couch tags.
I suggest you start first with a template that has zero HTML in it (i.e. blank).

Place cms:template, cms:editable, cms:if k_is_page etc. in the blank template to see how everything works. Once you are confidant in the use of these tags, switch to real-world HTML templates.

Hope this helps.
6 posts Page 1 of 1