Full URLs with a PHx custom modifier

on 02-Nov-2011 | Comments ( 0 ) Tags: Ditto, Evolution, PHP, PHx

Recently I had to implement a RSS feed that displays the full content of the document. When done, I realized that the links and the images where not correctly displayed because all the paths where relative not absolute.

So, I decided to create my own PHx custom modifier. Currently this snippet only replaces the href and src values. It basically adds the site url in front of the paths.

I use it like this in my Ditto RSS template:

<description><![CDATA[  [+content:FullPaths+]  ]]></description>

Write a comment

  • Required fields are marked with *.

If you have trouble reading the code, click on the code itself to generate a new random code.

Quick modx Evolution Tags

  • cached [[snippet]] or uncached [!snippet!]
  • {{chunk}}
  • [+placeholder+]
  • [*resourceField/TV*]
  • [^timing^]
  • [~link~]

Quick modx Revolution Tags

  • [[snippet]]
  • [[$chunk]]
  • [[+placeholder]]
  • [[*resourceField/TV]]
  • [[~link]]
  • [^timing^]
  • [[++systemSetting]]
  • [[%languageStringKey]]
  • all tags can be called un-cached like: [[! snippet]]

Timing Tags (Evo and Revo)

  • [^qt^] - Query time
  • [^q^] - Query count
  • [^p^] - Parse time
  • [^t^] - Total time
  • [^s^] - Source
© modxRULES! 2009-2014