0

I have an image field type configured to accept an unlimited number of values.

Using the File (Field) Paths module I have set the file name field value to [node:title].[file:ffp-extension-original]

This is fine if you upload one image because it is renamed to my_node_title.jpg for example.

If you upload several images, they are renamed to my_node_title.jpg, my_node_title_0.jpg, my_node_title_1.jpg, my_node_title_2.jpg and so on.

Is there a token I could use or create that would allow me to add a serial value rather than the default _0, _1, _2? For example my_node_title_a.jpg, my_node_title_b.jpg, my_node_title_c.jpg etc.

I'm looking at the Custom Tokens module at the moment but not having much success.

1

The problem is it starts from 0, isn't it?

If you use that for your path: [node:title]_a.[file:ffp-extension-original]

  • my_node_title_a0.jpg
  • my_node_title_a1.jpg
  • my_node_title_a2.jpg


OR

You can use the [file:original:fid] pattern, it gives serial values but the fid increments for all the nodes, not for each nodes. I mean, if you upload 10 images to your first node and then for your second node if you upload 3 images, second node's images' names are as below:

  • my_node_title_a11.jpg
  • my_node_title_a12.jpg
  • my_node_title_a13.jpg
  • Thanks, I shouldn't have used numbers so for clarity I have amended the question. – Stephen Wilson Nov 20 '14 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.