Jump to content

Unique Title Pages in ASP


bled05

Recommended Posts

I have a site that uses ASP include files to create template-based navigation. There are several main categories for navigation, each having multiple HTML pages available for display, all of which display the page title of the main page. Does anyone know of a way to redesign these pages, where each include file will display a unique page title?Thanks!

Link to comment
Share on other sites

The following code from one of my pages uses asp to get the year and stick it in the title and some other text based upon the IP address from the custom myIPSub function.

<head> <title><%= myIPSub %> Stock Take © <%= year(date) %></title></head>
Link to comment
Share on other sites

The following code from one of my pages uses asp to get the year and stick it in the title and some other text based upon the IP address from the custom myIPSub function.
Thank you for the response. I have a main ASP page that is used as a container/template with the heading and navigation menus intact. This page uses multiple HTML include pages to deliver various content through the main ASP page. What I need is for each time I display one of the include files for the title in the main page to change to reflect the content of the include file. I'll admit that I'm learning ASP and I'm maintaining a site that I inherited with no documentation - each time I add a feature and/or redesign something, I basically have to reverse engineer the site. It's quite challenging.
Link to comment
Share on other sites

The following code from one of my pages uses asp to get the year and stick it in the title and some other text based upon the IP address from the custom myIPSub function.
Thank you for the response. I have a main ASP page that is used as a container/template with the heading and navigation menus intact. This page uses multiple HTML include pages to deliver various content through the main ASP page. What I need is for each time I display one of the include files for the title in the main page to change to reflect the content of the include file. I'll admit that I'm learning ASP and I'm maintaining a site that I inherited with no documentation - each time I add a feature and/or redesign something, I basically have to reverse engineer the site. It's quite challenging.
Link to comment
Share on other sites

Set the page title as a variable in the template, and in each page assign whatever title text you want to that variable before you include the template. That's the way most people do it.
Thanks again! Sadly, I don't even know how to do that. I'm pretty much an HTML designer, trying to learn ASP development - without much guidance, I might add.
Link to comment
Share on other sites

What is the code you're using for the template and one of the pages that includes it? In general, you set a variable and include the template:page_title = "The page title"<!--#include file=template.asp -->And the template just prints the variable in the title.<title><%=page_title%></title>

Link to comment
Share on other sites

Thanks again! Sadly, I don't even know how to do that. I'm pretty much an HTML designer, trying to learn ASP development - without much guidance, I might add.
I have a template called employ.asp and twenty some odd sub .HTML and .asp pages, all include files. As it stands now, each page reads the title from employ.asp. Here is a sample of the code in the template page. <%if isempty(request.querystring("content")) then%> <!--#include file="employ/employover.html" --> <%elseif (LCase(request.querystring("content"))="detail") then%> <!--#include file="employ/jobdtl.asp" --> <%elseif (request.querystring("content")="cmco") then%> <!--#include file="employ/cmco.asp" --> <%elseif (request.querystring("content")="schools") then%> <!--#include file="employ/schools.html" --> <%elseif (request.querystring("content")="internover") then%> <!--#include file="employ/internover.html" --> <%elseif (request.querystring("content")="coop") then%> <!--#include file="employ/coop.html" --> <%elseif (request.querystring("content")="inroads") then%> <!--#include file="employ/inroads.html" --> <%end if%>Do I need to create an include file for each title? I've tried putting this code in the head of one of my include files with no results:<title><%=page_title%></title>I also tried putting this in the employ.asp head and giving each include file a unique titleI also created a seperatte .asp page with <title>Unique Title</title> as the only line and added it to the include files on employ.asp. This gave my page the Unique Title, but I'm not sure if I should create a page like this for each include file or how to pass them both at the same time, or if I should add something to the existing requestring.Thanks!
Link to comment
Share on other sites

I'm a little confused by your structure, but the concept is really simple: set a variable to a certain value, and then include a file that uses that variable. If your template file has a title tag in the head section and prints out a variable for the title text, then set that variable on the parent page before including the template. It will write the variable text to the title tag.

Link to comment
Share on other sites

I'm a little confused by your structure, but the concept is really simple: set a variable to a certain value, and then include a file that uses that variable. If your template file has a title tag in the head section and prints out a variable for the title text, then set that variable on the parent page before including the template. It will write the variable text to the title tag.
Perhaps I'm just too dense to get it, and I have no doubt that whoever designed this site probably didn't use logical structures, as you say. My template file is the parent page the way I understand how this works - the only thing that changes is content from the include files. If I put the variable in the template page, will it change the title when the include pages display if these pages have a unique title, or do I need to put some kind of variable with the titles? Like this:employ.asp - my template file would have the variable wrapped in the title tageach include file would then have a unique page title. I've tried this and it doesn't work.Thanks
Link to comment
Share on other sites

The only page that matters is the page that contains the HTML <title> tag. If that is your parent page, where that page includes other pages, then putting a variable in those other pages isn't going to help. You need to set the title variable before you include whatever page contains the <title> tag. If your employ.asp page contains the <title> tag, then you need to set the variable on that page or on a page that includes that page. It might be easier to understand if you post the code that you're working with.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...