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

load link.html alternatively

Quote Reply
load link.html alternatively
Basicly i would like to have a bicolor links function.

to achieve that. i got idear that load link.html and link1.html alternatively.

thus we will have bicolour and other new layout for the links.

i got some idear from 'links of day' but do not fully understand it .

Alex or some senior here. could you help me for the code?



Many thanks
Quote Reply
Re: [courierb] load link.html alternatively In reply to
It's very easy if you are using loops in e.g. the category.html template for displaying the links. Then, you can just do something like

<%loop links_loop%>
<%include link.html%>
<%endloop%>

In your link.html template you would put something like

<%if even%>
link with color one
<%else%>
link with color two
<%endif%>

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [courierb] load link.html alternatively In reply to
Thanks yoki.

i just saw your post. i will have a try.



Thanks again
Quote Reply
Re: [courierb] load link.html alternatively In reply to
Yogi.



it seems that the link only be listed based on link.html templete only

I thinks it will only load link.html . and it will only be able to achieve bicolour

however i need to load link.html and link1.html ( link1.html is newly created templete different from link.html in layout) alternative to build links?



Thanks
Quote Reply
Re: [courierb] load link.html alternatively In reply to
I'm not sure what you mean but I still think yogi's answer applies. You just put the different content inbetween the tags.
Quote Reply
Re: [courierb] load link.html alternatively In reply to
I think you are better of using just link.html, because everytime link.html is loaded, extra link information will be passed along. Using link1.html would not have that extra information (see Links/SiteHTML.pm).

Concrete example. In link.html, use

<td bgcolor="<%if even%>green<%else%>white<%endif%>">
<%Description%>
</td>

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] load link.html alternatively In reply to
yes that does made bicolor happen. however it use the single link.html templete. so the link content position will be the same.

while i need the feature like this.

entry1---- (based on link.html templete)
desc
desc extra (new column)

entry2----(based on link1.html templete)
desc extra (new column)
desc

entry3---- (based on link.html templete)
desc
desc extra (new column)

entry4----(based on link1.html templete)
desc extra (new column)
desc

so link column positioin will be changed based on templete. not only the colour alternation

is it possible to do that?



Thanks
Quote Reply
Re: [Paul] load link.html alternatively In reply to
I have only find bicolor in the forum and did not find any topic about link content position alternation.

according link of day (select links from certain category), it should has a way to do that. i just do not know how as i do not fully understand it.



Thanks
Quote Reply
Re: [courierb] load link.html alternatively In reply to
just put everything that you had in link.html after the <%if even%> tag, and everything you had in link1.html after the <%else%> tag.

Don't forget the closing <%endif%> tag.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] load link.html alternatively In reply to
Thanks it is what i need.

i will have a test .



Thanks again
Quote Reply
Re: [yogi] load link.html alternatively In reply to
it works nicely.



Thanks
Quote Reply
Re: [courierb] load link.html alternatively In reply to
guys please help, i have strange problem with <%if even%>ffffff<%else%>eeeeee<%endif%>.

if i use it in links.hrml all workd fine for me.



but i need to run it from my top10.html.

there is my top10.html file.

<TR>
<TD bgColor=#<%if even%>ffffff<%else%>eeeeee<%endif%> align=left><A class=smallbluelink
href="<%build_root_url%>/Detailed/<%ID%>.html"><%Title%></A></TD>
<TD class=smallblack align=left>
&nbsp;&nbsp;<%Rating%>
</TD>
<TD class=smallblack align=left>
<%Votes%>
</TD>
<TD class=smallblack align=left>
<%if Review_Count%><%Review_Count%><%endif%><%ifnot Review_Count%>0<%endif%>
</TD>
<TD class=smallblack align=left>
<%top10_name($ID)%>
</TD>
<TD class=smallblack><img src=""></TD></TR>

----------------

there is cut from home.html(where i include it)

<%set category_page = 1%> <%calculate_category_offset($title)%>
<%top10%>
<%loop top10_loop%>
<%endloop%>

but when i run it links show me only #eeeeee color, not a

#eeeeee

#ffffff

etc.



guys please help to solve it.
Quote Reply
Re: [slon] load link.html alternatively In reply to
Maybe try this:

Code:
<%set category_page = 1%> <%calculate_category_offset($title)%>
<%top10%>
<%loop top10_loop%>
<%include top10.html%>
<%endloop%>
Quote Reply
Re: [Aki] load link.html alternatively In reply to
nop, its not help.

when i chnage it to

<%set category_page = 1%> <%calculate_category_offset($title)%>
<%loop top10_loop%>
<%include top10.html%>
<%endloop%>


its not working.

Andy we needs your help.
Quote Reply
Re: [slon] load link.html alternatively In reply to
It looks to me like you are using a global called top10?

If so, you need it to return a loop instead of just printing top10.html.

If you post the global you are using, someone will be able to help.
Quote Reply
Re: [slon] load link.html alternatively In reply to
What codes do you have in the top10 global? For you to use a loop like you are trying, it needs to return an array....i.e;

return { top10_loop => \@array }

... but the sound of it, your gobal is not doing this.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!