Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2004-10-15 21:43:24
- hafnius
- Archived Plugin Author
- From: DK
- Registered: 2004-09-02
- Posts: 47
Re: [plugin] [ORPHAN] zem_link
I am really missing a way of outputting the links in the link list. there are way to output them by category and so on, but nothing to single out one link that i would like to put in an article for instance.
Could this plugin be made to take a Link_id attribute so that:
<code>
<txp:zem_link link_id=“25”>foo</txp:zem_link>
</code>
Would output the link with the id = 25. That would be so cool. I will have a look at this to see if i can tweak it :)
/Hafnius
– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing
Offline
#14 2004-10-16 01:37:30
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: [plugin] [ORPHAN] zem_link
Unfortunately, given the way the linklist tag is written, it’s not possible for a plugin to output the current link (there’s no $thislink
). Doing so would require modifying the linklist tag.
Alex
Offline
#15 2004-10-16 01:45:22
- hafnius
- Archived Plugin Author
- From: DK
- Registered: 2004-09-02
- Posts: 47
Re: [plugin] [ORPHAN] zem_link
I dont know i i did not explain myself good enough – it is not the current link i am after.
If i make a link in the link list to cnn.com and then write an article about tv it would be nice if i could output the link to cnn.com in the article without having to categorise it but simply calling it by its id.
If you already had gotten my drift i take the above bach. I am not qiute enough into TXP. But i am thinking that there must be away to do the above. If i can output an article by calling its id, shouldnt it be possible to do the same with a link?
/Hafnius
– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing
Offline
#16 2004-10-16 02:06:21
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: [plugin] [ORPHAN] zem_link
Ah, with you now. Working on a new version.
Alex
Offline
#17 2004-10-16 02:20:43
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: [plugin] [ORPHAN] zem_link
http://vigilant.tv/documents/tp/zem_link-0.3.txt
Two new features:
- Adds a ‘linkid’ attribute, as per Hafnius’ suggestion.
- Can now be used as a self-closing tag when linking by article ID or link ID. The article/link title will be used as the link text in those cases. e.g:
<code><txp:zem_link href=“25” /></code> – link to article #25, with the article title as the link anchor text
<code><txp:zem_link linkid=“10” /></code> – link to link #10, with the link name as the link anchor text
Last edited by zem (2004-10-16 02:24:39)
Alex
Offline
#18 2004-10-16 02:57:57
- hafnius
- Archived Plugin Author
- From: DK
- Registered: 2004-09-02
- Posts: 47
Re: [plugin] [ORPHAN] zem_link
How cool are you !!
Tested the linkid and it works perf. all the eamples are gone and replaced by foo
but i guess you know this.
All that lacks now is that the id of the links is showed in admin > Images so that we dont have do look in the db to find the id of the link – maybe a feature request?
——
Could this elephant have any other name then ZEM :)
/Hafnius
Last edited by hafnius (2004-10-16 03:10:24)
– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing
Offline
#19 2004-10-16 03:50:10
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: [plugin] [ORPHAN] zem_link
> Tested the linkid and it works perf. all the eamples are gone and replaced by foo
but i guess you know this.
Yeah, something screwy with Textile.
> All that lacks now is that the id of the links is showed in admin > Images so that we dont have do look in the db to find the id of the link – maybe a feature request?
It’s in the URL if you click or hover the link name in content/links.
Alex
Offline
#20 2004-10-23 14:37:22
- hafnius
- Archived Plugin Author
- From: DK
- Registered: 2004-09-02
- Posts: 47
Re: [plugin] [ORPHAN] zem_link
Well that would be possible if the plugin had been made to be called by the link_title rather then the id. The problem with using the link_title is that it might not be unique, whereas the id is always unique.
/Hafnius
– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing
Offline
Re: [plugin] [ORPHAN] zem_link
Hi Zem, it would be great to have a attribute to make this plugin work with links to comments too. It just about adding #comment at the end, atm ive made my own plugin based on yours to do this, but i rather have it in yours :)
Johan Nilsson
Offline
Re: [plugin] [ORPHAN] zem_link
The key to use zem_link efficiently is to know ID number as fast as you can, maybe.
So I’ve decided to hack some php files to show IDs. Here’s what I did.
Show linkid at link page
Hack include/txp_link.php, added:
- <code>column_head(‘id’).</code>
above
- <code>column_head(‘link_name’,‘linksort’,‘link’,1,$dir).</code>
And then added:
- <code>td($id).</code>
above
- <code>td($elink).</code>
Show articleid at writing page
Hack include_txp_article.php, change;
- <code>echo ‘<a href=”?event=article’.a.‘step=edit’.a.‘ID=’.$ID.’”>’.$Title.’</a>’.br.n;</code>
into
- <code>echo ‘’.$ID.’: <a href=”?event=article’.a.‘step=edit’.a.‘ID=’.$ID.’”>’.$Title.’</a>’.br.n;</code>
To show lots of aticles at writing page
- <code>“1 order by LastMod desc limit n”</code>
just change <code>n</code> any number you like. You can find where it should be by searching with your nice editor.
Thank you for your cool plugin Zem. I can’t imagine writing without your stuff!
Last edited by ren (2004-11-07 06:49:16)
Offline