We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19036
    • 119 Posts
    Hello,

    Does anyone knows how to create a little snippet to set a default value to all my alt="" empty tags ? (precision: I don’t use TV for my images)

    The idea is to set a default value [*longtitle*] like alt="[*longtitle*]" if my picture belong to a document (like document id=120).

    I found doc on a php website with "replace" value, but no idea how to adapt it in a snippet ? huh
    http://uk.php.net/manual/en/function.str-replace.php

    Do you have any idea how to realise it ?

    Thanks for you help.

    Mehdi

      Scuse my english...I'm swiss
      • 15083
      • 697 Posts
      You could put out a snippet instead of [*content*]
      In this snippet read the page content into a variable.
      Using a regular expression you could find all your alt="" tags and insert the value of [*longtitle*] into the alt text
      Then spit the whole lot out....

      I think this would work....dont know what would happen if there were snippets and chunks in [*content*]?