Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Framesets and individual pages with dynamic <title><title>

Status
Not open for further replies.

paulx82

Technical User
Feb 11, 2002
21
AU
I use SSI to include HTML for a consistent header and footer in my web site. The frameset page title is "Such and Such" and so is the title in all pages, as is defined in the SSI header.

I wish to change the title in the individual pages using Perl. I know that the title of the individual pages will not appear when viewing the pages with the frameset. However, I would like the titles to be exclusive to each page when they are opened individually. Rather than take the <title></title> tags out of the SSI header, I would like to generate the titles dynamically.

I was thinking that a script executed by an SSI directive in the individual pages might be able to get the path and filename of the page it is executed in and match the path and filename with a title stored in a text file. There would be a text file with a list of path names, filenames and titles.
The SSI directive would write <title>$title</title> to the page.

Perhaps, I should just abandon the frameset, but I don't really want to. I am currently learning Perl, but I don't know where to start with this project. If anyone has any advice on what to do and/or what perl modules/functions could help, I would be appreciative. I hope I have explained what I want clearly, if not, please ask for clarification.

Thankyou The discipline used to write things down is the first step in making them a reality.
 
Sounds like a job for JavaScript

<script language=&quot;javaScript&quot;>
var a=document.URL;
var b=a.lastIndexOf('/');
var c=a.length-b;
document.write ('<title>'+a+'</title>);
</script>

HTH
;P
 
But Javascript is no value where users have it dissabled... :(

I don't know PERL (which is why I am here!) but I do like SSI! :)

<!--#include virtual=&quot;titles.inc?$document_uri&quot; -->
<!--#echo var=&quot;$title&quot; -->

#############################

<!--#if expr&quot;$query_string=/index.shtml&quot; -->
<!--#set var=&quot;title&quot; value=&quot;Welcome to my Home Page&quot; -->
<!--#elsif expr&quot;$query_string=/email.shtml&quot; -->
<!--#set var=&quot;title&quot; value=&quot;Send me feedback...&quot; -->
<!--#else -->
<!--#set var=&quot;title&quot; value=&quot;Stop trying to mess up my server!&quot; -->
<!--#endif -->
 
Actually,

<!--#include virtual=&quot;titles.inc&quot; -->

###################

<!--#if expr=&quot;$document_uri=/index.shtml&quot; -->

hope that helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top