Jump to content

Make Homeslider appear in one CMS page with different images


rofli123

Recommended Posts

Hey,

 

I am trying to make Homeslider module apear on only one CMS page (and index too) which I have already managed. The thing s that it's the only thing that appears. Left, middle, and right column are gone,not there, and it appears 404 message on bottom of the Homeslider on this CMs page.

 

I would also need help regarding the image paths. I want to make this second homeslider display different images and have different settings. I played a bit with the code but can't manage to find the mysql database where the images are stored. I've found this but no luck ._DB_PREFIX_.'homeslider.

 

Is this possible to do? Can i have homeslider twice with different settings?

 

Thanks for your help.

 

Regards

Edited by rofli123 (see edit history)
Link to comment
Share on other sites

You can't create two sliders with different images unless you duplicate and rename the module, which involves renaming the PHP file, classes and settings to homeslider2.

 

To display it at the top of the homepage and of one CMS page, I suggest changing line 26 of themes/default-bootstrap/modules/homeslider/homeslider.tpl from:

{if $page_name =='index'}

to:

{if $page_name =='index' || ($page_name == 'cms' && isset($smarty.get.id_cms) && $smarty.get.id_cms == 1)}

Change 1 to the ID of the CMS page you want to display the slider on.

 

You'll also need to change lines 586 and 611 of modules/homeslider/homeslider.php from:

		if (!isset($this->context->controller->php_self) || $this->context->controller->php_self != 'index')
			return;

to:

		if (!isset($this->context->controller->php_self) || $this->context->controller->php_self != 'index' && $this->context->controller->php_self != 'cms'))
			return;
Edited by rocky (see edit history)
Link to comment
Share on other sites

Hi, sorry for double post.

 

I follow your tutorial vekia. How can I put the slider into the cms page body? I copy paste code in code section of editor but no slider, only images.

 

Thanks

 

EDIT: I see that my <script> are getting blocked somehow. I did edit the checking function though. Any help?

 

How can I integrate that slider?

Edited by rofli123 (see edit history)
Link to comment
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
×
×
  • Create New...