0
votes

I am having a drupal 7 node about software releases. The title field of the release is "Release v6-05-01"

I need to construct a URL based on this title that goes like this http://example.com/html605/Class.html

I know hot to construct the URL but the "605" bit is tricky because I have no token for it. I thought that maybe I could take the characters from the title one by one? Is this possible in Drupal 7?

1

1 Answers

0
votes

One solution could be to add a new field (eg "version number", text field) to your content type to hold the "605" string, and then use this token (typically : [node:field_version_number]) to construct your URL. But you'll have one more field to manage when creating new nodes, and maybe a lot of work to process existing nodes.

Depending on how this number is constructed from the node title, you could try using Computed Field or Dynamic Field, and create a PHP computed field. In PHP you could build the version number with some substr logic based on the node title (its value is available in the PHP snippet). This way you don't have to fill the new field for each new node and existing nodes should be automatically updated.

Good luck