Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Conceptual Problem understanding templates

Quote Reply
Conceptual Problem understanding templates
Having a bit of a conceptual problem with templates.

Namely here are some questions and maybe someone has some time who understands it all :)

- you have your LSQL portal page - say home.html and you want on this page to make a link that loads a LSQL template of your choice - say you want a link to a subpage called 'Links Directory' and links directory is a template that will have available to it variables to pull categories and/or links from one of your top level categories. Can this be done without using a custom global in such a way that when the page loads statically, this link is hard-coded?

- How does LSQL know what environment variables are available to a page in question? E.g. category or link related variables?

- Suppose I just have an ordinary HTML page that appears to be outside the LSQL system - how can I make this page so that I can add LSQL tags to it and access system data on it?

Thanks
Quote Reply
Re: [scorpioncapital] Conceptual Problem understanding templates In reply to
In Reply To:
- Suppose I just have an ordinary HTML page that appears to be outside the LSQL system - how can I make this page so that I can add LSQL tags to it and access system data on it?

Thanks


I thnk you would need to use the pagebuilder plugin to do this

CCUnet
my Christian web
Quote Reply
Re: [scorpioncapital] Conceptual Problem understanding templates In reply to
Quote:
you have your LSQL portal page - say home.html and you want on this page to make a link that loads a LSQL template of your choice - say you want a link to a subpage called 'Links Directory' and links directory is a template that will have available to it variables to pull categories and/or links from one of your top level categories. Can this be done without using a custom global in such a way that when the page loads statically, this link is hard-coded?


I don't understand this question at all. That *IS* what the index.html is all about. If you want a different home page, just like to where you want the links directory to put it's index.htm.

Quote:
- How does LSQL know what environment variables are available to a page in question? E.g. category or link related variables?

It depends on where/how it's called. Any script that calls the CFG-> hash, has access to all the basic configuration varialbles. Anything that uses the template parser has access to the globals.txt variables, and then you have additional tags based on whether you have requested a link record or category record. You can see what tags are available to you by adding:

<%if Username eq your_user_name%>
<%GT::Template::dump%>
<%endif%>

in any page/template using page.cgi (or page.php) to see the tags. You must log in, and that protects general users from seeing potentially dangerous things.


Quote:
- Suppose I just have an ordinary HTML page that appears to be outside the LSQL system - how can I make this page so that I can add LSQL tags to it and access system data on it?


You can use page.cgi?d=1&p=name_of_template you want to display. The template just has to be in the default directory, and end with a .html


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.