Gossamer Forum
Home : Products : Links 2.0 : Discussions :

major problems

Quote Reply
major problems
Hi,

I've been reading up a lot on putting in code for headers and footers, what i'd like to know is if it's enough that i edit the links.cfg file to give the header/footer location, or whether i have to go into the perl files and mess about with the code.

also whenever i try to verify links, i get the following extremely annoying message

Fatal error: Can't locate object method "netloc" via package "URI::http" (perhaps you forgot to load "URI::http"?)

There is no workable solution provided to the above problem, so i would really appreciate it if someone could help

Thanks
Quote Reply
Re: [lewisifer] major problems In reply to
Don't do anything with the code, you set the header/footer paths via the admin, under the 'category' section (either add or modify). Sorry, can't help you with the other problem...


Leonard
aka PerlFlunkie
Quote Reply
Re: [lewisifer] major problems In reply to
Looks like you need to get your host to install 'URI' and URI::http.

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!
Quote Reply
Re: [Andy] major problems In reply to
I have the URI and URI::http installed..this thing was working previously and for some reason doesn't work anymore..any help would be greatly appreciated..I've already tried most of the tricks mentioned in the forums..and it still persists.

Thanks
Quote Reply
Re: [PerlFlunkie] major problems In reply to
what if i already have a bunch of webpages with existing headers and footers that i need to change?..links was probably loaded on to the system after these pages had been modified, because there's no mention of headers and footers in the category section. The fields are blank, and i can't find any locations in the perl code either, so i'm really confused if me adding a header to the categories section is simply going to result in two headers per index.html file generated in the category. Any help would be greatly appreciated
Quote Reply
Re: [lewisifer] major problems In reply to
The other way to have easily-changable headers and footers is to use the <%include header.txt%> and similar for footer. To do this, you need the updated template.pm from the resource section, and a header.txt (and footer.txt) file in the template directory. Without this, or the use of the fields in the admin, the header and footer of EACH page would have to be edited manually. Ugh!


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] major problems In reply to
Thanks for the prompt reply

The issue is that the existing headers on the webpages are actually html files, with fancy image collages and such..and templates.pm hasn't been touched by whoever it is that previously worked on it..so i am assuming that these guys went in manually and changed everything..would me changing everything in the admin change the manual code? or do i have to go in manually one by one? there's about a couple of hundred index htmls to change..

Thanks again.
Quote Reply
Re: [lewisifer] major problems In reply to
You don't need to change each existing html page, you just change the template through the admin (using templates, right?). Then when you rebuild, all the pages are re-created with the new info. Assuming you want the header and footer to be the same on every page, I suggest going with the <%include header.txt%> method. To do this, replace some existing code in your template.pm with this: http://www.gossamer-threads.com/scripts/resources/Detailed/877.html

Then create the header.txt and footer.txt files in the template directory, and put in them the code you want. It would be easiest to keep these files somewhat self-contained, meaning a full table code or css div, instead of a continuation of other code. Then, edit all the templates to use the call tags, like so (note, this is not all stock code, but the placement of the tags would be the same)[from category.html]:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/...ml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta
http-equiv="Content-Type"
content="text/html;CHARSET=iso-8859-1" />
<title><%site_title%> » <%category_name%></title>

<%if meta_name%>
<meta name="description" content="<%meta_name%>">
<%endif%>
<if meta_keywords%>
<meta name="keywords" content="<%meta_keywords%>">
<%endif%>
<link
rel="stylesheet"
type="text/css"
href="/links/links2.css" />
</head>
<%include header.txt%>
<div id="mid-section">
<div id="mid-col-4">
<!-- begin unique content -->
<!-- Category listings -->
<%if category%>



And here is my header.txt file:

<!-- begin header.txt -->
<body>
<div
id="top-section">
<div
id="top-col-1">
<div
id="title">
<a href="/index.html">
<img
src="/images/totcbank.gif"
height="31"
width="419"
border="0"
alt="The One True Church" /></a>
</div>
<!--ignore_perlfect_search-->
<%sitenav%>
<!--/ignore_perlfect_search-->
</div>
</div>
<!-- end header.txt -->

If you go to my site and view the source code, you will see how this fits together. I like to include the <!-- comment --> tags so I know exactly where the code is coming from, to make future edits easier.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] major problems In reply to
Hi, i finally got most of it to work using the header.txt method, but i have only one problem..my header uses javascript..how do i incorporate that into a txt file?

The actual header is an html file.There is also a txt file that i used.

<script type="text/javascript" src="http://www.erau.edu/v3includes/GeneratedItems/menumachine.js"></script> that line is called in the html file but is missing in the text file..i'd like to know how to put in the JS bit. these are the contents of the header.txt file:

<table width="100%" border="0" cellpadding="0" cellspacing="0">

<tr>
<td colspan="3" id="globalnav">
<a href="http://www.erau.edu/er/sitesearch.html"><img src="http://www.erau.edu/...lMenu-SiteSearch.gif" alt="" width="73" height="15" border="0"></a>
<a href="http://websearch.erau.edu/cgi-bin/ldapsearch.hperl"><img src="http://www.erau.edu/...enu-PEOPLESEARCH.gif" alt="" width="87" height="15" border="0"></a>
<a href="http://erau.blackboard.com"><img src="http://www.erau.edu/...lMenu-ERAUONLINE.gif" alt="" width="73" height="15" border="0"></a>
</td>
</tr>
<script type="text/javascript" src="http://www.erau.edu/v3includes/GeneratedItems/menumachine.js"></script>
<tr>
<td id="logo" width="27%"><a href="http://www.erau.edu/index.html"><img src="http://www.erau.edu/...go/3DLogo01B-200.jpg" alt="logo" width="200" height="45" border="0"></a></td>
<td id="flexcell"></td>
<td id="headergraphic"><a href="http://www.erau.edu/index.html"><img src="http://www.erau.edu/...rs/montage04ERAU.jpg" alt="montage" height="72" border="0"></a></td>
</tr>

</table>

<table width="750" border="0" cellpadding="0" cellspacing="0">

<tr>
<td id="menuspace"><img src="http://www.erau.edu/...Menu-Main-CatBar.gif" alt="menu background" width="750" height="80" border="0">
</td>
</tr>
</table>




Thanks
Quote Reply
Re: [lewisifer] major problems In reply to
You may need to put the js script in each file (templates: like add.html), above the closing </head> tag, then isn't there normally a closing js tag set after the </body> tag? That could go into a footer.txt, if you have one, or into each page if not.


Leonard
aka PerlFlunkie