Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2004-07-12 01:44:10
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
[plugin] [ORPHAN] zem_link
<txp:zem_link>
creates links. It works as a replacement for txp:permlink, and it can also be used to create direct links to articles and pages.
<txp:zem_link>linktext</txp:zem_link>
In an article form, works the same as txp:permlink
<txp:zem_link title="permanent link to '%s'">linktext</txp:zem_link>
Same as txp:permlink, except with a title attribute. The optional “%s” will be replaced with the article title.
<txp:zem_link href="25" />linktext</txp:zem_link>
Direct link to article #25. In clean URL mode, the URL title will be appended. If a “title” attribute is supplied, it works the same as for a permanent link, with “%s” replaced with the article title.
<txp:zem_link href="foo/">linktext</txp:zem_link>
Creates a link relative to the textpattern root.
As of version 0.3, it’s possible to use zem_link as a self-closing tag in certain circumstances:
<txp:zem_link href="25" />
– Direct link to article #25. The article title will be used as the link text.
<txp:zem_link linkid="15" />
– Direct link to link #15. The link name field will be used as the link text.
All of the above forms support the following attributes:
- href
- class
- target
- title
Download:
http://vigilant.tv/documents/tp/zem_link-0.3.txt
Last edited by zem (2004-10-16 02:22:57)
Alex
Offline
#2 2004-07-12 02:07:52
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: [plugin] [ORPHAN] zem_link
Whoops – <code><txp:zem_link><txp:title /></txp:zem_link></code> didn’t work as expected. Fixed. Also corrected some errors in the help text.
Last edited by zem (2004-07-12 02:22:27)
Alex
Offline
Re: [plugin] [ORPHAN] zem_link
You have pre-emptively solved a problem I had been meaning to complain about, namely the rigidity of the permalink title field. Thanks!
Offline
Re: [plugin] [ORPHAN] zem_link
Very cool Zem. I’m going to take this a bit further and allow it to customise the format of the permlink (since I’m working on other hacks and rewrite rules for parsing such URLs). Will supply you with my mods once complete, but they’re obviously not going to be all that magic :)
Last edited by indent (2004-07-13 01:49:13)
VC#72, waiting patiently for /section/category/article-title/ based URLs :)
Offline
Re: [plugin] [ORPHAN] zem_link
Thanks for that plug-in. As others have mentioned, it fixes one of those irritating little things that had been bugging me. One note about your suggested code:
<pre><code>
<txp:zem_link title=“permanent link to ‘%s’” />linktext</txp:zem_link>
</code></pre>
The closing slash in your opening tag causes TXP to close the link tag before it is wrapped around the link text. But this worked for me:
<pre><code>
<txp:zem_link title=“permanent link to ‘%s’”>linktext</txp:zem_link>
</code></pre>
TextPattern user since 04/04/04
Offline
#6 2004-07-17 00:52:37
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: [plugin] [ORPHAN] zem_link
Thanks, Reid. I’ve corrected the post.
Alex
Offline
Re: [plugin] [ORPHAN] zem_link
Thanks Zem – this is really useful in over coming the ‘does all the XHTML for you’ nature of the permalinks. Cheers!
Cheers,
Jon VC#9
Offline
Re: [plugin] [ORPHAN] zem_link
It says “badly formed or empty plugin code” when trying to install. I’ve tried both the old-style import and the new-style cut and paste. What am I doing wrong?
Last edited by charlesroper (2004-09-21 19:28:46)
Charles Roper
Offline
#9 2004-09-21 22:21:05
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: [plugin] [ORPHAN] zem_link
I don’t know, to be honest. I just downloaded it and was able to install v0.2 via both methods.
Can you install other plugins?
Alex
Offline
Re: [plugin] [ORPHAN] zem_link
Same issue here. I tried installing Ramanan’s word count plugin, and got the same message? Any idea?
I amaze myself with my inability to grasp simple concepts.
Offline
Re: [plugin] [ORPHAN] zem_link
I just tried a couple of other plugins (kis_sectionmenu and automatic thumbnail and resize) and got the same problem. I was able to install plugins without problem prior to RC1. Seems like this issue needs to be moved to the bugs forum.
Cheers
Charles Roper
Offline