Keyword

extrafields image - add css classes?

  • Artonezero Limited
  • Artonezero Limited's Avatar Topic Author
  • Offline
  • New Member
More
8 years 2 weeks ago #157681 by Artonezero Limited
extrafields image - add css classes? was created by Artonezero Limited
Hi,

Just wandering if and how to add css classes to an extrafield of type image , I've tried looking in forums and google but can't find anything specific to this.

the problem i have is the extra fields image is overlapping the container so i just want to restrict the width to 100% using bootstrap classes "img img-responsive"

Any help appreciated.

Thanks

Please Log in or Create an account to join the conversation.

  • Fábio Jordan
  • Fábio Jordan's Avatar
  • Offline
  • Senior Member
  • Nothing like a good coffee to make a better web
More
8 years 2 weeks ago #157690 by Fábio Jordan
Replied by Fábio Jordan on topic extrafields image - add css classes?
Hi, Artonezero.

You can insert the extrafield inside a DIV. Then, in your CSS file, use a parameter like ".classofdiv img" and insert the desired parameters like the width of 100% to the image. But remember, any other images inside the same div will also get that parameter, so its important to use a DIV for each extrafield of image type.

Hope it works.

Best luck!

Please Log in or Create an account to join the conversation.

  • Artonezero Limited
  • Artonezero Limited's Avatar Topic Author
  • Offline
  • New Member
More
8 years 2 weeks ago #157692 by Artonezero Limited
Replied by Artonezero Limited on topic extrafields image - add css classes?
Yes I understand that, just wanted to know if there was a way to alter the <img> tag output somewhere in the template override. I may need to associate some classes and id for js/jquery rendering.

Please Log in or Create an account to join the conversation.

  • Fábio Jordan
  • Fábio Jordan's Avatar
  • Offline
  • Senior Member
  • Nothing like a good coffee to make a better web
More
8 years 2 weeks ago #157694 by Fábio Jordan
Replied by Fábio Jordan on topic extrafields image - add css classes?
Well, in this case, you have two options:

Use "explode" (with php) to extract the src from the extrafield and then apply id, class and other parameters.
In this case, you would have to do it manually to each extrafield with image type.

Or find the piece of code in K2 (I have no clue where it is) to add class, id to all the extrafields with image type.

Hope it helps.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 2 weeks ago #157724 by Krikor Boghossian
Replied by Krikor Boghossian on topic extrafields image - add css classes?

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum