By dreadfulcode on
So far I've learned that arg(0), arg(1), arg(2)...etc pulls the argument from the system path,
But
what are the variables for arguments from a path that has been aliased?
example:
I have an aliased path: http://localhost/content-type/title/state-province
How do I pull the state-province from the Url and include it in a dynamic link that is inside a block or panel.
Best practice, I mean.
What is the Drupal way for using arguments from an aliased path?
Comments
.
Something like this:
YES! Details later.
YES!
Details later.
It worked for me too, thank
It worked for me too, thank you!
Subscribing
Good timing, thank you. Now to figure out where to put this.
.
Snippets with code like this are used very often,
- in the visibility settings of blocks (after enabling the "php filter"), to make them appear on certain pages.
- in a theme's .tpl.php files or in template.php (for example http://drupal.org/node/139766)
Thank you, yes I figured it
Thank you, yes I figured it out.
This is a very helpful code snippet
And a great workaround for the time consuming task of creating custom modules. You can create dynamic custom links, which is what most modules basically do anyway.
Follow this thread, as I will post examples of what you can do with this amazing feature.
Does anybody have any good book page/ forum thread links that have other code snippets such as this-- as in: code snippets you just can't live without?
Pulling arguments using the field default
This is what helped me.
http://drupal.org/node/126776#comment-3460726