Closed (won't fix)
Project:
Pathauto
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
17 Jul 2020 at 09:49 UTC
Updated:
1 Apr 2026 at 09:22 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
netsliverSorry I move this issue on pathauto
Comment #3
berdirMight be easier to just implement your own token that does that, you just need to duplicate the hooks in pathauto.tokens.inc or find a way to pass it through your token on to join-path, e.g. parents:offset:1:join-path
Seems to specific for a generic feature unless others are interested too.
Comment #4
netsliverPath attached :)
Comment #5
netsliverProblem with my patch, the slash / is removed from the replacement although there is the implode!?!?
Comment #6
berdirpathauto has a setting to control which token-parts indicate a URL-safe token, you need to extend that.
Comment #7
netsliverOk with the safe-token updated it works!
Comment #8
netsliverYes I thought of the parameter just after ... I posted too quickly
Comment #9
netsliverpatch with last dev version which replace render by service renderer
Comment #10
berdirthis assumes that there's only a single token.
I'm not sure this is the best approach, nor whether this needs to be in this module.
I would probably implement this as a chained token, which will _not_ require config changes, something like this:
[node:something-that-returns-an-array:shift:join-path] (after array_shift()).
That avoids the need for a second dynamic argument, and if you need to cut off more than one you can chain it: shift:shift:join-path. Far simpler to implement.
You could implement such a token in a custom module. For it to live in pathauto or token, it will require test coverage.
Comment #11
paul_serval commentedReroll patch
Comment #12
mably commentedComment #14
paul_serval commentedReroll patch