Page Titles

For english speaking users.

Page Titles

Beitragvon Pezz » 21. Sep 2009, 04:52

Hi everyone,

I need to know is there way to have page titles separate from the "Artikelname" (Article Name) and still keep the link short?

Example as is:
Kategorie: About, Artikelname: Lorem Ipsum = Link: lorem-ipsum.html

I would like to have this:
Kategorie: About, Artikelname: Lorem Ipsum = Link: about.html


I need more freedom with page titles...
Do I have to change the template to get this working?
How to get the page title not from ("name")?

Code: Alles auswählen
<title><?php print $REX['SERVERNAME'].' | '.$this->getValue("name"); ?></title>


Thank you!
Pezz
 
Beiträge: 14
Registriert: 2. Jul 2009, 23:57

Beitragvon michaelKeller » 25. Sep 2009, 13:08

Hi Pezz!

VERY Simple!

Go to the menu: Addons->Meta Infos->Artikel
Here you create a new entry by clicking on the little + Symbol on the upper left corner.
Enter for "column name" (Spaltenname) alternative_title
And press the Submit button on the bottom.

Then go to your used template and change the value:

Code: Alles auswählen
<title><?php print $REX['SERVERNAME'].' | '.$this->getValue("name"); ?></title>


to:

Code: Alles auswählen
<title><?php print $REX['SERVERNAME'].' | '.$this->getValue("art_alternative_title"); ?></title>


Now you can define alternative titles for each article you enter. Therefore go to the "Metadata" Section of your article and enter some title you want in the field art_alternative_title.

Cheers!
Michael
Webdesign aus Rosenheim www.webdesigns-rosenheim.de
Benutzeravatar
michaelKeller
 
Beiträge: 58
Registriert: 28. Jul 2009, 07:49
Wohnort: Rosenheim

Beitragvon Pezz » 3. Nov 2009, 15:56

Hi Michael,

thank you for your help!
For some weird reason I didn't receive an email with your post reply.

Sorry! Not my fault! :D

P.S. Can you tell how to get page/article name before the server name?

Code: Alles auswählen
<title><?php print $REX['SERVERNAME'].' | '.$this->getValue("art_alternative_title"); ?></title>



Pezz
Pezz
 
Beiträge: 14
Registriert: 2. Jul 2009, 23:57

Beitragvon michaelKeller » 3. Nov 2009, 16:24

I don't completely understand your problem. I guess you additionally want your article name before the servername!?
You can get the name of the current article by calling the function getValue("name") on an article object. In whole you can do it this way:

Code: Alles auswählen
<title><?php echo $this->getValue("name").' - '.$REX['SERVERNAME'].' | '.$this->getValue("art_alternative_title"); ?></title>


Take a look at the redaxo cheat sheet. It lists all available member functions.

Regards,
Michael
Webdesign aus Rosenheim www.webdesigns-rosenheim.de
Benutzeravatar
michaelKeller
 
Beiträge: 58
Registriert: 28. Jul 2009, 07:49
Wohnort: Rosenheim

Beitragvon Pezz » 18. Jan 2010, 23:11

Thank you Michael!

Your help is appreciated!!!

P.
Pezz
 
Beiträge: 14
Registriert: 2. Jul 2009, 23:57


Zurück zu We speak english

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast