• Resolved jhdean

    (@jhdean)


    Hello David,

    Thanks for your help on my last post.

    In my detail page template, for the primary image, I want to display the image title and then a paragraph break and then the description. I managed this with the following.

    [mla_gallery columns=0mla_search_fields=title s=”{+page_title+}” tag=”primary” mla_caption=”{+template:({+title+})+}<p></p>{+template:({+description+}|{+caption+})+}” link=”none” size=large]

    Now I want, using CSSHero, to be able to formate the title differently than the description by adding a CSS class to the title. I tried a few iterations of where to put a div tag with the class in it but failed. Can you see a way to do this? Here is my last failed attempt:

    [mla_gallery columns=0mla_search_fields=title s=”{+page_title+}” tag=”primary” mla_caption=”<div class=”detail-title”>{+template:({+title+})+}</div><p></p>{+template:({+description+}|{+caption+})+}” link=”none” size=large]

    Thanks again for the great tool and support,
    Jeff

    https://www.ads-software.com/plugins/media-library-assistant/

Viewing 1 replies (of 1 total)
  • Plugin Author David Lingren

    (@dglingren)

    Jeff,

    Thanks for including the complete source text of your shortcode in the post; you are very close to a working solution. I entered your example I my test system and got this error message:

    ERROR: Invalid mla_gallery tax_query = 'mla_caption="'

    It’s a bit misleading, but it means that the double quotes around you class attribute are causing the problem, because the first double quote (at class=") is matching the double quote at mla_caption=" and terminating the parameter. Try changing your shortcode to:

    [mla_gallery columns=0 mla_search_fields=title s="{+page_title+}" tag="primary" mla_caption="<div class='detail-title'>{+template:({+title+})+}</div><p>&nbsp;</p>{+template:({+description+}|{+caption+})+}" link="none" size=large]

    Changing to single quotes around class='detail-title' is still valid HTML and will let the double quotes surround the entire parameter. I also added <p>&nbsp;</p> because empty paragraphs can cause problems. You can reduce the vertical space somewhat by changing this to <br>&nbsp;<br>, if that looks better in your application.

    I am marking this topic resolved, but please update it if you have any problems with the suggested fix or further questions about adding class attributes and HTML markup to your captions.

Viewing 1 replies (of 1 total)
  • The topic ‘CSS class in mla_caption template’ is closed to new replies.