We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3046
    • 48 Posts
    Good day to everybody!

    I’m trying to make a catalogue wiht MG, and the only thing i can’t solve is making RT input and html output description for images.
    Does anybody have some info on it?


    Here are related topics, but looking through them i can’t get the idea HowTo. May be if there is somebody quicker then me can combine an intruction? ))

    http://modxcms.com/forums/index.php/topic,30382.0.html
    http://modxcms.com/forums/index.php/topic,28683.0.html

    oh my stupid dump!!
    that is key post: http://modxcms.com/forums/index.php/topic,13712.0.html


    All my problems gone clearing the [+lalalal:htmlent+] thing in MG tpls. But be carefull. There are a lot of such calls in tpls and you shouldn’t remove it from image "title" ot "alt" tags.

    Anyway if i remove htmlent from description placeholder, "alt" placeholder will show row html code, so i need to change "alt" call or clean the description field data from html code with a snippet or somth else, i’m not a programmer )

    Thank you a lot, Doze
      • 7923
      • 4,213 Posts
      Good that you got it resolved by your self, and thanks especially for providing the info for others!

      Quote from: belkaU at Mar 25, 2009, 05:29 AM

      Anyway if i remove htmlent from description placeholder, "alt" placeholder will show row html code, so i need to change "alt" call or clean the description field data from html code with a snippet or somth else, i’m not a programmer )
      Not sure if I understood correctly, but do you mean that you are putting the picture description to the img tag alt attribute? and alt attribute can’t have html code of course.. If this is the case, you can create a phx custom modifier what removes html code from the field and use it in the alt attribute, eg:

      Create snippet named phx:striptags with this content:
      <?php
      return strip_tags($output);
      ?>
      


      Then in your image tag use <img alt="[+maxigallery.picture.descr:striptags+]"....
      That should give you only the text content from picture description and remove all html code.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 3046
        • 48 Posts
        Quote from: doze at Mar 26, 2009, 03:11 AM


        Create snippet named phx:striptags with this content:
        <?php
        return strip_tags($output);
        ?>
        


        Then in your image tag use <img alt="[+maxigallery.picture.descr:striptags+]"....
        That should give you only the text content from picture description and remove all html code.

        Yep! That is exactly what i mean )
        Thank you again a lot, Doze