Jump to content

Recommended Posts

Hi all,

 

looking for suggestion on the best way to create unique title tags within a templated system.  In other words, I have a standard header, footer, left nav, for each of the pages I create.  Works extremely well.  The only problem is that the title tag in the header is the same for every page. Suggestions or thoughts as to how make each page have a unique title tag would be great.

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/74474-dynamic-title-tags-within-a-template/
Share on other sites

Well that rather depends on how you are doing things at present. There are many ways to achieve a consistant look to your page so its rather difficult to guess how you're doing things.

 

If, as i would guess, you are including various files in each of your pages, you could defined a $title variable before you include the header, echoing this variable in your header page.

 

If this isn't how you are doin things, then perhaps you could post a sample page.

Hi GingerRobot,

 

thanks for the response.  As you guessed I have something like the following:

<?php include("nav/header/header.php"); ?>

 

  <div> Content Here </div>

   

<?php include("nav/footer/footer.php"); ?>

 

I've looked at a couple of different methods basically using define <?php define ('TITLE', 'Page Title Here'); and then  calling the define in the header.  Seems like what you suggestion is basically doing the same thing.

 

Forgive my ignorance, I'm new to php.  But I'm not sure how to echo or get the title tag to show up in the header.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.