25 August 2010 at 2:49am
I would probably pass the $ID via FlashVars, together with a link to the XML Site-Tree. The link to the XML would be something like $Link/export and also passed to flash using FlashVars.
If you have a lot of pages and a high traffic site, it's probably not a good Idea to render the whole Site-Tree to XML with every request. If that's the case, it would be better to write the Site-Tree to an XML file whenever a Page in the CMS was edited...
Do you think it is possible using your techique to just create an xml export of the 3rd level so I don't update the all site tree all the time .
It would also allow me to make several flash movies corresponding to each navigation sections instead of just one .
25 August 2010 at 11:10pm
What I meant was something a bit different. I was suggesting to export the XML to a static file whenever a Page changes in the CMS. That way, the export will only be triggered if somebody changes something in the CMS and not with each user-request. If you apply this technique, it's no problem to always export the full XML-Tree.
But your approach is a good idea too. Just exporting the bits of the XML-Tree you currently need seems like a good plan. It might cause some loading-delays though?
I think you could just create a new function on your Page_Controller and name it "exportchildren" or something along these lines. Then create a matching template Page_exportchildren.ss:
<% control Children %>
<% end_control %>
That will then only export the structure of the children... so you can get the subtree of a page "product" by loading /product/exportchildren in flash.