Quick link tag?

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
ExVee
Posts: 26
Joined: Wed 26. Jan 2005, 11:21

Quick link tag?

Post by ExVee »

I couldn't find anything in the wiki or documentation that covered what I'm looking for, so - is there some kind of tag in the CMS where I can insert it within an article's content, and it'll render out a link to another target article and title the link with the target article's title information?

For instance:

Code: Select all

{LINK_TO "article alias"/"article ID"}
Which would generate this HTML

Code: Select all

<a href="articlealias.phtml">Title of Specified Article</a>
Does something like this exist? It seems like too much of a simple convenience not to, but I just can't seem to track it down if it does. ...and if it doesn't exist, is there a way I might be able to make it happen within my own installation?
User avatar
update
Moderator
Posts: 6431
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: Quick link tag?

Post by update »

[INT index.php?aid=15]documentation[/INT]
OR
[ID 15]documentation[/ID]
See here: http://www.phpwcms-docu.de/link_tags_.phtml
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
ExVee
Posts: 26
Joined: Wed 26. Jan 2005, 11:21

Re: Quick link tag?

Post by ExVee »

No, I know about that one, but I still have to manually add the link text. What I'm talking about is a single tag that makes a link and automatically grabs the title of the destination article and inserts that as the link text.
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: Quick link tag?

Post by flip-flop »

Please have a look and make a test: Quick Article link with ALIAS/ID
TAG: [QIDA|qIDA article-alias or article-ID]

Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
ExVee
Posts: 26
Joined: Wed 26. Jan 2005, 11:21

Re: Quick link tag?

Post by ExVee »

That is exactly what I was looking for - that's fantastic, thank you! :D
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: Quick link tag?

Post by flip-flop »

Yes, I have make this script in the morning.
Please download again, I have solved a bug. = Version 1.0a
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
ExVee
Posts: 26
Joined: Wed 26. Jan 2005, 11:21

Re: Quick link tag?

Post by ExVee »

It worked on 1.0, and when I updated to 1.0a it doesn't work. It outputs

Code: Select all

[[No link set!]]
It's probably also worth noting that even with 1.0, it returns the same "No link set!" if I use the article's ID number, while 1.0a doesn't work with either ID or alias.
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: Quick link tag?

Post by flip-flop »

Yes, that was the bug in V1.0

Please Change

Code: Select all

		$sql .= "WHERE (article_alias IN (".$id_a.") OR article_id IN (".$id_i.") )";
to

Code: Select all

		$sql .= "WHERE (article_alias IN (".$id_a.") OR article_id IN (".$id_i.")) ";
For me it is running well using alias and id.

Arggg, I have tested this only with more then one link on a site.

One moment please ....
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
ExVee
Posts: 26
Joined: Wed 26. Jan 2005, 11:21

Re: Quick link tag?

Post by ExVee »

I've been running through variations, and it's consistent that if I try to add the article_id value in any way, it causes the tag to no longer return a link. While I am curious why that would be the case, at least in the short term I can be quite happy with this just working with the aliases as it was in 1.0. In any event, I'm very grateful to you for the work you've put in to this. :)
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: Quick link tag?

Post by flip-flop »

Solved: Please download V1.0b.

The sql statement

Code: Select all

(article_alias IN (".$id_a.") OR article_id IN (".$id_i."))
do´t run with an empty var.
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
ExVee
Posts: 26
Joined: Wed 26. Jan 2005, 11:21

Re: Quick link tag?

Post by ExVee »

I have no idea what you changed so it works, but it does. Thank you!
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: Quick link tag?

Post by flip-flop »

I have added:

Code: Select all

		// fill up the var with minimum content for a right db search
		if (empty($id_i)) $id_i = 0;
		if (empty($id_a)) $id_a = "'!n00p!'";
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
Post Reply