What is the best practice to get the current path of a page. I need this for a cannonical tag and to make my page title clickable.

I started with a combination of $node->url and drupal_lookup_path . I get an error that says that node is missing, even though the variable does exist and is tested with isset. Obviously this is not the way to go.

What is best practice?

Comments

zbricoleur’s picture

Not sure what's best practice, but if $_GET['q'] gives you what you need I see no reason not to use it.