We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Ampersand Plugin

Development and Programming

Myddelton's avatar
Myddelton
14 posts
17 years ago
Myddelton's avatar Myddelton

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

       
Erin Dalzell's avatar
Erin Dalzell
790 posts
17 years ago
Erin Dalzell's avatar Erin Dalzell

This is a plugin, right? I ask as I want to make sure I install it correctly.

Thanks

       
Erin Dalzell's avatar
Erin Dalzell
790 posts
17 years ago
Erin Dalzell's avatar Erin Dalzell

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?

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.