Using Global Content Blocks to create a slideshow

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
KatrinaMac
New Member
New Member
Posts: 3
Joined: Sun Aug 02, 2015 8:04 pm

Using Global Content Blocks to create a slideshow

Post 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
Last edited by KatrinaMac on Mon Aug 03, 2015 7:19 am, edited 1 time in total.
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm

Re: Using Global Content Blocks to create a slideshow

Post 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.
staartmees
Power Poster
Power Poster
Posts: 1049
Joined: Wed Mar 19, 2008 4:54 pm

Re: Using Global Content Blocks to create a slideshow

Post by staartmees »

Showtime still works with cmsms 1.12, http://dev.cmsmadesimple.org/projects/showtimemod
KatrinaMac
New Member
New Member
Posts: 3
Joined: Sun Aug 02, 2015 8:04 pm

Re: Using Global Content Blocks to create a slideshow

Post 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?
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm

Re: Using Global Content Blocks to create a slideshow

Post by Jeff »

From that code where is {$foo} getting assigned?

What javascript are you using?
KatrinaMac
New Member
New Member
Posts: 3
Joined: Sun Aug 02, 2015 8:04 pm

Re: Using Global Content Blocks to create a slideshow

Post 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
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1974
Joined: Mon Jan 29, 2007 4:47 pm

Re: Using Global Content Blocks to create a slideshow

Post 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!
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Post Reply

Return to “The Lounge”