Problems, need help? Have a tip or advice? Post it here.
12 posts Page 1 of 2
Ive created clonable flipbook.php for a client and of course each flipbook has multiple images....I am trying to hook ot to my index.php to a slider section to show each flipbook..I did it fine but have a placeholder instead of an image in the bar representing the flipbook......I m using repeatable regions for the flipbook and attempted to follow the thumbnail tutorial to pull a thumbnail...however the thumbnail doesnt show up in the admin panel and doesnt show in the slider of index.php...I placed the "<cms:show flipbook_pages_thumb />" on index.php
How can I creat a thumbnail image to place in my slider on index.php?? I get the image symbol for the thumbnail in the admin panel but nothing else even after saving ,,deleting and re-adding
Code: Select all
<cms:template title='Flipbook' clonable='1'>
<cms:repeatable name='flipbook_pages' >
<cms:editable name='flipbook_pages' label='flipbook pages' width='1000' height='800' show_preview='1' preview_width='200'  quality='100' type='image'/>
</cms:repeatable>
<cms:editable name='flipbook_pages_thumb' label='flipbook pages Thumbnail' desc='Thumbnail of main image'
  width='200' height='200' show_preview='1' assoc_field='flipbook_pages' type='thumbnail' />
</cms:template>
<!DOCTYPE html>

Code: Select all
<section>
      
               <div id="mybook">
                <cms:show_repeatable 'flipbook_pages' startcount='1'>
                     <div title="<cms:show k_count />">
               <h3><img src="<cms:show flipbook_pages />" alt="" /></h3>
                  
                     </div>
          </cms:show_repeatable>
       </div>
Hi,

Type 'thumbnail' editable region does not work with repeatable regions.
As a substitute for that we have the cms:thumbnail tag - please see http://www.couchcms.com/docs/tags-refer ... ail-1.html

Following should create the thumbnails for you
Code: Select all
<cms:show_repeatable 'flipbook_pages' startcount='1'>
<div title="<cms:show k_count />">
    <h3><img src="<cms:show flipbook_pages />" alt="" /></h3>
   
    <img src="<cms:thumbnail flipbook_pages width='200' height='200' />" />

</div>
</cms:show_repeatable>

P.S. You are using the same name for both cms:repeatable and the cms:editable region within it. It is likely to confuse Couch at some point. Please rename the editable region to soemthing like, say, flipbook_image.
ive tried your suggestion and still get an icon for a thumbnail image in the admin panel but no image...I changed the name of editable region as well.Ive attempted several different things to try and get the thumbnail to show up but still not getting it..Im sure its something im doing wrong somewhere..
Code: Select all
<cms:repeatable name='flipbook_pages' >
<cms:editable name='flipbook_image' label='flipbook image' width='1000' height='800' show_preview='1' preview_width='200'  quality='100' type='image'/>
<cms:editable name='flipbook_image_thumb' label='flip Thumbnail' desc='Thumbnail of main image'
  width='200'
  height='200'
show_preview='1'
  assoc_field='flipbook_image'
  type='thumbnail' />
</cms:repeatable>

Code: Select all
  <div id="mybook">
                <cms:show_repeatable 'flipbook_pages' startcount='1'>
                     <div title="<cms:show k_count />">
               <h3><img src="<cms:show flipbook_image />" alt="" /></h3>
           <img src="<cms:thumbnail flipbook_image width='200' height='200' />" />
                     </div>
          </cms:show_repeatable>
       </div>
As I mentioned before, type 'thumbnail' won't work with repeatable so you need to remove it - it won't show anything. Your code should simply be -
Code: Select all
<cms:repeatable name='flipbook_pages' >
    <cms:editable name='flipbook_image' label='flipbook image' width='1000' height='800' show_preview='1' preview_width='200'  quality='100' type='image'/>
</cms:repeatable>

To show the thumbnails (on the frontend) , we'll use cms:thumbnail tag instead as follows -
Code: Select all
<cms:show_repeatable 'flipbook_pages' startcount='1'>
    <div title="<cms:show k_count />">
        <h3><img src="<cms:show flipbook_image />" alt="" /></h3>
        <img src="<cms:thumbnail flipbook_image width='200' height='200' />" />
    </div>
