Hi,
I’m making some progress with the customizable homepage. I’m storing the user’s selections (the content blocks) as asset id’s in a cookie and using AJAX to load in the assets contents which the users can then arrange on the page (like google homepage). I am referencing the movable assets using the asset id’s eg http://intranet?a=666, and this causes the assets to be displayed with the asset’s parent’s design, even though the assets themselves have blank XML design applied. Why is this happening, and how can I get around it?
Cheers,
Geoff
Referencing assets by their asset id
It is happening because Matrix associates a design with a URL and you are not using the asset’s URL. Matrix then selects the design for the URL it can find.
There are a couple of things to try, but the easiest might be to create a page with the XML design applied (anywhere in your site is fine) and then use that page’s URL to reference the asset ID.
For example, if your dummy page with the XML design sits at http://intranet/get-asset.xml then you could reference all assets like this:
http://intranet/get-asset.xml
Because Matrix can’t find the correct design, it should use the one applied to your dummy page.
[quote]It is happening because Matrix associates a design with a URL and you are not using the asset’s URL. Matrix then selects the design for the URL it can find.
There are a couple of things to try, but the easiest might be to create a page with the XML design applied (anywhere in your site is fine) and then use that page’s URL to reference the asset ID.
For example, if your dummy page with the XML design sits at http://intranet/get-asset.xml then you could reference all assets like this:
http://intranet/get-asset.xml
Because Matrix can’t find the correct design, it should use the one applied to your dummy page.
[right][post=“15723”]<{POST_SNAPBACK}>[/post][/right][/quote]
Thanks Greg, it worked like a charm.