Page 1 of 1

Using Global Content Blocks to create a slideshow

Posted: Sun Aug 02, 2015 8:13 pm
by KatrinaMac
Hi

I have jumped into another developers sites and am trying to build a new site using his framework. I have the basically template completed and am trying to create a slideshow, with three slides that will scroll from left to right automatically. I am confused because I have taken the same jquery.js file, global content block code, html code and css from a similar site with the desired slideshow. Unfortunately this doesn't seem to work on my new site. (I am obviously changing css and slight sizes to match my current sites templates.) Would appreciate any help even if there is an easier more common way of coding slideshows. I am relatively new to developing so I hope I have been clear enough.

This is the code I have taken from the other sites working slideshow's global content block:

Code: Select all

{for $foo=1 to 10}{capture assign="slidefile"}images/slideshow/{$root_alias}/slideshow{if $foo < 10}0{/if}{$foo}.jpg{/capture}{capture assign="quotefile"}images/slideshow/{$root_alias}/quote{if $foo < 10}0{/if}{$foo}.png{/capture}{capture assign="x"}{if $root_alias eq "home"}{if $foo eq 1 or $foo eq 2}40{else}700{/if}{elseif $root_alias eq "news"}{elseif $root_alias eq "services"}{elseif $root_alias eq "our-history"}{elseif $root_alias eq "plant-machinery"}{elseif $root_alias eq "mill-shop"}{elseif $root_alias eq "contact"}{/if}{/capture}{if file_exists($slidefile)}<img src="{$slidefile}" rel="{if file_exists($quotefile)}{$quotefile}{/if}" width="960" height="350" data-x="{$x}" alt="{$title}" />{/if}{/for} 
my slideshow template looks like this:

Code: Select all

 <div id="slideshow-wrapper">
  <div id="caption-container"><div id="caption"></div></div>
  <div id="slideshow">{global_content name='slideshow'}</div>
  <a href="#" id="prev" title="Show previous">&nbsp;</a>
  <a href="#" id="next" title="Show next">&nbsp;</a>
 </div>
Using this in my new site, produces no result.

Thanks

Re: Using Global Content Blocks to create a slideshow

Posted: Mon Aug 03, 2015 12:13 am
by Jeff
Without seeing the code you are trying to use, it is almost impossible to say what is wrong.

Please show us the code or provide a link to the dev site.

Re: Using Global Content Blocks to create a slideshow

Posted: Mon Aug 03, 2015 7:16 am
by staartmees
Showtime still works with cmsms 1.12, http://dev.cmsmadesimple.org/projects/showtimemod

Re: Using Global Content Blocks to create a slideshow

Posted: Mon Aug 03, 2015 8:18 am
by KatrinaMac
Is there a way to get the showtime slideshow to display three images across the webpage? I want the visual to show one image and half of the next and previous image. I have tried using the Showtime module to get this effect but it didn't seem possible?

Re: Using Global Content Blocks to create a slideshow

Posted: Mon Aug 03, 2015 4:38 pm
by Jeff
From that code where is {$foo} getting assigned?

What javascript are you using?

Re: Using Global Content Blocks to create a slideshow

Posted: Mon Aug 03, 2015 7:12 pm
by KatrinaMac
I'm not entirely sure how the $foo in the global content block is working or where it has been assigned. I've had a quick look and can't see how its been used, sorry I'm confused!

As for the javascript I am using jQuery.init.js and jQuery.carouFredSel-6.2.1.js

Thanks

Re: Using Global Content Blocks to create a slideshow

Posted: Mon Aug 03, 2015 9:26 pm
by Jo Morg
KatrinaMac wrote:I'm not entirely sure how the $foo in the global content block is working or where it has been assigned. I've had a quick look and can't see how its been used, sorry I'm confused!
It seems that $foo goes through a number sequence to resolve into numbered file names from 0 to 9: slideshow{$foo}.jpg and which should reside in the folder images/slideshow/{$root_alias}/. The excessive use of capture tags may render the code extremely slow for one, and the logic seems a bit clumsy too. You need to make sure that {$root_alias} is set on that context and what it's value.
You should set $config['debug'] = 1; on your config.php file and see if there are any visible PHP errors, notices or warnings. You should also compare the rendered HTML from both sites to see what you should expect that isn't there... There is a lot of missing data for us to be able to help more... On my SIG there is a link you should read carefully: Before Asking For Help!