Page 1 of 2

S04e02 - Carousel on Index QUESTIONS/SUPPORT

Posted: Tue Jan 04, 2022 6:01 am
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

Re: S04e02 - Carousel on Index

Posted: Fri Feb 18, 2022 10:05 am
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>

Re: S04e02 - Carousel on Index

Posted: Sun Feb 20, 2022 11:11 am
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.

Re: S04e02 - Carousel on Index

Posted: Mon Feb 21, 2022 10:02 pm
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

Re: S04e02 - Carousel on Index

Posted: Tue Feb 22, 2022 5:29 pm
by 14Steve14
Many thanks Daniel. I thought I had tried that but couldn't have as it works like a charm. :D

Re: S04e02 - Carousel on Index

Posted: Sun Jun 25, 2023 6:04 pm
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

Re: S04e02 - Carousel on Index

Posted: Sun Jun 25, 2023 7:33 pm
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' => '']);

Re: S04e02 - Carousel on Index

Posted: Mon Jun 26, 2023 6:08 pm
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

Re: S04e02 - Carousel on Index

Posted: Tue Sep 19, 2023 7:52 am
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.

Re: S04e02 - Carousel on Index

Posted: Wed Mar 13, 2024 8:57 pm
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?