Gossamer Forum
Home : Gossamer Threads Inc. : Custom Modification Jobs :

Link2 Mod :: Link Description from include file

Quote Reply
Link2 Mod :: Link Description from include file
I'm using templates. I'm pretty sure this goes beyond using the <%include%> tag, I want to be able to call specific include files rather than putting lengthy descriptions in links.db. I've successfully modified categories to allow multiple header and footers using headers.txt (or whatever filename) if specified in the category field, but I cannot figure a way to get a similar function to work for the link description. If this mod exists, I sure couldn't find it (I've dug around for days), so point me at it if it does exist. If it's custom work, that's fine, too.
Quote Reply
Re: [rcjordan] Link2 Mod :: Link Description from include file In reply to
You could use the include virtual directive and use <%ID%> to reference the Link ID in the include virtual directive in the link.html template. Of course, your server would need to support SSI.

Example:

<!--#include virtual="/path/<%ID%>.txt"-->

as a replacement for <%Description%>
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Link2 Mod :: Link Description from include file In reply to
Thanks, Stealth. I wasn't clear in the desired layout, sorry.

I do not want to put includes in the template, but rather if I list a .txt file in the description field of the link itself, I want the file to be included during the build and written to the page at that time.


In short, it is to use a full description if given in the add or modify form, but if a filename is entered instead, then it is to write in the contents of that file as the description. This would be a repeat of the process that is used for headers and footers in the category template, but applied to the description field. (The path to the directory which stores these link description files has been defined as $db_linkdescr_path in links.cfg)

Also, I do not want to have to use the record ID as part of the filename.

As mentioned, the routine that already works is in nph-build.cgi under sub build_category_pages just below

Quote:


# Get the include files from header and footer if they exist, otherwise assume they are html.


But, to write out the link description I believe the include routine would have to be in site_html_templates.pl --perhaps in the sub site_html_link section?
Quote Reply
Re: [rcjordan] Link2 Mod :: Link Description from include file In reply to
Just a note to say that this project has been completed.