I'm trying to create a custom pattern for my URL aliases for a custom content type.

I have Token, Pathauto and Views installed.

I want to create an archive of events like this video demonstrates for Drupal 6 using Blogs http://drupal.org/node/247205.

I want my auto URL for posted events to be like website.com/events/01/05/2011/name-of-event

However I want the date information to be taken from a custom date field that the user populates whilst creating the content.

I have attempted something like this: events/[node:field_date:d]/[node:field_date:m]/[node:field_date:Y]/[node:title]

The following error is displayed: The Pattern for all Upcoming Events paths is using the following invalid tokens: [node:field_date:d], [node:field_date:m], [node:field_date:Y].

Perhaps this is not possible, but I find it strange that you can use the node title and even node description but not a custom field for a content type.

Any alternative method for creating an automatic archive of storing event information by year and month would be appreciated.

Comments

You don't mention installing the Date module, which would define the date tokens. I don't know the current status, but you should check out #906622: Cleanup the token code for more information.

The PathAuto configuration screen for Automated URL Aliases provides a list of available tokens for your pattern. So, you can click on the token name to insert it in your patterns. You may need to expand the Field values for Date using the arrow next to the name.

Scott

Thanks, I understand all of that, but what I required was being able to insert a token of a custom date field I created using the Date module. Unfortunately the link the previous poster provided seems to support my initial conclusion of that ability not being possible out of the box.

What I am trying to achieve is an archive whereby the years are displayed on a page and then within them are the months, and inside that are the all the relevant events. I can't use the standard date token as the date I want to filter them by is in putted by the user.

I'm looking for the same thing. I have events that I want to provide an auto URL alias for. But the dates are not showing up in replacement patterns.

Any luck?

@Scott, can the URL replacement pattern have dynamic/variable depth of branches, based upon how deep in taxonomy a term is?

I am looking for this functionality also. Currently the path can use:

diary/[node:field_event_date]/[node:title]

but this causes a problem if you have times and start and end dates as the title becomes:

diary/repeats-every-0-days-tuesday-11-october-2011-830pm-1030pm/test-event-next-month

I just want to use the standard diary/yyyy-mm-dd/title format but it's not an option in the patterns and using [node:field_event_date:custom:'Y'] causes an error.

This is addressed in #1103032: Re-Add Field Token Support. Smarter people than me are working on it.

I am looking for the same. adding custom field values works perfect on D6, but could not figure it out on D7. I am looking for events as well, but I don't need to include date in the URL, just to include a custom field value is what I am looking for.

Thanks & Regards,
AnAnD | Drupal | Photographer @ MCS | Facebook | Twitter

Got it working by updating my site's core, and token module to latest

Thanks & Regards,
AnAnD | Drupal | Photographer @ MCS | Facebook | Twitter

For others looking for a solution: I finally pushed Pathauto to generate the URLs mit the date with this snippet: [node:field-date:value:custom:Y-m-d]

Combinations of it, like [node:field-date:value:custom:Y]/[node:field-date:value:custom:m]/[node:field-date:value:custom:d] also work.

@traveller

Are you using recent versions of Token and Date modules?

Edit: I later found out that the tokens mentioned in the previous post were provided by the Entity Tokens module. There is some debate in #1103032: Re-Add Field Token Support as to whether or not to use this method, take a look and decide what works for you.

as long as this is still not fixed I found a work around:

using display suite and view modes: (not sure if display suite is needed)

  1. create a new date format (/admin/config/regional/date-time/formats) and date type (/admin/config/regional/date-time)
  2. create a token view mode for your content type
  3. edit the rendering for the date field on the Token view mode to use your new date type style
  4. use token as usual [node:field_date]

follow me on Twitter: https://twitter.com/ABaumeier

Thanks, this works for me!

Maybe of interest: I don't use display suite so it's not required for this solution.