Search Form and Social Buttons

HotThemes Logo and Top Menu

To request a forum account, please login here and open support ticket. Only customers with active order(s) can open forum account!

× Discussion about "Restaurant" Joomla template

Topic-icon Carousel start image

More
6 years 8 months ago #3151 by rruiten
rruiten created the topic: Carousel start image
Is it possible to set the first image the carousel starts with and can the order be set for the other images?

Regards,

Rob

Please Log in to join the conversation.

More
6 years 8 months ago #3153 by milos
milos replied the topic: Re: Carousel start image
You should rename images in alphabetical order. That's how you control order of the images, in example, 1-image.jpg, 2-image.jpg, and so on...

Please Log in to join the conversation.

More
6 years 8 months ago #3154 by rruiten
rruiten replied the topic: Re: Carousel start image
Hmmm... doesn't work as expected.
The first one goes well, but the others mix up. Not random but they have a fixed order other then the image(number) order.

I've tried
1-image.jpg
2-image.jpg etc... total of 8 images
it runs 1, 2, 6, 3, 4, 8, 7, 5
Regards,

Rob

Please Log in to join the conversation.

More
6 years 8 months ago #3155 by milos
milos replied the topic: Re: Carousel start image
Please edit file /modules/hot_joomla_carousel/tmpl/default.php, and find line
for ($loop = 0; $loop <= $infinite_pics_number; $loop += 1) {

Add the following code AFTER this line
sort($infinite_pic);

Please Log in to join the conversation.

More
6 years 8 months ago #3156 by rruiten
rruiten replied the topic: Re: Carousel start image
We are getting there.
At first it seems to work but then i discovered that i was missing a picture.
It played 1 trough 7 but skipped 8. Then i had another look at the PHP source and saw that you counted the array and deducted 2 of the count

$infinite_pics_number = count($infinite_pic)-2
So $infinite_pics_number becomes 6 (8 count array name pictures - 2)

The $loop runs from 0 to <= 6 ($infinite_pics_number) = a total of 7 names from array $infinite_pics.

I changed the code as follows:
$infinite_pic = explode("||", $infinite_list);
sort($infinite_pic);
$infinite_pics_number = count($infinite_pic)-1;
for ($loop = 0; $loop <= $infinite_pics_number; $loop += 1)

Now $loop runs from 0 to 7 a total of 8

It works, but because i don't know the impact on the rest of the site, i would like to know if it's the correct sollution.

Regards,

Rob

Please Log in to join the conversation.

More
6 years 8 months ago #3162 by milos
milos replied the topic: Re: Carousel start image
If it works like that on your server, it's OK. It doesn't have any influence to the other parts of the site.
The following user(s) said Thank You: rruiten

Please Log in to join the conversation.

Time to create page: 0.138 seconds

Links, Partners and Social Media