Views Dynamic title

tristanmatthews - March 17, 2009 - 20:52

Hi all,

So I feel like this should be really easy to do, or at least I did when I started trying hours ago, but I may be wrong.

So I have a view the displays a recipe that a user has entered. Is there a way to set the Basic Setting: Title to be the Node: Title?

I think I'm just not seeing where this is set and the header is built.

Thanks,
Tristan

Are you saying a single

nevets - March 17, 2009 - 21:40

Are you saying a single recipe? Why not just display at node/{nid} where {nid} is the node id?

Titles

mcfilms - March 17, 2009 - 22:19

I think (and I'm just THINKING here) that setting the Title in Basic Settings: Title Gives you a fixed title. You could name it "Recipes" and if you print 10 recipes, this would be the header. If you are trying to get 10 recipes and each one to have the dynamic title, you might want to include the Node: Title as a field -- along with whatever else you are displaying. So each of the 10 would be Titled"Spinach Pie" "Beef Stew" etc.

Capiche?

Kind of

tristanmatthews - March 18, 2009 - 00:49

So I have the node title field included, but I can't see how to set the basic setting of title to the value of the field for each recipe. So I can call it Recipes and they are all called that, and then do a title under it with "spinach pie", but I feel like it would be much cleaner if I could set the title to the node title for all of them. That way you not only "spinach pie" on the page, but as the page title and so forth.

One more thing

mcfilms - March 18, 2009 - 01:16

One more thing that might help....

The default display in views is just a node. Look along the left edge of the window and add or see if there is a "Page" view. You may only be looking at the node view. (I don't know how much I am helping as I am a Views novice myself.)

Nope, its a page

tristanmatthews - March 18, 2009 - 02:07

Thanks mcfilms, but its a page already.

A lot of the fields can do things with string replace like use [title] to insert the title, but that doesn't seem to work with the basic settings, so who know. I'm sure I'll figure it out...

It really seems like you want

nevets - March 18, 2009 - 02:15

It really seems like you want to list nodes not fields.

That said, if you add "Node: title" as a field it displays the label (Title by default) and the title for the current node so am no sure what "So I can call it Recipes and they are all called that, and then do a title under it with "spinach pie"," refers to.

As for "That way you not only "spinach pie" on the page, but as the page title and so forth." once again it sounds like you are trying to display a single node (not a list) in which case using the nodes path may be more appropriate.

Node Path

tristanmatthews - March 18, 2009 - 03:09

Hi Nevets,

Thanks for the replay, and yes I am just displaying a single node worth of data, but I'm using a some of views features for the display, and what fields are shown. Since I have a number of ways to look at each recipe based on who you are and how you get there this seemed like the easiest thing to do.

So when I set the basic settings title it displays at the top of the main content part of the page, in the title tag, in the header, and in the bread crumbs trail. It looks like there was a "not to bad" way to do set the title tag, and bread crumbs with views 1, but I can't figure out how to do it in views 2, with out using the basic settings.

Why not use CCK permissions

nevets - March 18, 2009 - 03:43

Why not use CCK permissions to determine who can view what fields and/or theming in node-{content_type}.tpl.php (replace {content_type} with your content type), this seems easier to me.

To each his own...

tristanmatthews - March 18, 2009 - 04:06

Besides, I can think of an number of other reason I would want to be able to do this, so...

I think he meant html page

amfis - May 7, 2009 - 13:21

I think he meant html page title.

I'm rather late for you...lol

MjrNuT - October 23, 2009 - 22:59

But this is what I followed to accomplish exactly what you are talking about.

http://www.davidnewkerk.com/book/18

I just replaced the word Articles with Recipes

Now I'm trying to take it a step further, which looks like others are interested as well: http://drupal.org/node/612468

Dynamic Views Page Title

yevonsoul - May 22, 2009 - 01:59

I don't know if this is the right one but I think we share the same problem. I have a view that has a static title. I also have a taxonomy term which is based on views. What I want, is when I click on the taxonomy term I would also get that taxonomy term as the title on the page view.

How can I do this?

looking for the same

betz - July 4, 2009 - 23:29

looking for the same

Subscribing

nrussell - October 23, 2009 - 22:19

Subscribing

me too! This shouldn't be too

arski - October 31, 2009 - 23:13

me too! This shouldn't be too hard given that it's possible to use the replacements like [fieldname] almost everywhere else.. then why not in the title.

Thanks!

subscribing

dougvann - November 6, 2009 - 12:49

subscribing
I'm looking in to some custom code to get this done.

See you at the The Do It With Drupal Seminar
Learn from the Lullabot Drupal Video Series

 
 

Drupal is a registered trademark of Dries Buytaert.