I have a cck text field which I do not wish to display when viewing the node, however I do want the value to be part of the URL using pathauto. To achieve this, I set the field display to and used [field_myfield] in the pathauto configuration. This ended up giving urls like nodetype-nnn. I found the following in content_pathauto.inc on line 49:
$results['['. $field['field_name'] .']'] = pathauto_cleanstring(strip_tags($items[0]['view']));
So the problem seems to be that the module is just using the 'view' component of the field. The automatic nodetitles module allows the user to choose between the formatted and raw values. I think a similar functionality would be beneficial for cck pathauto as well. If there is interest in this feature, I could make a patch and submit it for review.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | cck_172127.patch | 2.33 KB | drewish |
| #7 | content_token_remove.patch | 2.19 KB | quicksketch |
| #1 | deprecated_pathautoapisupport_2_token_support.diff | 761 bytes | schuyler1d |
| #1 | content_token.inc_.patch | 9.29 KB | schuyler1d |
Comments
Comment #1
schuyler1d commentedcontent_pathauto.inc calls hook_pathauto_node() which is no longer used.
This should be replaced with the file:
token/token_cck.inc
which implements the new hookd:
hook_token_list()
hook_token_values()
The issue for this module is in line 10 of token/token_cck.inc which calls content_view().
Below is a patch to replace token/token_cck.inc with content_pathauto.inc
Obviously, this will depend on token module removing the same file.
(note: patch doesn't solve the reported problem, but is required before going forward)
add file content_token.inc
remove file content_pathauto.inc
and apply the first patch to content.module
Comment #2
karens commentedI double-checked with greggles and confirmed that we do not need the content_pathauto.inc file in the D6 version and that it would make sense to add a content_token.inc to CCK instead of in the Token module. Once all of that is done, we have control of how the tokens are handled and we can make any other changes that are needed.
I am committing the removal of content_pathauto.inc and adding in content_token.inc.
Comment #3
gregglesSubscribe so I can know when to remove the token support.
Thanks karens and schuyler1d.
Comment #4
gregglesSo, based on this I guess some of this is "fixed" and I can remove the token_cck?
Comment #5
schuyler1d commentedI believe KarenS only copied in the core cck support, so imagefield and link still need support, until these are resolved:
http://drupal.org/node/231339
http://drupal.org/node/231335
Comment #6
drewish commentedwell since imagefield and link don't have official 6.x releases, i'd say it's safe to pull it from core and those modules can add it when they do their update.
Comment #7
quicksketchI've ported Link to Drupal 6. I think it'd make sense for me to include this in link.module directly rather than have it be part of CCK. To keep a lot of people from experiencing duplicate function errors, could you remove the link (and imagefield) token support? I'll add them into the respective modules once it's taken out of CCK. Thanks!
Comment #8
drewish commentedre-rolled for HEAD. this is an easy commit, and once it's in we can move them to the respective modules.
Comment #9
karens commentedSorry! This was not supposed to have gotten in there in the first place, but it's (finally!) removed. At least I got it out before we roll an alpha release :)
Comment #10
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.