Hi
I wanted to create an ampersand encoding plugin that just encodes ampersands - no em-dashes or curly quotes like the existing typography plugins (XHTML, SmartyPants), no additional HTML formatting (MarkDown) and no XML-encoding of apostrophes that then can’t be read in IE (XML_encode).
Why? My pages were not validating and it was winding me up!!! Plus maybe it might start me on the road to understanding more about PHP and plugin creation.
So, I have ripped off the xml_encode plugin and I have it working on my system. But I am an extreme PHP novice and I wondered if anyone with a bit more knowledge (not hard) could cast an eye over it and tell me if there are any obvious flaws?
Of course, if not, then no worries!
Plugin at:
http://www.myddelman.com/pi.ampersand.txt
(coudn’t attach it for some reason)
Any feedback much appreciated…
Will
Here’s what I have in my template:
<div class="sidebar-block">
{exp:linklist:entries orderby="linklist_title,last_updated" sort="DESC"}
{list_heading}
<h3 class="sidebar-header">{linklist_title}</h3>
<ul>
{/list_heading}
{exp:ampersand}
<li>{count_linkcode}</li>
{/exp:ampersand}
{/exp:linklist:entries}
</ul>
</div>
<!-- end sidebar-block -->
And the ampersands generated by LinkList are NOT encoded.
Am I doing something wrong?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.