I wish to create a list from the multiple media picker.
Firstly, I select which media items I wish to relate to my page, then create a list of the selected media items. Each media item has a property called "business" which has a value from a dropdown datatype.
So some of the media items in my list will share the same "business" value. I want remove all duplicates within the list that share the same "business" value.
Are you using the Multi-Node Tree PIcker in Media mode for the "multiple media picker" or are you maybe using the DAMP picker?
DAMP can save the Media XML, which would make it easier to select based on the business property without having to query the GetMedia() extension for every media item...
Remove duplicates from for-each list
I wish to create a list from the multiple media picker.
Firstly, I select which media items I wish to relate to my page, then create a list of the selected media items. Each media item has a property called "business" which has a value from a dropdown datatype.
So some of the media items in my list will share the same "business" value. I want remove all duplicates within the list that share the same "business" value.
I've tried using the following example: http://www.dpawson.co.uk/xsl/sect2/N2696.html
Manipulating it for my list, but without any success so far. Can someone help me out?
Hi JV,
Are you using the Multi-Node Tree PIcker in Media mode for the "multiple media picker" or are you maybe using the DAMP picker?
DAMP can save the Media XML, which would make it easier to select based on the
business
property without having to query theGetMedia()
extension for every media item.../Chriztian
Hi Chriztian,
I'm using the Multi media picker in 7.0.3
Which unfortunately DAMP and uComponents (Multi-Node Tree Picker) aren't available for the Umbraco 7 yet.
Any other ideas?
Cheers, JV
Okay - that one stores a CSV list of IDs, right?
Is that what
$vArr2
refers to? Did you alreadySplit()
the CSV list into nodes?You should be able to do something like this (you need to change the PICKER_ALIAS):
Let me know how i goes,
UPDATE: Removed extraneous
value
/Chriztian
Cheers, thanks Chriztian! This will come in very handy!
I just had to make one small change, I removed the extra /value from the for-each:
Ah - of course; - I'll update the code to reflect that.
/Chriztian
is working on a reply...