Jump to content
Sign in to follow this  
phillip

How can I add more than one Carousel per page?

Recommended Posts

cdhphoenix

has anyone found a guide to doing this? I am interested in this as well..... @Andrew: are you saying we should create: section.carousel2.php and section.carousel3.php (depending on how many carousels we need) and upload to the folder in which the carousel.php is in (sections>carousel)? I looked at the coding in the php and assume the first request needs to be changed??

class PageLinesCarousel extends PageLinesSection {
	
	   function __construct( $registered_settings = array() ) {
	
			$name = __('PageLines Carousel', 'pagelines');
			[b]$id = 'carousel[/b]';
	
			$default_settings = array(
				'description' 	=> 'This is a javascript carousel that can show images and links from posts, FlickRSS, or NextGen Gallery.',
				'workswith'		=> array('content', 'header', 'footer'),
				'icon'			=> CORE_IMAGES . '/admin/carousel.png',
				'version'		=> 'pro',
			);
	
			$settings = wp_parse_args( $registered_settings, $default_settings );
	
			parent:GDN__construct($name, $id, $settings);
	   }

Do we change: id: carousel to id: carousel2? Or does it involve more tweaking than that? Let me know if I am on the right track? Thanks guy. -Carolyn

Share this post


Link to post
Share on other sites
bryan-hadaway

Hold for Adam or Andrew who will have more insight into this. Thanks, Bryan

Share this post


Link to post
Share on other sites
cdhphoenix

thanks bryan, I appreciate your reply.

Share this post


Link to post
Share on other sites
cmunns

Yes, create a copy of section.carousel.php in Base. What I would do is a search and replace for every "carousel" in that document and use "carousel2" remember to register it in the functions.php file: `pagelines_register_section('PageLinesCarousel2', 'carousel2', null, array('child' => true) );` if the new carousel doesn't rotate then we may need to adjust the path to the js in the new section.

Share this post


Link to post
Share on other sites
cdhphoenix

Hi, Not sure if i should start a new thread as this is not my orignal inquiry. But i followed your instructions, created a section.carousel2.php (and copy and pasted the original code from section.carousel.php into it) and placed it into my base theme. I think did a "find & replace all" of "carousel" and replaced it with "carousel2" within the section.carousel2.php. Added the hook to my base functions.php:

	pagelines_register_section('PageLinesCarousel2', 'carousel2', null, array('child' => true) );

And nothing registered in my pagelines admin template settings to show my an addition carousel box. Perhaps Kate is right in that doing this may not have any connection to the admin panel. Let me know if this is possible, if it isn't I completely understand. Thank you, Carolyn

Share this post


Link to post
Share on other sites
bryan-hadaway

Please await further developer help. Thanks, Bryan

Share this post


Link to post
Share on other sites
cmunns

In theory it should work, but maybe you have some js errors or are redeclaring a shared function? Do you get errors in your js console?

Share this post


Link to post
Share on other sites
immediatemusic

I'm not seeing anything indicating JS errors, although I'm not a JS expert. Is there anywhere else where some code may need modification? It just doesn't appear in the Template Setup. If there is a way to manually call the new carousel2 section into my page I'm willing to do that as well. Still searching around the forum and the theme to find the solution. If you've got an inkling drop a line... Thanks, IM

Share this post


Link to post
Share on other sites
immediatemusic

OK, I did it. Hacked my way to some usable result. Basically duplicated everything mentioning 'carousel', including hierarchies, added a page.beta2.php to for the template, and things seem to be running smoothly.

Share this post


Link to post
Share on other sites
immediatemusic

Also, it's cleaner to do a replace all on "arousel" to "arousel2" to maintain instances of capitalization. Any filenames in the new hierarchy need to have a '2' added after 'carousel' as well, i.e. 'carousel.jcarousel.js' becomes 'carousel2.jcarousel2.js.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×