Support » Plugin: Media Library Assistant » Replace Words with (

  • Resolved jodaweb

    (@jodaweb)


    Hi,

    excuse me but my english is not the best.

    My titles always have the following pattern:
    scientific name (trivial name)

    I want to surround the first two, rarely the first three words with the HTML tag em.
    scientific name (trivial name)

    My idea
    template:(<em>[+iptc:2#105,str_replace( '(', '</em> (' )+])

    But I get the following error
    ERROR: Test; no closing parenthesis

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

    (@dglingren)

    Thanks for your report – your English is fine.

    I have reproduced your issue on my test system. It is a defect in the code that parses templates containing parentheses within quotes.

    I will work on a fix and post an update here when I have progress to report. Thank you for finding and reporting the MLA defect, and for your interest in the plugin.

    Plugin Author David Lingren

    (@dglingren)

    I have uploaded a new MLA Development Version dated 20200706 that contains a fix for this issue. To get the Development Version you can follow the instructions in this earlier topic:

    PHP Warning on media upload with Polylang

    It would be great if you can install the Development Version and let me know how it works for you. I plan to update the MLA production version within a week or so.

    I will leave this topic unresolved for now. Please let me know if you try the Development Version. Thanks for your help and for your interest in the plugin.

    jodaweb

    (@jodaweb)

    Hello David,

    I’m sorry I was away for a few days.
    Thank you for your quick replies and efforts.

    I currently only get <em> displayed.

    template:(<em>[+iptc:2#105,str_replace( '(', '</em> (' )+])

    • This reply was modified 1 month ago by jodaweb.
    • This reply was modified 1 month ago by jodaweb.
    Plugin Author David Lingren

    (@dglingren)

    Thanks for your update and for taking the time to try out the Development Version.

    I have just run a test on my own system and get the results I expected. In the 2#105 field my sample contains:

    Headline for Butterfly Pattern (with parentheses)
    

    Using your template in the Media/Assistant Bulk Edit area gives me:

    <em>Headline for Butterfly Pattern </em> (with parentheses)
    

    If you can post a link to one or more of your own images I can investigate further. You can also try using something like this template to verify the content you are starting with:

    template:Headline is -([+iptc:2#105+])-
    

    Let me know what you find out.

    jodaweb

    (@jodaweb)

    Thank you for your wonderful work. I have now re-entered it several times and now it works perfectly. I had done something wrong in handling. Thank you very much again.

    Plugin Author David Lingren

    (@dglingren)

    Thanks for the positive feedback and for confirming that the fix is working on your site.

    I am marking this topic resolved, but please update it if you have any problems or further questions regarding Content Templates that include parentheses.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.