Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Template Feedback Needed

Quote Reply
Template Feedback Needed
Hi!

We are working hard on 2.1 and I'm considering breaking template compatibility by introducing loops and I'd like people's thoughts on this.

Basically, it would be moving more of the HTML into the templates. So for your category listing, instead of:

<%link_results%>

You would see:

<%loop link_results%>
<li><%include link.html%>
<%endloop%>

and this would run through each link in the category and include the link.html template to display. You would see similiar things for search results. This means it would be easy to alter the look of new links versus search results versus category listings. They all wouldn't be based off of link.html (well, by default they would, but they wouldn't have too).

I wouldn't want to have to support both styles, as it could be quite ugly in the code.

Let me know what you think, is this worth it?

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Template Feedback Needed In reply to
Being able to control the formatting of individual sections rather than from the 1 link template will be a incredibly useful for us trying to do extensive customization.

Its a big step thought especially for those who like the simpler way links parses templates, but I'm sure with the proper documentation, you can please those who might be reluctant.

The idea gets my full vote.


________________________
Eraser
Insight Eye
http://www.insighteye.com
Quote Reply
Re: Template Feedback Needed In reply to
It would definitely be worth it for me too, as it allows more flexibility.

Will the next version take care of the problem of custom fields with multi-select options? It doesn't seem to work now with Links 2.0.4 when users submit their information from the add form and select more than one option for the field, the validate form only allows one selection, so only the first selection is included...

-rover

Quote Reply
Re: Template Feedback Needed In reply to
Not only in the code... but it would mean passing twice as much data around.

I really think the move to loops will be the best in the long run for everyone. It's only _MINOR_ template changes .... for the most part its literally just replacing

<%link_results%>

with

<%loop link_results%>
<li><%include link.html%>
<%endloop%>

The way it's done in the modify_select.html template.

It makes life, template design, and adding features in to the templates much, much easier.



PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Plugins:http://LinkSQL.com/plugin
Quote Reply
Re: Template Feedback Needed In reply to
As a 'non-tekkie' user of Links I don't pretend to particularly understand the implications of this.

All I would ask is that there is documentation available to explain in *simple* language any changes that people like me need to make to existing templates. Thanks

Quote Reply
Re: Template Feedback Needed In reply to
As Alex mentioned quite a few times in the forums, GT has hired a technical writer to write user-friendly manuals for all its products. Good suggestion on including how to use templates in the manual.

Regards,

Eliot Lee Wink
http://anthrotech.com/
Quote Reply
Re: Template Feedback Needed In reply to
I think this would be a fine idea. The only thought I would add is that you also take the <ul> tag out of the cgi code. So a template would look more like this:

<ul>
<%loop link_results%>
<li><%include link.html%>
<%endloop%>
</ul>

Maybe it's already like that, I can't remember since I wanted my links to display without the unordered list tags.

Would this logic also apply to the sub-categories as well, and if so, how does it relate to building results into multiple columns?

Bryan

Quote Reply
Re: Template Feedback Needed In reply to
I have wanted to mention a template class here for a couple of weeks now, but have never found a thread where I thought it would be suitable. The class is written in PHP, but that is not the point. It is the logic behind the class that I like - I think it is a port from a Perl script anyway.

It is quite similar to the way the GT template system works (I haven't used the GT one much, just read over the code...). It allows you too get rid of all HTML from the code - you can keep the design and code seperate.

It would be a waste of time rewriting all it does. Play around with it. If you are adding new features into the template system of Links SQL 2.1 you might enjoy playing with script - its really easy to use.

In the example above, where someone thought the <ul> tag should be taken out - it allows you easily replace it with a <table> tag for example.

Like I said, I haven't used the new GT one much at all - and it is probably a lot more powerful then this one, but I really like the way it works.

The URL is http://www.thewebmasters.net/php/FastTemplate.phtml

Discuss webhosting at
The Webhost Area Forums!
http://www.webhostarea.com/forums/
Quote Reply
Re: Template Feedback Needed In reply to
ahhh ... fast templates ....

I read somewhere that the "smarty" version was a little better. And, yet, I read somwhere else that both of these systems need improvement. Not trying to be harsh but that's what the php pros are saying.

If you're doing the templates a little different anyway, could you make them more multi-lingual.

ahhh ... 2.1 ---more fun.



Quote Reply
Re: [Alex] Template Feedback Needed In reply to
Did this ever happen? Is there a way to control <%link_results%> now? (seperate from how link.html template is defined?

I'd prefer to not have an image in my search results. But, I do have an image in my link.html template. Thanks.
Quote Reply
Re: [Evoir] Template Feedback Needed In reply to
I think the easiest way to do this is using if statements within link.html:

<%if query%>

Stuff you want included in the search results

<%endif%>

or

<%unless query%>

Stuff you don't want included in the search results

<%endunless%>

Edit: The code in Alex's post does work so alternatively you could just add another template searchlink.html and use this for your search results but I find that it's easier just having one to update if you need to make changes.

Laura.
The UK High Street

Last edited by:

afinlr: Aug 30, 2002, 3:18 PM