By dogboy72 on
By page title I mean <title>My Dynamic Page Title</title>. I would like to populate this with dynamic content from cck fields. Can I call the node variables on my page.tpl.php page? I tried using drupal_set_title on my node page, but it of course also changes my node title which I don't want. I have tried the page title module, but this doesn't solve my "dynamic" desire.
Thanks, and yes I'm a newbie!
Comments
In a word:
In a word: yes!
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
Got it
Thanks for your help
OK ?
Then how? I'm searching for a solution to something similar right now.
Hmmmm looks like something
Hmmmm looks like something got deleted from this thread.
Use drupal_set_title() to set the window title (this will also populate the $title in page.tpl.php, see http://api.drupal.org/api/function/drupal_set_title/5) ... if you are viewing a single node in page view then $node->title is available in page.tpl.php so you can use that or ($node->whatever) as your h1 or h2 heading ...
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
A different approach.
I have products that each have their own node. I want the page title to have content describing that unique product. So here's what I did.
Since we manufacture wedding gowns I set up a new content type called "Gown". I used cck to create fields that describe the gown (Fabric, Silhouette, Neckline etc.) Next I created a custom page template for this content type:" page-gown.tpl.php" In the head of that page I load and write the variables that describe that gown:
Notice I left the normal head title so that the final result is, for example:
French Lace, V-Neck, A-Line - Alexandra | Designer Wedding Dresses | My Company Name
The first three items the cck fields I have loaded. The rest is what drupal creates: "Alexandra" is the node title and the name of the gown. The rest is the name of my website.
I know there are other ways to do this, but I found this to be the best for my situation. Good luck!