</cms:show_repeatable>
Its still not showing the thumb on index.php.....I apologize Im sure its me not understanding something correctly but heres the code on index.php
Code: Select all
<div class="container demo-1">
         

            <div class="main">
            <header class="clearfix">   
               <h2>Specials Sections</h2>
               
            </header>
                           
            <!-- Elastislide Carousel -->
            <ul id="carousel" class="elastislide-list">
            <cms:pages masterpage='flipbook.php' limit='6' >
<li><a href="<cms:show k_page_link />"><img src="<cms:show flipbook_image_thumb />" /></a></li>
            </cms:pages>   
            </ul>
            <!-- End Elastislide Carousel -->

            <p><strong></strong></p>

            <p class="info"><strong></strong></p>
                    
                  </div>
      </div>
      <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
      <script type="text/javascript" src="js/jquerypp.custom.js"></script>
      <script type="text/javascript" src="js/jquery.elastislide.js"></script>
      <script type="text/javascript">
         
         $( '#carousel' ).elastislide();
         
      </script>


In your code you are trying to show flipbook_image_thumb which I've already told you will not work (you should have deleted the editable region named 'flipbook_image_thumb').
<cms:pages masterpage='flipbook.php' limit='6' >
<li><a href="<cms:show k_page_link />"><img src="<cms:show flipbook_image_thumb />" /></a></li>
</cms:pages>


I'm no longer sure what your definitions for the editable regions are at the moment and whether you are using repeatable region or not.

Going by what you provided me initially, your definitions should be -
Code: Select all
<cms:repeatable name='flipbook_pages' >
    <cms:editable name='flipbook_image' label='flipbook image' width='1000' height='800' show_preview='1' preview_width='200'  quality='100' type='image'/>
</cms:repeatable>

If that is so, try using the following code in your template to show the images (and thumbnails) contained in the repeatable-regions -
Code: Select all
<cms:pages masterpage='flipbook.php' limit='6' >
    <h2><a href="<cms:show k_page_link />"></h2>
    <cms:show_repeatable 'flipbook_pages' startcount='1'>
        <div title="<cms:show k_count />">
            <h3><img src="<cms:show flipbook_image />" alt="" /></h3>
            <img src="<cms:thumbnail flipbook_image width='200' height='200' />" />
        </div>
    </cms:show_repeatable>
</cms:pages>

If that does not work, please attach the full template here (zip it first please).
ive tried everyway including the code above....I had removed the editable region-put it back-removed again....Ive tried the "show" tag-,Ive tried I think everything I have read about the thumbnail and your thoughts as well..Ive removed the index.php and flipbook.php templates each time and added back....Here is a screenshot of what I have now when I first started in my slider bar and here are flipbook.php and index.php templates.....Thank you.

Attachments

Well its simple. I will try to explain the things to you.

What you have done?
The following is your code to achieve displaying the thumbnails:
Code: Select all
<!-- Elastislide Carousel -->
<ul id="carousel" class="elastislide-list">
     <cms:pages masterpage='flipbook.php' limit='6' >
          <li>
               <a href="<cms:show k_page_link />">
                    <img src="<cms:thumbnail       width='200' height='200' />" />
               </a>
          </li>      
     </cms:pages>   
</ul>
<!-- End Elastislide Carousel -->


The output of your code (you can run the code in browser and then check the Page Source to find this code) is:
Code: Select all
<!-- Elastislide Carousel -->
<ul id="carousel" class="elastislide-list">
     <li>
          <a href="http://www.marioncountynews.net/flipbook.php?p=178">
               <img src="" />
          </a>
     </li>
     <img src="" />
                               
     <li>
          <a href="http://www.marioncountynews.net/flipbook.php?p=170">
               <img src="" />
          </a>
     </li>
     <img src="" />
</ul>
<!-- End Elastislide Carousel -->




What you should Do:

As you can see above, the <img> tags "src" attribute comes up empty.
Now this happens because, in your couch code above, you have used the <cms:pages> tag to be able to show the "flipbook_image" variable, which is correct. But then here is where all goes wrong.

"flipbook_image" variable is a couch editable region and hence you tried to use it directly. But since this editable region is actually within <cms:repeatable> tag, you need to use <cms:show_repeatable> tag to view the output.

Hence the solution to your problem will be the following code, which you need to put in your index.php:

Code: Select all
<!-- Elastislide Carousel -->
<ul id="carousel" class="elastislide-list">
        <cms:pages masterpage='flipbook.php' limit='6' >
            <cms:show_repeatable 'flipbook_pages' startcount='1' >
                    <li>
                        <a href="<cms:show k_page_link />">
                            <img src="<cms:thumbnail flipbook_image width='200' height='200' />" />
                        </a>
                    </li>
            </cms:show_repeatable>
   </cms:pages>   
</ul>
<!-- End Elastislide Carousel -->


Once you use this code in your index.php, refresh your browser and then again check the source output and you will get:

Code: Select all
<!-- Elastislide Carousel -->
<ul id="carousel" class="elastislide-list">               
   <li>
            <a href="http://localhost/couch_site_sols/flipbook.php?p=4">
                <img src="http://localhost/couch_site_sols/couch/uploads/image/background-1-200x200.jpg" />
            </a>
        </li>
                       
   <li>
            <a href="http://localhost/couch_site_sols/flipbook.php?p=4">
                <img src="http://localhost/couch_site_sols/couch/uploads/image/elizabeth-200x200.png" />
            </a>
      </li>         
</ul>
<!-- End Elastislide Carousel -->


Well the code code under the section What you should Do: will display the images of your flipbook. But as a matter of fact, as it is usually in these newspaper sites, probably you want to achieve showing only the first page of each flipbook and hence you have used the attribute "limit" in <cms:pages>. But the solution that I have given you above will actually display only 6 images from the most recent flipbook/ flipbooks.

In case you want to display only the first page of the flipbooks, the use the code below. I have enclosed the display of the <li> inside <cms:if k_count le '1'>...</cms:if>. This will do the trick to display only the first page of the 6 flipbook that you want to display (by default even if there are 20 flipbooks, still the most recent 6 flipbooks' coverpage will be displayed using the code below:

Code: Select all
<!-- Elastislide Carousel -->
<ul id="carousel" class="elastislide-list">
        <cms:pages masterpage='flipbook.php' limit='6' >
            <cms:show_repeatable 'flipbook_pages' startcount='1' >
                <cms:if k_count le '1'>
                    <li>
                        <a href="<cms:show k_page_link />">
                            <img src="<cms:thumbnail flipbook_image width='200' height='200' />" />
                        </a>
                    </li>
                </cms:if>
            </cms:show_repeatable>
   </cms:pages>   
</ul>
<!-- End Elastislide Carousel -->


I hope this helps you solve your problem. Even @KK Sir had explained you the same. but I suppose, since you are new to repeatable regions, you are facing problems.

Feel free to test the code i gave you, and let me know if it works for you.

Regards,
GenXCoders
Image
where innovation meets technology
@GenXCoders,
I do appreciate your help on the suggestions you've given and just followed your code on another shot at a solution....Iremoved all uploaded images I had uploaded,added the code in index.php and tried again....however same issue-no thumbnail but placeholder...Here is a screenshot of page source..I uploaded 1 image to test ...

Attachments

@ZeroTechz:

well if you can see, the problem is highlighted in RED.

Nesting of tags is occuring (i.e. tag inside another tag), which is not possible in HTML.

Please notice:
Code: Select all
<li><a href="http://www.marioncountynews.net/flipbook.php?p=182"><img src="<img src="http://www.marioncountynews.net/couch/uploads/image/8-1-200x200.jpg" /></a></li>


how can this be possible???
Code: Select all
<img src="<img src=


From above remove the starting
Code: Select all
<img scr="
that should be it. If you have noticed, the solution that we are looking at now is showing the placeholder with a complete image and not broken path image. That means the image path is now being supplied to the src attribute.

Just remove the first of the two, <img src=" and then rerun... It should be good to go!!!

Once you remove it, you will get output like this, which you are desirous of:
zerotechz.png
zerotechz.png (500.07 KiB) Viewed 2545 times



Regards,
GenXCoders
Image
where innovation meets technology
12 posts Page 1 of 2