I added in the link path field for a breadcrumb the following:


"%node:tax-title-for-url-construction" is a custom token which returns a taxonomy title like "Xbox 360" in a cleaner way "xbox-360".

So the links should look like http://domain.com/xbox-360 but it return the following http://domain.com/ xbox-360 Note the space between site url and tax title, but there is no space in the link path field within the breadcrumbs configuration. So where does this space come from?

Here is the code from my custom token:

$node = node_load(arg(1));
$rtaxidarray = field_get_items('node', $node, 'field_plattform');
$rtaxid = $rtaxidarray[0]["tid"];    // taxid sauber
$term = taxonomy_term_load($rtaxid);
$name = $term->name;
$small = strtolower($name);
$clean = str_replace(" ", "-", $small);
return $clean;
  • Does this space shows in dpr($clean)? If not, does it appears when you use your tokens in other places than Path Breadcrumbs? If not, it might be a module's bug. Or maybe it's %site:url that returns that space, have you tested that? – Mołot Sep 25 '13 at 8:06
  • Post it as a self-answer then, and let's forget about this case ;) – Mołot Sep 25 '13 at 8:13

HM There was a space before the opening php tag in the custom token value field, I really hate spaces. I think spaces should be exchanged with a X ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.