Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-07-17 09:26:51

gemal
Member
From: Copenhagen, Denmark
Registered: 2007-01-09
Posts: 107
Website

Adding title to all links

I’m migrating from Movable Type where I developed a plugin that added a title attribute to all links. Is there a way to develop such plugin in textpattern to

When the user saves the article I want to scan through the body text and find all links. Then if the link doesn’t contain a title attribute I want to add it. I’m using a simple file cache to look up the titles.

So I the user posts a body with:
Hello <a href=“http://gemal.dk/”>gemal</a>

I want to change that to:
Hello <a href=“http://gemal.dk/” title=“Gemal’s site”>gemal</a>

Where do I need to hook into textpattern to do this?

Offline

#2 2007-07-17 10:56:10

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Adding title to all links

I’d suggest catching the “article” event, at least for the “save” and “publish” steps, or even at the “preview” step, too.

Last edited by wet (2007-07-17 10:56:27)

Offline

Board footer

Powered by FluxBB