Asset builder create location rules not being very discriminating


(Ben Chapman) #1

I have created an asset builder for uploading pdf newsletters. Links to the newsletters are displayed by a grouped asset listing based on the folder they are stored in. So I need the asset builder to create the newsletter pdfs in the appropriate folder, i.e. the newsletter titled March 2016 should be created in the 2016 folder.

 

I have set up ‘create location rules’ for the asset builder, three of them:

 

If all these conditions are true...
Title contains 2015
...link the asset to all these locations:
2015
 
If all these conditions are true...
Title contains 2016
...link the asset to all these locations:
2016
 
If all these conditions are true...
Title contains 2017
...link the asset to all these locations:
2017
 
However, the asset builder then goes ahead and creates the pdf asset (title ‘March 2016’) in all three of the folders. It does the same if I use ‘Name’ rather than ‘Title’.
 
Am I doing something wrong.
 
Matrix v. 5.2.3.0

(Bart Banda) #2

Not sure, what does you create locations screen look like?

 

The way I've done it in the past is to use a dynamic value from a keyword in the Additional Create Locations section (see attached).

 

So I basically do a condition on the POST var that holds the name and if it contains a certain word, I can set a specific folder. 

 

%globals_post_data_record_0_403^contains:2015:15848% Capture.JPG (42 KB)


(Ben Chapman) #3

Not sure, what does you create locations screen look like?

 

The way I've done it in the past is to use a dynamic value from a keyword in the Additional Create Locations section (see attached).

 

So I basically do a condition on the POST var that holds the name and if it contains a certain word, I can set a specific folder. 

 

%globals_post_data_record_0_403^contains:2015:15848%

 

Hi Bart.

 

I'll include a screenshot of my rules.

 

I would have thought it was pretty straightforward. In fact, I have used the same technique on another website and it was working really well. But I recently updated the website so that it can take 2016's newsletters and I am finding that it too is not working. When I visited the ‘Create locations’ screen for the asset listing on that website I noticed a bunch of PHP warnings that mentioned ‘contains’, but I didn't pay that much attention to them and now I don't see the warning when I visit the page. Also, all the ‘contains’ had changed to ‘equals’ for that asset listing. Makes me wonder if there is a bug.

 

[attachment=809:screenshot-www nzord org nz 2016-05-16 12-59-37.png]

screenshot-www nzord org nz 2016-05-16 12-59-37.png (69.1 KB)

(Bart Banda) #4

Yea might be a bug, never use those dynamic rules myself so never seen an issue with them before. Might be worth sending in a support ticket to Squiz if you are a client so that they can investigate further, or use a different condition rule as a workaround.