0

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

%site:url%node:tax-title-for-url-construction

"%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:

<?php
$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;
?>
2
  • 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
    Commented Sep 25, 2013 at 8:06
  • Post it as a self-answer then, and let's forget about this case ;)
    – Mołot
    Commented Sep 25, 2013 at 8:13

1 Answer 1

0

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 and acknowledge you have read our privacy policy.

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