Jump to content

Seperate HTML and Navigation Title


Qantas94Heavy
 Share

Recommended Posts

I attempted to search the forums for my request, however was not able to find this simple request.  One of the things I'd like is for HTML titles (the one you place in <title></title> tags) to be able to be editable from the admin interface without changing the text shown in the navigation bar.  A basic example would be on the homepage of a site - you want the navigation bar to say "Home", the <title> property being "Welcome" and your headline being "Start Your Journey!", or something similar.  Currently I add this directly using PHP's echo, however if there was a faster, less cumbersome way to do so it would be much appreciated.  Thanks!

Link to comment
Share on other sites

Hi,

Welcome to the forums.

You might need to setup an extra field, for example: alt_title - for your HTML titles

<title><? echo $page->alt_title; ?></title>

If your alt_title field is empty - you might not need it on every page - you can just output the page title instead:

<title>
<?
	if($page->alt_title) {
		echo $page->alt_title;
	} else {
		echo $page->title;
	};
?>
</title>

I hope I've understood your question.

Regards

Marty

  • Like 2
Link to comment
Share on other sites

Thanks for the quick reply.  :)  That's exactly what I was looking for, didn't know it would be so simple.  Also is it normal that if you click "view" without clicking the save button first, that you lose all of your edited work?

Hi,

Welcome to the forums.

You might need to setup an extra field, for example: alt_title - for your HTML titles

<title><? echo $page->alt_title; ?></title>

If your alt_title field is empty - you might not need it on every page - you can just output the page title instead:

<title>
<?
	if($page->alt_title) {
		echo $page->alt_title;
	} else {
		echo $page->title;
	};
?>
</title>

I hope I've understood your question.

Regards

Marty

Link to comment
Share on other sites

Hi and welcome!

<title>
<?
	if($page->alt_title) {
		echo $page->alt_title;
	} else {
		echo $page->title;
	};
?>
</title>

I like the short version of this:

<title><?php echo $page->get('alt_title|title');?></title>

You may let PW do the work for you :)

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...