I was just working on a site that uses two url aliases for a couple of nodes. This happens because if the node is viewed in one context it would require a different styling. These different contexts are being controlled with the url alias. /about for the normal site and /iframe/about (for example. we are not using iframes).

Currently the path (as used in the body classes) are being generated with a call to drupal_get_path_alias. This doesn't get the actual path that is currently being viewed.

Proposed Solution:
Use request_uri to get the actual path that is being requested.

Patch to follow.

#1 put-actual-path-in-body-class-1835078-1.patch784 bytesfrob
Members fund testing for the Drupal project. Drupal Association Learn more


frob’s picture

Status: Active » Needs review
784 bytes

Here is the patch.

JohnAlbin’s picture

Status: Needs review » Needs work

Using the PHP function request_uri() isn't going to play well with other modules that manipulate the path, like the internationalization module, path alias, etc.

I'm tempted to won't fix this since it is such an edge case. But I'll leave it open to see what comes up.

JohnAlbin’s picture

Issue summary: View changes
Status: Needs work » Closed (works as designed)