0

I have configured pathauto to generate URLs for content according to this pattern article/[node:author]/[current-page:title]-[node:nid]. article is a literal input, to reflect the content type description Site Article not token generated.

The content type description is Site Article

The node title is: this is a title

The author's name is: nodecreator

The node id is: 101

When I generate the URL alias using the pattern article/[nodecreator]/[current-page:title]-[node:nid], the resulting path 's article/nodecreator/edit-site-article-this-is-a-title-101. The last section on the URL shouldn't be prefixed by edit-site-article.

What could be the cause?

  • 1
    I would look into node:title instead of current-page:title as I bet what's going on is this is being saved when you are actually editing the node, eg, sitting on node/###/edit and drupal is actually grabbing the title then, eg, when it is actually called edit something or other, and then it is then being saved and being used all the time, eg, when just viewing the node. – Jimajamma Feb 26 '14 at 3:50
  • You are right. You might as well turn your comment into a proper answer – vfclists Feb 26 '14 at 5:23
1

Pathauto creates the alias when a node is being added or edited, so, if you are using current-page:title it will include the title that Drupal generates for that page, eg, in your case, "Edit Site Article: This is a title", and not just the title of the node. So I would look into using node:title instead so as to remove any of those potential prefixings.

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.