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

I have made a client a website and on index.php at the top is a slideshow using nivoslider and I have put the following code in

Code: Select all
<?php require_once( 'couch/cms.php' ); ?>

<cms:template title='Home'>
<cms:editable name='page_title' label='title' type='text' />
</cms:template>

<cms:template>

<cms:template title='Slideshow'>
<cms:repeatable name="slider" label='slider' >
   <cms:editable name='slider_image'
      label="Slideshow Image"
      width="960"
      height="300"
      show_preview='1'
      preview_width="150"
      type="image" />
     <cms:editable name='slider_text'
      label="Text"
      type="text" />
   <cms:editable name='slider_caption'
      label="Caption"
      type="text" />
</cms:repeatable>
</cms:template>
</cms:template>

<title><cms:show page_title/></title>

<?php
$title = "";

$pgDesc="";

$pgKeywords="";

include ( 'includes/header.php' );
?>
<!--CONTENT-->

   <div id="column-top-whole">
    <div class="slider-wrapper theme-default">
    <div id="slider" class="nivoSlider">
        <cms:show_repeatable 'slider' >
   <img src="<cms:show slider_image />" />
</cms:show_repeatable>
    <!--<img src="images/slideshow/slide-one.jpg" alt="" />
    <img src="images/slideshow/slide-two.jpg" alt="" title="" /></a>
    <img src="images/slideshow/slide-three.jpg" alt="" title="" />
    <img src="images/slideshow/slide-four.jpg" alt="" />
    <img src="images/slideshow/slide-five.jpg" alt="" />
    <img src="images/slideshow/slide-six.jpg" alt="" />
    <img src="images/slideshow/slide-seven.jpg" alt="" />-->
    </div>
    </div>
    </div>
   
   
<script type="text/javascript">
$(window).load(function() {
$('#slider').nivoSlider({
    effect: 'random',                 // Specify sets like: 'fold,fade,sliceDown'
    slices: 15,                     // For slice animations
    boxCols: 8,                     // For box animations
    boxRows: 4,                     // For box animations
    animSpeed: 500,                 // Slide transition speed
    pauseTime: 3000,                 // How long each slide will show
    startSlide: 0,                     // Set starting Slide (0 index)
    directionNav: true,             // Next & Prev navigation
    controlNav: true,                 // 1,2,3... navigation
    controlNavThumbs: false,         // Use thumbnails for Control Nav
    pauseOnHover: true,             // Stop animation while hovering
    manualAdvance: false,             // Force manual transitions
    prevText: 'Prev',                 // Prev directionNav text
    nextText: 'Next',                 // Next directionNav text
    randomStart: false,             // Start on a random slide
    beforeChange: function(){},     // Triggers before a slide transition
    afterChange: function(){},         // Triggers after a slide transition
    slideshowEnd: function(){},     // Triggers after all slides have been shown
    lastSlide: function(){},         // Triggers when last slide is shown
    afterLoad: function(){}         // Triggers when slider has loaded
});
});
</script>

<?php include( 'includes/footer.php' ); ?>

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


It has made the slideshow disappear on the website as am guessing is because no images for it have been uploaded via the admin side but I can't see anywhere on the admin side to upload the images for the slideshow

Is that code all ok above?

Thank you in advance

Kind regards

Ian
Hi Ian,

I can't see anywhere on the admin side to upload the images for the slideshow

To begin with, I'm not sure why you are using cms:template block thrice on the page -
<cms:template title='Home'>
<cms:editable name='page_title' label='title' type='text' />
</cms:template>

<cms:template>

<cms:template title='Slideshow'>
<cms:repeatable name="slider" label='slider' >
<cms:editable name='slider_image'
label="Slideshow Image"
width="960"
height="300"
show_preview='1'
preview_width="150"
type="image" />
<cms:editable name='slider_text'
label="Text"
type="text" />
<cms:editable name='slider_caption'
label="Caption"
type="text" />
</cms:repeatable>
</cms:template>
</cms:template>

We need to have it only once per template and you can place multiple cms:editable definitions within that block. Your code should have been -
<cms:template title='Home'>
<cms:editable name='page_title' label='title' type='text' />


<cms:repeatable name="slider" label='slider' >
<cms:editable name='slider_image'
label="Slideshow Image"
width="960"
height="300"
show_preview='1'
preview_width="150"
type="image" />
<cms:editable name='slider_text'
label="Text"
type="text" />
<cms:editable name='slider_caption'
label="Caption"
type="text" />
</cms:repeatable>

</cms:template>

Please make the suggested changes and you should get a table of repeatable regions in 'Home' template where you can input the images. I've tested the code and it is working so if it does not work for you please make sure you are accessing the modified template as super-admin.

Let me know how it goes.
Thanks.
Hi KK

Thank you for the reply, appreciate it

I not have the following code

Code: Select all
<?php require_once( 'cms/cms.php' ); ?>

<cms:template title='Home and Slideshow'>
<cms:editable name='page_title' label='title' type='text' />
<cms:repeatable name="slider" label='slider' >
   <cms:editable name='slider_image'
      label="Slideshow Image"
      width="980"
      height="300"
      show_preview='1'
      preview_width="150"
      type="image" />
     <cms:editable name='slider_text'
      label="Text"
      type="text" />
   <cms:editable name='slider_caption'
      label="Caption"
      type="text" />
</cms:repeatable>
</cms:template>

<title><cms:show page_title/></title>

<?php
$title = "";

$pgDesc="";

$pgKeywords="";

include ( 'includes/header.php' );
?>
<!--CONTENT-->

   <div id="column-top-whole">
    <div class="slider-wrapper theme-default">
    <div id="slider" class="nivoSlider">
        <cms:show_repeatable 'slider' >
   <img src="<cms:show slider_image />" />
</cms:show_repeatable>
    </div>
    </div>
    </div>

<?php include( 'includes/footer.php' ); ?>

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


It's not updating on the admin side though, it still says Home as the page title on the left instead of Home and Slideshow, I have logged out of the admin side, then tried view site in the top right and is still the same title in the admin side?
If you are sure you are refreshing the template as super-admin, then perhaps the PHP files (header.php and footer.php) you are including are in some way messing up the process.

Please try temporarily removing the two include statements and try again.
If still it does not work please use the tip detailed at viewtopic.php?p=13845#p13845 to 100% ensure you are accessing the template as super-admin - that would be the only cause as I have already tried your code and it was working for me.
Don't get it, tried everything and is still the same, could it be that when I viewed the page source on the main website, it has blank lines at the top and one blank line at the bottom, I just thought that is where the php coding is and does not show that in the page source

or also thought is it where I have made the url's SEO friendly and used htaccess to remove the .php from the address bar
Please PM me your site's FTP + Couch (super-admin) access creds. Let me take a look at the issue.
all done, hopefully will come through shortly

Thank you so much for taking a look
Hi KK

the pm seems to be stuck in my outbox for some reason, have you got a email address I can send the info to please

Kind regards

Ian
Thanks for the creds.
It's not updating on the admin side though, it still says Home as the page title on the left instead of Home and Slideshow,
I logged-in as superadmin and visited index.php. The admin panel now shows 'Home and Slideshow' and the repeatable regions are available for entry.

So, there is nothing I did except logon as super-admin and access the template while I'm logged in.

Hope it helps.
Hi

Ahh yeah is working now, strange why didn't take effect straight away

Very strange, but thank you so much for taking a look and for replying, really appreciate it
10 posts Page 1 of 1
cron