For example:

filename rule:
[field_b_author-title]--([field_b_serie_name-raw]--[field_b_serie_number-raw])--[title].[filefield_paths-ext]

filename result ([field_b_serie_name-raw] and [field_b_serie_number-raw] not empty):
Pol' Ighor'--(Anghiel-khranitiel'--2)--Anghiel-khranitiel' 320.rar

filename result ([field_b_serie_name-raw] and [field_b_serie_number-raw] empty):
Pol' Pol' Ighor'--(--)--Anghiel-khranitiel' 320.rar

But want Pol' Ighor'--Anghiel-khranitiel' 320.rar = need manually check for empty CCK field value

Comments

deciphered’s picture

Status: Active » Closed (won't fix)

I understand what you are asking for and understand the use case, however I don't think it is something that should be directly coded into this particular module.

I would see this as either a feature for the Token module or a standalone module that only handles these conditional/programmatic token rules.

I'm marking this as won't fix, but if there is further work on this in another module I would be more than happy to integrate the functionality if needed.

ipto’s picture

Perhaps the easiest option would add action to replace in the resulting file name (after processing transliteration, token etc.), using the PHP function ereg_replace or str_replace, string $ pattern and the string $ replacement determine interface (ibid. where the rest of the rules of forming the file name).