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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

switch Title for different pages

Status
Not open for further replies.

zbphill

Technical User
Jan 30, 2007
40
US
thanks for the help

I'm looking for a tutorial or help on.
I want to have 2 different titles for one main page, I want the title to switch depending on what page it is going through.

So if my main page going through (example)text/content/moreinfo/help1.html, title 1 will show up. If my main page is going throught (example)text/content/moreinfo/help2.html the title 2 will show up.

any ideas
 
basically I have one html page that gets placed in the middle of two different pages with javascripe, through a third party software. Like a frame.
 
Maybe with, document.title="page2";
any chance of any code ?
 
Maybe I shouldn't say title, I want to switch Div.
No I couldn't send any code.
 
zbphill, you are not making sense.

try re-reading your first and second post, and then put yourself in our shoes and try to understand what it is you're saying.

if you don't have a link, and you don't describe the problem, and you don't provide any information, how do you expect us to help?



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Okay, sorry.

I have a page (called diff.html) diff.html is a page that describes products. the problem is that I have many products.
and for each product I have two different headers (header= product name or company name) for each product. Each Header will be going to a separate URL (2 URLs). All the content in diff.html is the same but the header. I want to create one HTML for each product. So I want the Header to change automatically with the separate URL.

thanks for the help
 
Hi

To me is still confusing. Why to change a heading ( or title or whatever ) dynamically in a static page ( assuming that file with .html extension is static ) ?

Could you give us example code of how the page with different heading will be requested and for each case how the heading should look ?

Feherke.
 
I think you'll need to pass something through some kind of function to get something out the other end. You can then do something with that result.

Sorry I can't be more helpful. :)

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.
 
Your correct, It will be static, someone that is doesn't now HTML well well be changing out the copy.I know you can do one html page and copy the code to the other, I don't want to do that, I want to make it simple for the person that will be updating the copy.

I copied the code below. Now if you look at the code, you will see a h1 and a h2. I want the h1 to show up when the page goes to and I want the h2 to show up when it goes to
Thanks, again.



<html>
<head>
<style>
<!--
h1.difftitle{
font-family: Georgia, Times New Roman, serif;
font-style: italic;
color: #5a5346;
font-size: 16px;
text-align: center;
font-weight: normal;
margin: 4px 0;
}
h2.difftitle2{
font-family: Georgia, Times New Roman, serif;
color: #5a5346;
font-size: 18px;
text-align: center;
font-weight: normal;
margin: 4px 0;
}

#diffpic{
border: solid 2px #776b53;
width: 213px;
height: 200px;
margin: 4px 0;
float: left;
}

#wrapper{
float:right;
width:100%;
margin-left:-233px;
}

#wrapper img{
position:relative;
left: 0px;

margin-top:37px;
}


#ptcontent{
font-family: Verdana, Arial, Helvetica, Geneva, sans-serif;
font-size: 10px;
line-height: 16px;
margin-left: 233px;
color: #85785c;
}

div#ours{

}
div#smallours, div#smalltheirs{
border: solid 1px #83765b;
width: 90px;
height: 90px;
margin: 10px;
float: right;
position:relative;
bottom:-170px;
}




div#theirs, div#ours{
width: 100%;
height: 280px;

}



div#ourtheirBox{
width: 70px;
height: 20px;
font-family: Georgia, Times New Roman, serif;
font-weight: bold;
color: white;
font-size: 10px;
text-align: center;
padding-top: 3px;
float:left;
background-color: #4f4d48;
}

.lrowd, .rrowd, .lrowl, .rrowl {
font-family: Verdana, Arial, Helvetica, Geneva, sans-serif;
font-size: 10px;
line-height: 14px;
text-align: left;
padding: 6px 6px;
color: #3e3e3e;

}

td ul {
margin:0;
padding:0 0 0 20px;
}

td li {
padding-left: 3px;
}

.lrowd{
background-color: #f4f2ed;
border-left: solid 1px #494640;
border-right: solid 1px #494640;
}

.rrowd{
background-color: #f4f2ed;
border-right: solid 1px #494640;
}

.lrowl{
background-color: #fefefd;
border-left: solid 1px #494640;
border-right: solid 1px #494640;
border-top: solid 1px #cdc5ae;
border-bottom: solid 1px #cdc5ae;
}

.rrowl{
background-color: #fefefd;
border-right: solid 1px #494640;
border-top: solid 1px #cdc5ae;
border-bottom: solid 1px #cdc5ae;
}

#productpics {
background-color: #f0eee7;
border: solid 1px #cdc5ae;
width: 100%;
margin-top:10px;
padding: 10px;
}

#td1, #td2, #td3{
font-family: Verdana, Arial, Helvetica, Geneva, sans-serif;
font-size: 10px;
text-align: center;
font-style: italic;
color: 766b52;
height: 130px;
}


#td1{
display: block;
width: 30%;
float: left;
margin:0;
}

#td2{
display: block;
width: 30%;
float: right;
margin:0;
}

