2. No you don't need to use any JS as it's just "hover" that you need which you can do with CSS. So you will need to alter the TWIG file to add in a new container that has that second image, set it's opactity to 0 and then change opacity to 1 to show it (or something similar to that).
This is considered as a customization request which falls way beyond the scope of this support forum. You can always try to post your request in our The Marketplace forum and get (paid) support from someone that is willing to do this.
Regards, Mark.
Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
Re: SOLVED Rollover - Change image on rollover effect on Promo Image Particle
Posted 7 years 5 months ago
Hello MrT,
thank you for your input.
I finally figured out how to do it. For those who meet the same need :
1. Modified promoimage.yaml in [TEMPLATE]/particles/
***********
BEFORE :
image:
type: input.imagepicker
label: Promo Image
description: Select desired promo image.
***********
AFTER (to add my new image field):
image:
type: input.imagepicker
label: Promo Image
description: Select desired promo image.
imageover:
type: input.imagepicker
label: Promo Image Over
description: Select desired promo image.
***********
2. Assigned via "Joomla>admin>modules>MYMODULE>Particle>Edit Particle" the image that will replace the original one in the new field created "imageover"
3/ Modified my promoimage.html.twig in [TEMPLATE]/particles/ to alter the behaviour
***********
BEFORE
<img src="{{ url(particle.image)|e }}" alt="{{ particle.title|e }}">
4/Modified in [TEMPLATE]/scss/[TEMPLATE]/_promoimage.scss to hide the old image, which will be replaced by the new OnMouseOver effect :
BEFORE
.g-promoimage-effect:hover {
background: darken($accent-color-1, 25%);
img {
opacity: 1;
Re: SOLVED Rollover - Change image on rollover effect on Promo Image Particle
Posted 7 years 5 months ago
Don't modify any of our existing template files because any update would overwrite all of your changes. Instead you should create a particle override...
Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
Re: SOLVED Rollover - Change image on rollover effect on Promo Image Particle
Posted 7 years 5 months ago
Mark,
thank you.
I've just moved the modifications from [TEMPLATE]/particles/ to [TEMPLATE]/custom/particles/.
Same for [TEMPLATE]/scss/[TEMPLATE]/_promoimage.scss MOVED to templates/[TEMPLATE]/custom/scss/custom.scss
Everything works like a charm.
Re: SOLVED Rollover - Change image on rollover effect on Promo Image Particle
Posted 7 years 5 months ago
That's not correct. Your version of _promoimage.scss should be copied to /templates/custom/scss and in your custom.scss file you should put
@import "promoimage";
Regards, Mark.
Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.