Jump to:

23355 Posts in 17691 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » SILVERSTRIPE BOOK XML SITE TREE ISSUE

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

Page: 1 2 3 4 5
Go to End
Author Topic: 3463 Views
  • servalman
    Avatar
    Community Member
    211 Posts

    Re: SILVERSTRIPE BOOK XML SITE TREE ISSUE Link to this post

    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 %>
    $ExportContent
    <% end_control %>
    </node>

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

    thomas

  • banal
    Avatar
    Community Member
    901 Posts

    Re: SILVERSTRIPE BOOK XML SITE TREE ISSUE Link to this post

    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.

  • servalman
    Avatar
    Community Member
    211 Posts

    Re: SILVERSTRIPE BOOK XML SITE TREE ISSUE Link to this post

    Thanks

    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

    Thomas

  • servalman
    Avatar
    Community Member
    211 Posts

    Re: SILVERSTRIPE BOOK XML SITE TREE ISSUE Link to this post

    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 ?

    T

  • banal
    Avatar
    Community Member
    901 Posts

    Re: SILVERSTRIPE BOOK XML SITE TREE ISSUE Link to this post

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

  • servalman
    Avatar
    Community Member
    211 Posts

    Re: SILVERSTRIPE BOOK XML SITE TREE ISSUE Link to this post

    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)

    PRODUCTS SECTION 1 (level 2)

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

    PRODUCTS SECTION 2

    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

    Thomas

    Attached Files
  • banal
    Avatar
    Community Member
    901 Posts

    Re: SILVERSTRIPE BOOK XML SITE TREE ISSUE Link to this post

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

  • servalman
    Avatar
    Community Member
    211 Posts

    Re: SILVERSTRIPE BOOK XML SITE TREE ISSUE Link to this post

    Hello

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

    <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"/>
    </object>

    how would I write the FlashVar() function ?

    Thanks Again

    3463 Views
Page: 1 2 3 4 5
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.