Hey guys,
Sorry for inundating your inboxes - I've searched google and the drupal site was unable to come up with an answer.
I've downloaded the Token & PathAuto module and am currently attempting to customize the path pattern for a content type. This content type has a date range that I'd like to use when creating the path pattern... a single date has replacement pattern options that allows the user me to get the Year, Month, and Day so teh path pattern looks like something like "/2012/05/04/content-name".
However, no such options exist for date ranges - I'm contemplating attempting to write a little custom code to create a token that gets the first date in the date range and return the year, another token that gets the month, etc. If you any of you has a simple solution, that you could let me in on, that would be awesome.
Thanks again and again, my apologies for sending a lot of emails.
Kurt
Comments
How I solved this problem (sorta)
Hey guys,
So I solved my problem - sort of. IMO, it's messy and there's probably a better way of doing it, but it works. Hopefully some of you codemonkeys can point out any glaring flaws/security issues contained in this post, including whether or not to post snippets of php code. Listed below are the steps I took in solving this problem:
<?php
global $performance_date_year;
$entity_id = arg(1);
$yearSQL = "SELECT field_performance_date_value FROM field_data_field_performance_date WHERE entity_id=:entity_id";
$yearResult = db_query($yearSQL, array(':entity_id' => $entity_id));
foreach($yearResult as $yearRow) {
$performance_date_year = $yearRow->field_performance_date_value;
}
return $performance_date_year;
?>
<?php$performance_date_year = substr($performance_date_year, 0, 4);
?>
<?php$performance_date_day = substr($performance_date_day, 8, 2);
$performance_date_day = intval($performance_date_day)-1;
$performance_date_day = strval($performance_date_day);
?>
Anyway, my apologies for the long post. I created this post for several reasons - to help out other Drupal site builders who are experiencing this problem and to get feedback from the coders and site builders of San Diego's Drupal community.
Thanks guys,
Kurt
Timezones
For your day offset issue I'd look into UTF vs. PST time zones. The time value in the URL seems to be 3:00 am of the next day, i.e. 7h offset from your PDT event.
Can't really comment on the rest.
--
Christoph Weber