Dynamic nested content not based on asset_id


(Gabriele Antonini) #1

Hi all,

is there a way to dynamically nest content not based on asset_id property? For example using asset_web_path property?

 

Thanks,

G.


(Nic Hubbard) #2

Can you explain your scenario a bit more?


(Gabriele Antonini) #3

Hi Nic,

basically I have a standard page with a nested content div. Currently I'm able to pass a GET parameter to the page and use that parameter to dynamically change the nested content. e.g. /mypage.html?promoid=1234 it will show the nested content with asset ID 1234. My question is: is there a way to embed content using another property instead of asset ID? e.g. /mypage.html?promopath=promo_web_path

Given that the asset I want to embed has web path equals to "promo_web_path", can I use something similar?

 

Thanks,

G.


(Nic Hubbard) #4

Ah, I see what you mean. No, I don't think this is possible.


(Gabriele Antonini) #5

Yes, I thought so...

Another doubt related with this: is the web path asset property (acessible from %asset_web_path%) unique across a single website?

It theory it should be unique since I can't have 2 different assets with the same url but I couldn't find anything about that in the manuals.

 

Thanks,

G.


(Bart Banda) #6

Yea the full web path of an asset has to be unique. If you pass the full web path to an asset you could try and print the content of that web path with an nested rest asset instead that uses the %globals_get_promopath% as the URL in the rest call, or even remote content page as well. 

 

Alternatively, you could even just pass the web path without the domain and keep the domain hardcoded in the rest asset or remote content page, so that if you pass ?promopath=/some/web/path, you could pass "http://www.site.com%globals_get_promopath%" as the url to a rest asset or remote content asset to nest in the contents that way. You might need to pass it a user defined design in the page request as well that only prints the body content of the asset and not the full design, so final request might look something like ""http://www.site.com%globals_get_promopath%?SQ_DESIGN_NAME=bodyonly". 

 

Hopefully that helps.