WordPress.org

Ready to get started?Download WordPress

Forums

Collapse-O-Matic
double quotes added to img tag inside expand title when switching to Visual (6 posts)

  1. criticnic
    Member
    Posted 1 year ago #

    We are using the plugin to have images be the expand trigger. For example, on a biography page, the person's picture is the trigger. We are using the format [expand title="<img class='bio-pic' src='image.jpg' />" rel="-highlander"]

    The above works great when this is added to Text view. However, once we switch to Visual view, double-quotes are replacing the single quotes in the image tag attributes. This therefore doesn't display the image since the plugin requires you use single quotes inside the expand code.

    We have used just about all of the plugins to keep the 'raw' html out there that still allow the plugin shortcode to work, but while they work for not messing up any other html content, they do not prevent this issue with the quotes.

    Does anyone have any suggestions on how we can prevent this from happning, aside from disabling the Visual editor?
    Thank you!

    http://wordpress.org/extend/plugins/jquery-collapse-o-matic/

  2. UaMV
    Member
    Posted 1 year ago #

    You mention the shortcode was first added to the Text Editor. Have you tried adding it first to the Visual Editor? If not, this may do the trick.

  3. criticnic
    Member
    Posted 1 year ago #

    Thanks for the response. I can add the shortcode in the Visual Editor, however where the problem occurs is when I want to add an image as the trigger in the title attribute of the shortcode. If i do this in the Visual Editor, wordpress automatically puts double-quotes around any attributes within the img tag (class and src as shown in my example). Those double quotes cause the image to not show up when the page is published. So to fix it, I go to Text Editor and make them single quotes, which works until you switch back to Visual, where double quotes are automatically replaced again.

  4. criticnic
    Member
    Posted 1 year ago #

    Anyone have any ideas on this? Still have not been able to figure it out. Just to recap: it ONLY works when using it in the Text editor, when switching back to Visual, WordPress instantly adds double-quotes around the src attributes which breaks the images. Thanks!

  5. time-space
    Member
    Posted 7 months ago #

    I am having the exact same issue. Have you found a way around it criticnic?

  6. criticnic
    Member
    Posted 7 months ago #

    Hi time-space,
    I never was able to figure it out with Collapse-o-matic. I ended up just using the jQuery Accordion function, adding the code into my theme's header. Quite a workaround but it works for we wanted to do :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic