Please use entity tokens instead of just node tokens.
FileField Paths code:

<?php
      $entity_info
= entity_get_info($form['#instance']['entity_type']);

     
// Replacement patterns for field.
     
$field_data['form_path']['token_tree'] = array(
       
'#type' => 'fieldset',
       
'#title' => t('Replacement patterns'),
       
'#collapsible' => TRUE,
       
'#collapsed' => TRUE,
       
'#description' => theme('token_tree', array('token_types' => array('file', $entity_info['token type']))),
       
'#weight' => 10,
      );
?>
Files: 

Comments

eosrei’s picture

Category:bug» feature

I'll look into this soon. Thanks

eosrei’s picture

Project:Image attribute defaults» ImageField Tokens
Version:» 7.x-1.x-dev
Assigned:Unassigned» eosrei

Code has moved to ImageField Tokens 7.x, moving issues also.

dberror’s picture

Priority:Normal» Major
Issue summary:View changes

Any progress on this issue?

dberror’s picture

Assigned:eosrei» Unassigned
Status:Active» Needs review
StatusFileSize
new3.66 KB

Marked #1937040: Taxonomy term tokens are not provided as duplicate of this issue.

Please test attached patch.

I think we also need to add dependencies on Token and Entity modules in imagefield_tokens.info:

dependencies[] = token
dependencies[] = entity

and then remove calls of module_exists().
But I think it should be done in another issue.

Anybody’s picture

Looks and works great. Any further progress on this?

interdruper’s picture

Status:Needs review» Reviewed & tested by the community

#4 works great for me.