on 07-02-2018 2:48 PM
Hi All, We have a requirement where each media attribute can have multiple assets as shown in below example. E.g. Product has attribute "Product Image", which can have images as "left image", "right image" etc. (this list may vary for different attributes) and all these images should be localised. i.e. EN can have different set of images for above defined types and DE can have different set.For multiple assets, we can use media Collection, and we tried localising the MediaCollection, but it dint work. Could you please provide the best approach for this requirement? Thanks in advance.
In items.xml, define the attribute as "localized:Media"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Create a new table CountrySpecificMediaModel having 3 attributes
productcode
countryIso
MediaCollection
When fetching a product media, run the following query
select {csm.pk} from {CountrySpecificMedia as csm}, {Product as p} where {p.code} = {csm.productcode} and {csm.country} = <get country iso code from sesssion>
This query will give you SearchResult. Now do the following.
SearchResult<CountrySpecifiMediaModel> queryResult = <results from previous query>
CountrySpecifiMediaModel csm = queryResult.getResult().get(0)
Collection<MediaModel> medias = csm.getMediaCollection();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.