Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Adding to a design template

Quote Reply
Adding to a design template
My designer has finished my work but I'm having a hell of a time trying to incorporate it.

I brought up the index.html template and renamed it index1.html to test.

Under the "categories" section on my page, I pasted the following in:

<%category%>



<p class="grandtotal">There are <strong><%grand_total%></strong> links for you to choose from!</p>

But when I bring up mydomain.com/links/index1.html

"There are links for you to choose from!"

is all it says.

Now, when I updated index1.html from the template and saved it, it saved it in the cgi-bin under admin/templates

I have 60+ categories showing on index.html == what do I copy over into my design to make it show up?



I'd like to be alone in a room, and enjoy the company.
Quote Reply
Re: [hairy] Adding to a design template In reply to
There is a whole speil to go through to add a new page, and it involves more when you're dealing with the index page. If you're just testing, then change your original index name to index_1, and copy your changed index1 in place of index. Understand? This will be easier for a short-term test, unless you really want two different index pages...?


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Adding to a design template In reply to
I don't think I made myself clear, I only added index1.html so I didn't break the real index page. I wanted to get it all lined up and perfect, then rename it index.html.

I have a design to incorporate into my site's main page. I want the categories listed in a table I have.

I can't figure out which page to edit, index.html or home.html.

No matter which I edit, the categories don't show up, just that single line.

In both index.html and home.html templates, the ONLY reference to categories is

<%category%>

<p class="grandtotal">There are <strong><%grand_total%></strong> links for you to choose from!</p>

So, how do I get all the categories showing on my index.html page to get into my new design?


Edit: I did what you said, btw -- and nothing has changed. After I renamed index to index1, I pasted in all the design stuff to index and saved it and did a build

The old index.html file still shows



I'd like to be alone in a room, and enjoy the company.

Last edited by:

hairy: Nov 20, 2003, 12:23 PM
Quote Reply
Re: [hairy] Adding to a design template In reply to
in your links.cfg file change
Code:
$build_index = "index.html";
to
$build_index = "index1.html";


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] Adding to a design template In reply to
Thanks, that solves part of the problem :)



I'd like to be alone in a room, and enjoy the company.
Quote Reply
Re: [hairy] Adding to a design template In reply to
The stuff that replaces the <%category%> tag is created by the last sub in site_html_templates.pl


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Adding to a design template In reply to
Ok .... now ... how do I get that 'stuff' into my new design?



:)



I'd like to be alone in a room, and enjoy the company.
Quote Reply
Re: [hairy] Adding to a design template In reply to
OK, but it takes a bit...

In link.cfg, you need both of these:

$build_index = "index.html";
$build_index1 = "index1.html";


In site_html_templates.pl, paste the sub below under the existing sub site_html_home:



sub site_html_home1 {
# --------------------------------------------------------
# This routine will build a home page. It is not meant to have any
# links on it, only subcategories.

return &load_template ('home1.html', {
category => $category,
grand_total => $grand_total,
%globals
});
}

Make sure the name of the template matches what you have in the template directory. Next, in nph-build.cgi, under sub build_all, paste this under the current Create Home Page:

# Create Home Page1
$use_html ?
print qq|Building <A HREF="$build_root_url/$build_index">Home Page1</A> . . .\n| :
print qq|Building Home Page1 . . .\n|;
&build_home_page1;
print "\tDone\n\n";

Further down in nph-build, paste this sub under the existing sub build_home_page:

sub build_home_page1 {
# --------------------------------------------------------
my ($subcat, @rootcat);
local ($total);

# Check to see which categories are off of the root.
foreach $subcat (sort keys %category) {
if ($subcat =~ m,^([^/]*)$,) {
push (@rootcat, $subcat);
}
}
print "\tSubcategories: "; print $#rootcat+1; print "\n";
print "\tTotal Links: $grand_total\n";
print "\tOpening page: $build_root_path/$build_index1\n";

open (HOME, ">$build_root_path/$build_index1") or &cgierr ("unable to open home page: $build_root_path/$build_index1. Reason: $!");
$category = &site_html_print_cat (@rootcat) if ($#rootcat >= 0);
$total = $grand_total;
print HOME &site_html_home1;
close HOME;
print "\tClosing page.\n";
}

That should pretty much do it... As always, make sure you have a backup of everything... Ya know, it would probably be easier to just copy your whole Links script into a file names Links2, change the names in links.cfg to match that, and practice your mods using that...


Leonard
aka PerlFlunkie

Last edited by:

PerlFlunkie: Nov 21, 2003, 9:44 AM
Quote Reply
Re: [PerlFlunkie] Adding to a design template In reply to
Ok, now I'm totally lost. WHY do I have to make so many changes? I took my new design copied it into index.html and did a build and it didn't show up. I also have a 'home.html' file that's identical. Why?

Why can't I just take the new design, add in the <%category%> line from the current index.html and have the page work?



I'd like to be alone in a room, and enjoy the company.