S04e02 - Carousel on Index QUESTIONS/SUPPORT

Open to all! Ask other shopowners for help.
admin
Contributor
Posts: 217
Joined: Wed Oct 30, 2019 1:34 pm
Phoenix Version:
Has thanked: 20 times
Been thanked: 22 times

S04e02 - Carousel on Index QUESTIONS/SUPPORT

Post by admin »

Addon:
Adds a Carousel on the Index Page

Download:
viewtopic.php?f=28&t=1061

Note:
Carousel became Core Code in later versions of Phoenix, so please first check if your version already has this pre-loaded.

--

Questions / Comments / Concerns

Tags:


Join The Code Co-op to get access to your library in the Code Co-op Forum
14Steve14
Senior Contributor
Posts: 920
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: S04e02 - Carousel on Index

Post by 14Steve14 »

Using version for 1.0.7.11 but code seems similar to latest version

Is there any way of getting the carousel to centre on the front page and remain responsive. Currently it seems to be across on the left of the page, which could be the default with bootstrap. Have tried a few examples found online and nothing seems to centre it.

Code: Select all

<div class="col-sm-<?php echo $content_width; ?> mb-2 cm-i-slider">
  <div id="cmislider" class="carousel slide<?php echo $cm_i_slider_fade; ?>" data-ride="carousel">
    <?php echo $cm_i_indicator_output; ?>
    <div class="carousel-inner">
      <?php echo $cm_i_slider_output; ?>
    </div>
    <?php echo $cm_i_slider_controls; ?>
  </div>
</div>
14Steve14
Senior Contributor
Posts: 920
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: S04e02 - Carousel on Index

Post by 14Steve14 »

I have tried all sorts of code additions found online and the best I can get is to wrap the standard code in a new div and centre that. It sort of works but the slider re-aligns on refreshes. At least its in the centre now.
User avatar
Kofod95
Senior Contributor
Posts: 748
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.20
Has thanked: 99 times
Been thanked: 179 times

Re: S04e02 - Carousel on Index

Post by Kofod95 »

14Steve14 wrote: Fri Feb 18, 2022 10:05 am Is there any way of getting the carousel to centre[...]
Sorry for late answer!
I saw your question and wanted to try something, but forgot about it..
Now I've just tried adding text-center and it seems to work:

Code: Select all

<div class="col-sm-<?php echo $content_width; ?> mb-2 cm-i-slider text-center">
//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
14Steve14
Senior Contributor
Posts: 920
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: S04e02 - Carousel on Index

Post by 14Steve14 »

Many thanks Daniel. I thought I had tried that but couldn't have as it works like a charm. :D
User avatar
tessthepup
Certified Developer
Posts: 381
Joined: Mon Mar 01, 2021 5:55 pm
Phoenix Version:
Has thanked: 47 times
Been thanked: 62 times

Re: S04e02 - Carousel on Index

Post by tessthepup »

insights_ss.png
Good evening,

I have ran my site through Google PageSpeed Insights and have a little issue with it throwing up missing alt tags on the various sliders I am using.

I have tried adding the alt tag to use the slider name but it does not show in the source so not sure if I am adding it to the correct line or even adding it correctly.

Has anyone else had this and been able to resolve it.

Thanks

Mark
You do not have the required permissions to view the files attached to this post.
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: S04e02 - Carousel on Index

Post by ecartz »

tessthepup wrote: Sun Jun 25, 2023 6:04 pm not sure if I am adding it to the correct line or even adding it correctly.
If you told us what line and showed us your modified version, we could probably tell you if it is the correct line and added correctly.

Code: Select all

                $cm_i_slider_output .= new Image('images/' . $a['advert_image'], ['alt' => '']);
User avatar
tessthepup
Certified Developer
Posts: 381
Joined: Mon Mar 01, 2021 5:55 pm
Phoenix Version:
Has thanked: 47 times
Been thanked: 62 times

Re: S04e02 - Carousel on Index

Post by tessthepup »

ecartz wrote: Sun Jun 25, 2023 7:33 pm
tessthepup wrote: Sun Jun 25, 2023 6:04 pm not sure if I am adding it to the correct line or even adding it correctly.
If you told us what line and showed us your modified version, we could probably tell you if it is the correct line and added correctly.

Code: Select all

                $cm_i_slider_output .= new Image('images/' . $a['advert_image'], ['alt' => '']);
@ecartz
Thank you, that was exactly what was required and boosted the SEO rating to 100 :D
lecarlb
Contributor
Posts: 316
Joined: Mon Oct 26, 2020 5:26 pm
Phoenix Version:
Has thanked: 48 times
Been thanked: 9 times

Re: S04e02 - Carousel on Index

Post by lecarlb »

Hello,

What size images are recommended to avoid distortion?

- OR -

What size images does anyone use?

I'm using the latest version of Phoenix.

Thank you.
lecarlb
Contributor
Posts: 316
Joined: Mon Oct 26, 2020 5:26 pm
Phoenix Version:
Has thanked: 48 times
Been thanked: 9 times

Re: S04e02 - Carousel on Index

Post by lecarlb »

I installed on a 1.0.8.4 version site and get the following error:

Code: Select all

[Wed Mar 13 13:38:35.329141 2024] [php7:error] [pid 21236] [client 173.190.176.123:63939] PHP Fatal error:  Uncaught Error: Object of class Image could not be converted to string in /usr/local/apache/subdomains/BTFraGranc3SbutL3r/www.xxxxxxxxxx.com/htdocs/includes/modules/content/index/cm_i_slider.php:51\nStack trace:\n#0 /usr/local/apache/subdomains/BTFraGranc3SbutL3r/www.xxxxxxxxxx.com/htdocs/includes/system/versioned/1.0.7.9/osc_template.php(106): cm_i_slider->execute()\n#1 /usr/local/apache/subdomains/BTFraGranc3SbutL3r/www.xxxxxxxxxx.com/htdocs/templates/default/includes/pages/index.php(44): oscTemplate->getContent()\n#2 /usr/local/apache/subdomains/BTFraGranc3SbutL3r/www.xxxxxxxxxx.com/htdocs/index.php(17): require('/usr/local/apac...')\n#3 {main}\n  thrown in /usr/local/apache/subdomains/BTFraGranc3SbutL3r/www.xxxxxxxxxx.com/htdocs/includes/modules/content/index/cm_i_slider.php on line 51, referer: https://xxxxxxxxxx.com/
Is there a size minimum or maximum?


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply