Webmaster Key - Discussion Forums


Welcome, Guest. Please login or register.
Did you miss your activation email?
February 09, 2012, 06:56:01 PM

Login with username, password and session length
Welceome to Forums!

Important information for guests and new members:

In order to understand the full benefits of becoming an active member of this forum, please review the following information on guest and new member restrictions. These forum changes have been prompted by an overwhelming and unreasonable amount of bot postings and incoherent guest spam messages. We wish to prevent these events from happening in the future and make our community a more comfortable place for all of our members.

For guests:

Guests are not allowed to open new topics, polls, or posts attachments.
If you wish to open up new discussions on this forum, we encourage you to register.

For new members:

New members with less than five posts are not allowed to modify additional profile information such as avatars, contact information, biographies, and signatures. However, new members are encouraged to post their own topics or reply to topics initiated by other members. Become active on the forums and 5 posts should be an easy task!

We are a diverse community with members from all over the world. We encourage new ideas and interesting conversation. Do not be afraid to post webmaster/computer-related questions or problems, as our active members are always willing to help when they are able. Interested? Join us.

+ Webmaster Key Forums
|-+ Webmaster Corner
| |-+ Site Design and Web Authoring
| | |-+ Coding Talk
| | | |-+ Is this possible? (automated browser title)
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Stumble Upon! Digg It! del.icio.us! Add to Technorati! ReddIt!  Send this topic Print
Author Topic: Is this possible? (automated browser title)  (Read 2785 times)
Mosqwik
Limited Member

Posts: 1


« on: September 21, 2007, 08:06:32 PM »

Hi,
Something that would be really useful for a new project im working on would be to have automated browser titles using some php code in the <title> tags.
The only way I can think of doing this is by having the php code read the url im using for navigation, e.g. /windows/atari2600/ and use that data, edit it and have it display as 'Windows > Atari 2600'
Has this kind of thing been done before? are there any other common ways of doing this? Also are there any tutorials around?
Thanks!
Report to moderator   Logged
Manu
Key Keeper
Sr. Member
****
Posts: 437


« Reply #1 on: September 22, 2007, 09:14:40 PM »

This is definitely possible.

This is done in php but I do not know the exact code used to do this.


Report to moderator   Logged
SensoVision
Administrator
Veteran
*****
Posts: 5 857


I'm proud user of Debian GNU/Linux OS


WWW
« Reply #2 on: September 23, 2007, 03:20:44 PM »

Hi Mosqwik! Sorry for delay in reply. Manu is right, this kind of coding is constantly done on PHP.
You can encode URL into title like this
Code:
$url = "/windows/atari2600/";
$title=str_replace(" /", " ", $url); //replacing all slashes with spaces
$titleU=ucwords($title); //convert first letter of each word to uppercase
This code would replace slashes from URL with spaces so $title variable would contain:"windows atari2600".
and $titleU: "Windows Atari2600".

Later you can use one of these variables for creating page title, although if site is dynamical and driven by database than it's better to have titles and description of pages in database itself and retrieve them when needed, this way you don't have to write bulky code to describe all possible situations when and how you need to split words and can use custom titles not tying them to URL. Also having many directories on the site isn't good idea anyway...

Let me know if this is what you where looking for.
« Last Edit: September 23, 2007, 03:26:50 PM by SensoVision » Report to moderator   Logged

Denis
Menard
Key Keeper
Veteran
*****
Posts: 965



WWW
« Reply #3 on: October 07, 2007, 05:33:30 PM »

I just came across this free script called Random Title Pro which may offer an option for what you want to do.

http://www.phpgear.net/titlef
Report to moderator   Logged

Pages: [1] Go Up Stumble Upon! Digg It! del.icio.us! Add to Technorati! ReddIt!  Send this topic Print 
+ Webmaster Key Forums
|-+ Webmaster Corner
| |-+ Site Design and Web Authoring
| | |-+ Coding Talk
| | | |-+ Is this possible? (automated browser title)

Jump to:  
« previous next »


Our Partners
RelmaxTOP Ranking System Web Hosting RelmaxTOP Ranking System
Staff Sites
12Noon[12Noon Gallery] Andy[Urgentclick]
Tamuril[Tamuril's Digital Art Exhibit] Sensovision
Powered by MySQL Powered by PHP We are hosted by Relmax Inc. |Our Privacy Policy | Sitemap
Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC
Forum design by Tamuril © 2005.
Valid XHTML 1.0! Valid CSS!