Hello all!
I'm creating a database of musicians, and each musician will have a couple of pages (abstract, biography, gallery, news). My plan is have some different views per artist, and show only the information I need:
/artists/name-of-the-artist -> abstract /artists/name-of-the-artist/biography -> biography
and so on.
My doubt here is defining the argument of the view. I don't find an option in the arguments that define the url "name-of-the-artist". What can I do to solve this?. If I could parse the url, I could extract the "name-of-the-artist" and convert it to a nid, for example.
Thanks in advance, Carlos.
Carlos Costa ha scritto:
If I could parse the url, I could extract the "name-of-the-artist" and convert it to a nid, for example.
I think that you can. Try this (i'm have not a Drupal site in my hand now)
Edit your view and "add arguments", chouse Node: nid, chouse "Provide default argument", chouse "PHP Code" (in "Provide default argument options" fieldset). Now if your url is "
/artists/name-of-the-artist/biography" than:
arg(0): artists arg(1): name-of-the-artist arg(2): biografy (and so on...)
Now with your PHP code retrive nid from "name-of-the-artist" arg(1) and put "return $nid" (where $nid is your node nid variable). Example
[CODE] $nid = function_that_retrieve_nid(arg(1)); return $nid; [/CODE]
Try this.
M.