By Ankabout on
Hey,
I've got a view page set up that takes the nid from the URL as an argument to filter all the nodes on the page. The nid comes from a node reference field of the nodes being displayed.
It works when I use it like that eg. (projects/contributors/42).
How can I get it to work by using the Node Title instead of the nid? (projects/contributors/ankabout)
Any ideas would be great thanks.
Comments
Oh, are you using the %? How
Oh, are you using the %? How about trying Views -> Arguments -> NID -> Action to take if argument is not present: -> Provide default argument -> Node ID from URL . It pulls the NID even if you have nice URLs enabled. You can also choose title as the argument.
I tried, but it's not working
I am using node reference in the view > arguments, but there is no option for getting the title, just a node id from url in the provide arguments section, is there a work around to receive the node title as and argument?
Same thing
I am trying to get the same exact setup, did you figure out how to accomplish this? When using the title i dont want it to redirect to the NID, but to stay as the title and show all nodes that reference that nodes title.
Just wondering if anyone has
Just wondering if anyone has had any luck with this?
Thanks
Andrew
-------------------
www.hoffi.com
still wondering
still wondering if anyone comes up with solution
Subscribing
Looking for the same possibility, must be something in PHP snippets, but since I am not a programmer, I would not know how to do that...
Tools for Research
http://www.toolsforresearch.com (international)
http://www.kleinestappen.nl (NL)
All using open source software: Drupal, Limesurvey
Probably i haven't understood
Probably i haven't understood properly but why don't you try to pass the argument on tpl.php?
print views_embed_view("your_view", "your_display", $node->title);
still not getting it
how to use the views argument to receive the title and get the content we need?
Argument = Node:Title Display
Argument = Node:Title
Display all values;
on node-yourcontent.tpl.php write
print views_embed_view("your_view", "your_display", $node->title);
ah nice one!
let me try that and get back on you, thank you very much :)
I created a tiny module to
I created a tiny module to solve this in modern Drupal: https://www.drupal.org/project/views_argument_default_node_title_from_url
http://www.DROWL.de || Professionelle Drupal Lösungen aus Ostwestfalen-Lippe (OWL)
http://www.webks.de || webks: websolutions kept simple - Webbasierte Lösungen die einfach überzeugen!
http://www.drupal-theming.com || Individuelle Responsive Themes