Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Tables being screwed up...

Quote Reply
Tables being screwed up...
This is a bit of a pain. As soon as I enter the <%category%> tag in home.html, I get the menu dissapearing to the bottom left of the page (see http://207.230.62.131/...?d=1&t=template1)..

Does anyone have any idea on why this would happen? I just got my mate to validate the generated HTML for missing tags etc, bvut he said DreamWeaver didn't come up with anything.

Any ideas?

Thanks

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!
Quote Reply
Re: [Andy] Tables being screwed up... In reply to
Ack..never mind. It was just I had a misconfigured table. Should look ok now.

FYI, this is part of a template set I am making for Links SQL. I am looking at selling them for $75 per set, which is much cheaper than paying someone to customize all 30 odd templates Wink

Well..I'll keep you informed on how the sets comes on. I'll have a live demo on my site soon.

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!
Quote Reply
Re: [Andy] Tables being screwed up... In reply to
>>
I am looking at selling them for $75 per set, which is much cheaper than paying someone to customize all 30 odd templates
<<

Depends who you pay :)
Quote Reply
Re: [Paul] Tables being screwed up... In reply to
Yes..I suppose it does...but not many people will do it for less than that if if they are doing it as a job...its just not feasable time wise (on average it will take about 4-10 hours, depending on how complex it is).

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!
Quote Reply
Re: [Andy] Tables being screwed up... In reply to
I _hate_ designing templates with a passion.

I've done about 10 sets over the past few months and it tests my patience to the max.....infact I often end up sticking pins in my eyes.

Last edited by:

Paul: Jun 8, 2002, 11:44 AM
Quote Reply
Re: [Paul] Tables being screwed up... In reply to
That is funny Paul... I was just telling my girlfriend how I would rather be locked in a dark room and slashed with razor blades, than change my templates yet again!!!!!

Laugh


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Ian] Tables being screwed up... In reply to
One way to do it, is to take advantage of the "include" files.

If you pull all the stuff out of the templates, into include files, you can create completely new template designs by editing either only the "base" (layout) template sets (such as category.html, new.html, etc) or the include files (header.html, side_bar.html, side_left.html, etc).

I have 4 or 5 basic layout sets, and all make use of a very large globals.txt file, along with modified include files.

One other hint, is if you manage several sites, develop your header.txt and globals.txt file such that your header.txt file references the "logo_large" or "logo_small" tags in globals.txt, and you can then just edit the globals.txt file to make broad sweeping changes across sites. You can do this with color scheme as well, by using <%color1%>, <%color2%>, etc tags in your files, or things such as <%bg_color%>, <%txt_color%> etc. Then, to change your color scheme, even seasonally, all you do is edit the color tags in globals.txt to go from spring greens, to summer colors, to fall oranges, etc.

Additionally, if you find you use functions to do things, put your functions in a separate file (not the globals.txt) and reference them using the function notation in the templates <%Plugins::MyUtilFile::function_name(optional,parameters)%> . This will allow changing functions across sites without editing the globals.txt file, especially for things not used by all templates all the time.

Just some suggestions for easier site management. It takes awhile to do (depending on your site layout complexity ... one set of templates took me almost 100 hours to rewrite, but it has let me create "new" sites with almost no effort since then-- ie: I only have to edit globals.txt, and upload the images to the appropriate directory), but it is well worth it down the road if you are going to manage 5-10 sites, (or different template sets for one site), and is essential if you maintain more than that.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Tables being screwed up... In reply to
Pugdog, you are full of great suggestions.

I have yet to use the header.txt or footer.txt in my template sets.

I am considering a re-do here!


Edit: I have learned the hardware, and have already started putting in custome tags for fonts and colors.


http://www.iuni.com/...tware/web/index.html
Links Plugins

Last edited by:

Ian: Jun 8, 2002, 6:32 PM
Quote Reply
Re: [Ian] Tables being screwed up... In reply to
Don't confuse the header.txt I mentioned as an abstract concept with the "default headers" that you can set in the Category table record. Those are different things.

In my templates, for example, I have a basic layout of something like:

Code:
<HTML>
<HEADER>
<TITLE></TITLE>
</HEADER>
<%body_tag%>
<%body_table_width%> !--- essentionally a <TABLE><TR><TD> set of tags
<%include header.txt%> !-- this inserts a formatted header block, limted by the above page defining tag.
<%include format_bar.txt%> !-- this sets up the colors, if any
<%include search_box.txt%> !-- this adds the search bar
<%include navi_bar.txt%> !-- this inserts the navigation bar
<%include content_area_header%> ! this sets up the content block of the page, and sets up a <TABLE><TR> block.
<%include side_bar%> !-- this opens <TD></TD> area to allow a page block format.
<%include content_format.txt%> !-- this opens another <TD></TD> area for the content of the page
<%include advert_bar.txt%> !-- this includes a right-side bar in another <TD></TD> tag.
!-- now all the above tags are closed
</TR></TABLE> !-- content_format block closed. (can use a tag if you wish)
</TD></TR></TABLE> !-- closes the body_table_width tag
</body> !--- closes the body tag
</html> !-- closes the HTML tag, and ends the file (by w3 standards).


This sets up a page with the basic areas that look something like this:

Code:
______________________________________
| |
| HEADER |
| |
======================================
| | | |
| | | |
| SIDE | CONTENT | |
| BAR | | Advert|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
======================================
| |
| FOOTER |
| |
======================================


You can of course set up any sort of page layout you want :)


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Tables being screwed up... In reply to
oooo, thanks for sharing that!

I'll bet you have made some really good templates. And anyone thinking of making theirs should follow your example here. As you say, it is a bit more work in the begining, but it will save you a lot of effort when you want to make changes, or make news ones.


Edit: your above post seems worthy of the Links Manual in my opinion, at least the resources section anyway.

The reason why I think this is great, is beacuse I remember how confusing I thought this all was when I was setting up my templates, when I firtst got links. A little guidance like this can be a great guide.


http://www.iuni.com/...tware/web/index.html
Links Plugins

Last edited by:

Ian: Jun 8, 2002, 7:18 PM
Quote Reply
Re: [Ian] Tables being screwed up... In reply to
You need to be careful though if using dynamic mode.....remember every include requires a file to be opened/read/closed so if you have 5 includes per template that means 5 files have to be read.

Every include will add more overhead and slow things down.
Quote Reply
Re: [Paul] Tables being screwed up... In reply to
I don't think a few extra file calls will slow things down at all. But, you can probably check to see what happens by creating the single template and the one with the includes, and running the timer on it a few times to see if there is a difference. Probably negligible (if at all evident) even on large sites.

Links pre-parses, and caches. The overhead for the includes is quite small. Operating systems also tend to keep frequently accessed data/files available. So, if you are including the same files over and over again, you'll get somewhat enhanced performance as well.

If you want to get a feel for how much work Links is doing, think about all the hooks, plugins, functions, and other stuff it does on each pass. All the tag substitution, and function runs.

Check out the <%GT::Template::dump%> on various pages to see the data being pushed around.

A couple of extra file calls to simplify site management are the _least_ of the worries! Those file calls are going to be much less overhead than a single database query. Remember, all you are doing is reading them (slurping them into memory), you aren't searching, writing, or doing anything else to them until they are in memory, and sent through the parsing system with the rest of the code.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Tables being screwed up... In reply to
Well, slowley but surely I'm getting there. Here is the 1st main page I have done now;

http://207.230.62.131/...mplates/page.cgi?d=1

I'm working on the category pages now, and then the rest of them 1 by one. I'm wondering if I should offer different sets. I.e.

Small Package - $35;

Category pages
Rating pages
New/Pop pages
Detailed pages
Add/Modify pages

Full Package - $75;

Category pages
Rating pages
New/Pop pages
Detailed pages
Review pages
User login pages
Add/Modify pages
and the rest of the tempaltes..

What do you lot think?

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!
Quote Reply
Re: [Andy] Tables being screwed up... In reply to
That looks nice Andy.



I would suggest a full set for each as to carry the theme through the whole site.



Again, nice work!
Quote Reply
Re: [Teambldr] Tables being screwed up... In reply to
Thanks Smile

I think I will do 2 sets though. I'm sure you can imagine/remember having to spend out loads of money on getting templates designed right after buying Links SQL (unless you had enough time to learn how to do it yourself). I think people would prefer to have 2 options...a small one, and then if/when they ever need the rest of the templates they can get the other one Tongue

Thanks

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!
Quote Reply
Re: [Andy] Tables being screwed up... In reply to
Ah, so you are saying split it into two parts for sale as well as a whole.

Part A = 35
Part B = 40

Whole Set = 75

That might work well. As long as they had the option to get part B at a later date.

Again, nice work.
Quote Reply
Re: [Andy] Tables being screwed up... In reply to
Nice job Andy. Very clean looking.


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Ian] Tables being screwed up... In reply to
Argh..bummer. I'm getting some weird stuff happening now! I am using the following code as global;

Code:
sub {

my $globals = do("$CFG->{admin_root_path}/templates/$CFG->{build_default_tpl}/globals.txt");
my $images = $globals->{image_location};

my $html = qq|

<tr>
<td><img src="$images/p_08.gif" width=119 height=20></td>
</tr>
<tr>
<td background="$images/p_10.gif" class="topics" height="19"><a href="<%build_root_url%>"><img src="$images/spacer.gif" width="10" height="1" border="0">::
<span lang="en-gb">Home</span></a></td>
</tr>
<tr>
<td><img src="$images/p_11.gif" width=119 height=1></td>
</tr>
<tr>
<td background="$images/p_12.gif" class="topics" height="19"><a href="<%db_cgi_url%>/add.cgi?ID=<%category_id%>"><img src="$images/spacer.gif" width="10" height="1" border="0">::<span lang="en-gb">
Add</span></a></td>
</tr>
<tr>
<td><img src="$images/p_13.gif" width=119 height=1></td>
</tr>
<tr>
<td background="$images/p_14.gif" class="topics" height="19"><a href="<%db_cgi_url%>/modify.cgi?ID=<%category_id%>"><img src="$images/spacer.gif" width="10" height="1" border="0">::
<span lang="en-gb">Modify</span></a></td>
</tr>
<tr>
<td><img src="$images/p_15.gif" width=119 height=1></td>
</tr>
<tr>
<td background="$images/p_16.gif" class="topics" height="19"><a href="<%build_root_url%>/New/"><img src="$images/spacer.gif" width="10" height="1" border="0">::<span lang="en-gb">
New</span></a></td>
</tr>
<tr>
<td><img src="$images/p_17.gif" width=119 height=1></td>
</tr>
<tr>
<td background="$images/p_18.gif" class="topics" height="19"><a href="<%build_root_url%>/Cool/"><img src="$images/spacer.gif" width="10" height="1" border="0">::
<span lang="en-gb">Cool</span></a></td>
</tr>
<tr>
<td><img src="$images/p_19.gif" width=119 height=1></td>
</tr>
<tr>
<td background="$images/p_20.gif" class="topics" height="19"><a href="<%build_root_url%>/Ratings/"><img src="$images/spacer.gif" width="10" height="1" border="0">::<span lang="en-gb">
Top Rated</span></a></td>
</tr>
<tr>
<td><img src="$images/p_19.gif" width=119 height=1></td>
</tr>
<tr>
<td background="$images/p_20.gif" class="topics" height="19"><a href="<%db_cgi_url%>/subscribe.cgi"><img src="$images/spacer.gif" width="10" height="1" border="0">::
<span lang="en-gb">Newsletter</span></a></td>
</tr>
<tr>
<td><img src="$images/p_19.gif" width=119 height=1></td>
</tr>
<tr>
<td background="$images/p_20.gif" class="topics" height="19"><a href="<%db_cgi_url%>/jump.cgi?ID=random"><img src="$images/spacer.gif" width="10" height="1" border="0">::
<span lang="en-gb">Random Link</span></a></td>
</tr>
<tr>
<td><img src="$images/p_19.gif" width=119 height=1></td>
</tr>
<tr>
<td background="$images/p_20.gif" class="topics" height="19"><a href="<%db_cgi_url%>/search.cgi"><img src="$images/spacer.gif" width="10" height="1" border="0">::
<span lang="en-gb">Search</span></a></td>
</tr>
<tr>
<td><img src="$images/p_19.gif" width=119 height=1></td>
</tr>
<tr>
<td background="$images/p_20.gif" class="topics" height="19"><a href="<%db_cgi_url%>/user.cgi"><img src="$images/spacer.gif" width="10" height="1" border="0">::
<span lang="en-gb">Login</span></a></td>
</tr>

|;

return $html;

}

The idea is to allow people to edit the menu as a global...but I'm getting the problem that the <%tags%. are not being passed. Is there any way I can access them directly? Maybe something like $IN->, or am I wishful thinking agian? Unsure

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!
Quote Reply
Re: [Andy] Tables being screwed up... In reply to
Andy, I may have missunderstood this, but why <%db_cgi_url%> and not just $CFG->{db_cgi_url} in your print statements?


http://www.iuni.com/...tware/web/index.html
Links Plugins

Last edited by:

Ian: Jun 10, 2002, 10:29 AM
Quote Reply
Re: [Ian] Tables being screwed up... In reply to
Yeah, thats the kind of things I need to replace the tags. Because it is in a global, it needs variables, rather than tags (the the top part, and why the whole thing is in a sub, and not just a normal global)...the $CFG varible is good...but I also need other variables, like category_id Frown

Thanks

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!
Quote Reply
Re: [Andy] Tables being screwed up... In reply to
Andy I use category_id all the time. All you have to do is retrieve from what ever is holding onto the id... and this seems to depend on where the sub/global/template you are using lays.

Edit: In my case, I have found it easier to steer clear of the globals, and put everything into plugin subs. This way @args will usuall have what you want or something else. I find the globals trickier to make work for some reason.


http://www.iuni.com/...tware/web/index.html
Links Plugins

Last edited by:

Ian: Jun 10, 2002, 10:29 AM
Quote Reply
Re: [Andy] Tables being screwed up... In reply to
One way I got the category_id from the Category.html template for example (in a global) is:

my $tags = shift;
my $cat_id = $tags->{'ID'};


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Ian] Tables being screwed up... In reply to
Ian..thats great! Worked exactly how I needed it Smile

Have a look at it if you want;
http://207.230.62.131/...2Findex.html&d=1

All I need to really do now if the modification templates, check the add ones, and the search templates, and that should be it. Then I can see if it has been worth all this time and efford..LOL

If it does work out, then I may make some more, to give people a bit more variety.

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!
Quote Reply
Re: [Andy] Tables being screwed up... In reply to
Glad it worked! Nothing like giving back some of the help you guys have given me!

The template looks good.

"Then I can see if it has been worth all this time and efford..LOL"

Ahh, the sentiments of a developer.Wink


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Ian] Tables being screwed up... In reply to
Thanks Cool I'll start a new thread stating what I'm going to be doing, and the future plans if these ones work out well sometime later today or tomorrow.

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!