XHTML valid pagetitle/longtitle

on 13-Sep-2009 | Comments ( 6 ) Tags: Evolution

Update: use the htmlent modifier. More info about htmlent on PHx wiki

Old stuff below

Start by creating a new snippet called phx:htmlspecialchars. Make sure you have PHx installed.

Paste the following code:

<?php
return htmlspecialchars($output);
?>

Use it with document variables like:

[*pagetitle:htmlspecialchars*]

or in your Ditto/Wayfinder template like:

[+pagetitle:htmlspecialchars+]

 

There might be a plugin solution to this problem. Post a comment if you know one.

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.
 
Tofu
Posts: 4
Comment
Revolution includes PHx
Reply #6 on : Mon September 14, 2009, 10:36:54
Evolution does not include PHx by default. Should be (Revolution has it by default).
cipa
Posts: 2
Comment
Re: Revolution includes PHx
Reply #5 on : Mon September 14, 2009, 13:03:14
Thx Tofu

I fixed the error. I was using PHx with Ditto and I was under the impression that it is installed by default.
Last Edit: September 14, 2009, 13:04:05 by cipa  
kongondo
Posts: 4
Comment
Ditto comes with PHx
Reply #4 on : Mon September 14, 2009, 17:46:13
Hi CIPA,

Thx for the post! Ditto comes with its own PHx lib. That's why you probably thought it was separately installed? :)

cheers/k
sharkbait
Posts: 4
Comment
Re: XHTML valid pagetitle/longtitle
Reply #3 on : Mon October 19, 2009, 05:21:57
Hey Cipa,

is there a way to get wayfinder to output escaped &s as well? currently i use a plugin that escapes all stray &s, the problem is it breaks e.g. code that has been inserted for google maps...i know that wayfinder 2.5 can handle phx, but any idea for wf 2.0

cheers, jan
cipa
Posts: 2
Comment
Re: XHTML valid pagetitle/longtitle
Reply #2 on : Mon October 26, 2009, 06:29:01
Hi sharkbait,

Have a look at the plugin you are using and try to make your own PHx custom modifier
agat
Posts: 4
Comment
Use Phx
Reply #1 on : Sat March 27, 2010, 11:21:47
You can use
http://wiki.modxcms.com/index.php/PHx#htmlent
Last Edit: March 27, 2010, 22:01:38 by cipa  

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