Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w



40 Posts   3721 Views


24 August 2010 at 11:19pm Community Member, 211 Posts

Thank you for that quick answer

It works (I guess it also work for level 3 items) !

Very nice of you

Know the oonly thing I would need ist to have the URL as a string do I have to create a function in the php file or is there something that can be used in the template like $CurrentLink

<node id="$ID" label="$Title" isBranch="true" classname="$ClassName" url="$CurrentLink">
<% control Children %>
<% end_control %>

Thanks again I will try it with flash & let you know ohw it goes



25 August 2010 at 12:55am Community Member, 901 Posts

Glad it worked. It will also work for level 3 and any other level below (since it's basically recursive).

You can use $Link to get the link or $AbsoluteLink if you need the full URL.


25 August 2010 at 1:04am Community Member, 211 Posts


It is going to be extremly useful !

Now I will take care of the flash nav more easely since it is just going to process the xml .

I'm sure I will have some other question :)



25 August 2010 at 1:28am Community Member, 211 Posts

Hello Banal (that is the other question I was talkin about :))

I wanted you advice of ohw to implement the flash nav and spécifically how to transmit to flash the current page.

I was thinking of using a flashvar to do so sending to flash the $Link variable .

Is it the best way ?



25 August 2010 at 2:49am Community Member, 901 Posts

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...


25 August 2010 at 9:29pm Community Member, 211 Posts

Hi Banal

I'm now into insterting flash élements in my site.

I'm ok with replacing flash content with images or text it works fine.

I was now thinkin of what you said about not exporting the all site tree all the time.

here is the site tree (I have attached an image to be clearer)

PRODUCTS (level 1)


PRODUCTMENU : product 1- product2-product3 tc (level 3)


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 .

Thanks again


Attached Files

25 August 2010 at 11:10pm Community Member, 901 Posts

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

<% 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.


25 August 2010 at 11:40pm Community Member, 211 Posts


I will try that and get back to you.

Regarding the URL for the export link in flash var I usually do the following :

ImageName bieng the Name of the image I use in the flash:

In my Page.php

public function FlashVar() {
return "myFlashVar=$this->ImageName";

In my

<object width="$FlashWidth" height="$FlashHeight" type="application/x-shockwave-flash" data="assets/swf/$FlashName">
<param name="movie" value="/assets/swf/$FlashName" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<param name="flashvars" value="$FlashVar"/>

how would I write the FlashVar() function ?

Thanks Again