We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22740
    • 26 Posts
    Hi all,
    This will be my first lesson in modifying a Chunk... I have trouble learning how to do things with code unless I can apply it to something I’m doing, so thank you in advance for your kindness!
    So it seems I can use PHx’s [+string:notags+] to remove tags -- but how would I apply it to:
    [[+introtext]]
    In my RSS feed chunk? (see below).
    I want to do this because having an image to introduce the blog post works so well in the homepage layout of the blog I designed: http://fruitflylife.com

    Thanks!
    Revo 2.1.1

    <item>
    <title>[[+pagetitle:htmlent]]</title>
    <link>[[++site_url]][[~[[+id]]]]</link>

    <description>

    [[+introtext]]

    </description>
    <pubDate>[[+publishedon:strtotime:date=`%a, %d %b %Y %R:%S %Z`]]</pubDate>
    <guid>http://www.fruitflylife.com/?id=[[+id]]</guid>
    </item>
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      PHx is for Evolution.

      Luckily, we have it built in with Revolution! smiley

      They are called Output Modifiers, and their docs can be found here: http://rtfm.modx.com/display/revolution20/Input+and+Output+Filters+(Output+Modifiers)

      The "notags" phx has been ported to an output modifier, and uses the same name. Just slightly different syntax.
      [[+introtext:notags]]



      Another thing I notice, you are using this for your GUID:
      <guid>http://www.fruitflylife.com/?id=[[+id]]</guid>


      While it works, it’s maybe better to use a link tag. Basicly:
      [[~1]]  becomes   index.php?id=1
      [[~1? &scheme=`full`]]  becomes http://www.fruitflylife.com/index.php?id=1
      [[~[[+id]]]] generates a relative url to the resource with the ID as passed in the [[+id]] placeholder
      [[~[[+id]]? &scheme=`full`]] becomes an absolute url with your site url (http://www.fruitflylife.com/) in front of it, to the resource with the ID as passed in the [[+id]] placeholder


      If you use the link tag, you have the extra benefit that if you were to start using friendly urls (eg http://www.fruitflylife.com/upcoming-events.html) the link tag will start using that instead of index.php?id=N. If you change the alias the link tag will update etc.

      Hope this helps!
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 22740
        • 26 Posts
        THANK YOU!!! Excellent. Much appreciated!