Menu

#73 Internal link only if directory exists

open
nobody
None
5
2010-06-26
2010-06-26
Zinaphile
No

Is it possible to have the internal linking check first if the linked directory exists?

That way you can always use it.

Example: Let's say you own Rolling Stones albums and you want the artist page to link through to the individual members solo albums. Now let's say you have a Bill Wyman solo album, maybe something from Mick Jagger

You can safely use something like

{internal:Mick Jagger}, {internal Bill Wyman}, {internal:Charlie Watts}, {internal:Keith Richards}, {internal:Ron Wood}

It should generate should something like this (pseudo)

<a href="Mick Jagger">Mick Jagger</a>, <a href="BIll Wyman">, Charlie Watts, Keith Richards, Ron Wood

Since you only have solo-albums from Mick Jagger and Bill Wyman, then you only have links for those two. The others are checked but no dir exist so simply output the name instead.

Then, when you add let's say Ron Wood's solo-album... the next time you run an update, there's also a link from the Stones page to the Ron Wood page.

You wouldn't have to go back and change the Rolling Stones index.txt thru your browser. It would be automated.

Something like this would be great for linking all liner notes to each other

Discussion


Log in to post a comment.