#td3{
display: block;
margin:0 33%;
}

.diffproducts{
width: 100%;
height: 100%;
}

-->
</style>
</head>
<body>
<h1 class="difftitle">Deep-step Aluminum Ladders</h1>
<h2 class="difftitle2">THE FRONTGATE DIFFERENCE™</h2>
<hr size="1" noshade color="d7d1be" style="clear:both; margin:0;">
<div id="wrapper">
<!-- Difference Product Content -->
<div id="ptcontent">We spent a full year researching and redesigning our popular ladders, making your safety the top priority. At Frontgate, we often design products ourselves, with unique details that ensure you receive quality above and beyond anything else on the market.<br>
<!-- PT Difference Picture -->
<img src=" 8px;">
<img src="../../../FG Landing Pages/SEOLanding/images/ptSign_brown.jpg" width="67" height="70" alt="Paul Tarvin, President" border="0">
</div>
</div>
<!-- Frontgate Difference Lifestyle Picture -->
<div id="diffpic" style="background: url( 0 0 no-repeat; background-position: center center;"></div>
<hr size="1" noshade color="d7d1be" style="clear:both; margin:0;">
<table width=100% border=0 cellpadding=0 cellspacing=0 style="margin-top:8px;">
<tr>
<td heigth=280px width=50% style="border: solid 1px #494640;">
<div id="ours" style="background: url( 0 0 no-repeat; background-position: center center;">
<div id="ourtheirBox" >OURS</div>
<div id="smallours"style="background: url( 0 0 no-repeat; background-position: center center;"> </div>
</div>
</td>
<td heigth=280px width=50% style="border-right: solid 1px #494640; border-top: solid 1px #494640; border-bottom: solid 1px #494640;">
<div id="theirs" style="background: url( 0 0 no-repeat; background-position: center center;">
<div id="ourtheirBox">THEIRS</div>
<div id="smalltheirs"style="background: url( 0 0 no-repeat; background-position: center center;"> </div>
</div>
</td>
</tr>
<tr>
<td class="lrowd" width=50% valign=middle><ul><li>At 5", the deepest, safest steps available in a ladder</li></ul></td>
<td class="rrowd" width=50% valign=middle><ul><li>Steps are 3-1/4" deep.</li></ul></td>
</tr>
<tr>
<td class="lrowl" width=50% valign=middle><ul><li>Open the stoolbox lid to hold assorted screws and nails</li></ul></td>
<td class="rrowl" width=50% valign=middle><ul><li>Pull-out toolbox tray is shallow, holds less and is difficult to open</li></ul></td>
</tr>
<tr>
<td class="lrowd" width=50% valign=middle><ul><li>Paper towel holder is placed for safety during use</li></ul></td>
<td class="rrowd" width=50% valign=middle><ul><li>Paper towel holder's location creates safety hazard</li></ul></td>
</tr>
<tr>
<td class="lrowl" width=50% valign=middle style="border-bottom: 1px solid #494640;"><ul><li>No inverted V at top, eliminating safety hazard</li></ul></td>
<td class="rrowl" width=50% valign=middle style="border-bottom: 1px solid #494640;"><ul><li>Inverted V at top could catch on clothing or draperies</li></ul></td>
</table>

<div id="productpics">
<div id="td1">
<div class="diffproducts"style="background: url( 0 0 no-repeat; background-position: center center;"></div><br>
Toolbox for easy reach
</div>

<div id="td2">
<div class="diffproducts"style="background: url( 0 0 no-repeat; background-position: center center;"></div><br>
Deep Steps for footing
</div>

<div id="td3">
<div class="diffproducts"style="background: url( 0 0 no-repeat; background-position: center center;"></div><br>
Light enough to carry
</div>

</div>

</body>
</html>
 

Test the location.href property.
If it contains the string "moreinfo" do something, if not do something else.

vlad
 
This still isn't doing it for me, how is this "static page" "going to" content/moreinfo/, server-side includes?, ajax requests. ? how is it being call ?, I don't see a link to it or an onclick event, how does the user even know there is more info ?, maybe I'm missing something or maybe the code that has been posted is.
 
Its a 3rd party software that take HTML code from our FTP site and placed them in a template, The only part I have control of is the HTML code you see there. I tell the software what template I want, and were the code is, and it places in.

Look at the scoure code
the part about the bar stools is the only part that can be updated, the links on top and the left side are all templates, I can't modify them.
 
Got it thank, everyone

<html>
<head>
<script type="text/javascript">
onload=function(){
var pos = location.href.indexOf('moreinfo');
if (pos < 0) { // Does not contain moreinfo
document.getElementById('compHeader').style.display='block';
} else {
document.getElementById('prodHeader').style.display='block';
}
}
</script>
</head>
<body>
<div id="prodHeader" style="display: none"><h1 class="difftitle">Deep-step Aluminum Ladders</h1></div>
<div id="compHeader" style="display: none"><h2 class="difftitle2">THE FRONTGATE DIFFERENCE!</h2></div>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top