Skip to end of metadata
Go to start of metadata

Using the following:

The pagetree2 macro has been deprecated. Please check the user-guide for more information.

and expecting (as viewed from another page):

Page1
> Page2
Page3
...

Page2 has a child, so if you click on the arrow, you should get:

Page1
v Page2
Page2a
Page3
...

But all I get is:

Page1
Page2
Page3
...

Now if I go to Page2 I see:

Page1
Page2
Page2a
Page3
...

The arrow is completely missing.

How can I get this to work correctly?

Thanks,
ilevy

  • No labels

16 Comments

  1. Unknown User (ilevy@terracotta.org)

    Sorry, forgot to escape the curly braces. Here's the macro:

    {pagetree2:@home|showRoot=false|branchStyle=arrow|showIcons=false}
    

    Also, the indentation in the real thing looks fine – I just didn't set it up correctly in the example.

  2. Unknown User (ilevy@terracotta.org)

    Seems that the macro is very sensitive to the order the parameters are listed. Basically, if I list branchStyle first, it is used and the parameters controlling the roots are ignored.

    It's unfortunate this macro is flaky. It would have been a nice thing to use.

    1. I'd like to see an example of this.

  3. Unknown User (ilevy@terracotta.org)

    It seems that it's the showRoot parameter that's causing the problem. The following works ok:

    pagetree2:Home|branchStyle=arrow|showIcons=false

    I say it's "ok" – not really what I want, because it forces me to display the root.

  4. Unknown User (ilevy@terracotta.org)

    Another odd thing is the difference between using the page name of the home page (the top of the root) and @home?

    If I have a hierarchy like this :

    Homepage
    Page1
    Page2

    using @home or Homepage seems to make little difference in any of these pages, except for the icon used for the root.

    1. @home is used so that you dont need to specify the space hompage's name, since it could be called anything.

      What differences were you expecting?

  5. Unknown User (ilevy@terracotta.org)

    Anyone know of any decent docs on how pagetree2 and its parameters are supposed to work (be used)?

    The brief doc on this site is the absolute minimum.

  6. Unknown User (ilevy@terracotta.org)

    I expected that if use @home or mySpaceHomePageName i'd get the same exact tree, but in fact the icon is different. Not a big deal. The problem with the parameters working differently in the macro is the one that's been hanging me up. I'm still doing some more investigating and will report.

  7. Unknown User (ilevy@terracotta.org)

    Following up on the unpredictable behavior of the parameters, I tried this:

    {pagetree2:myOtherSpace:myPage|branchStyle=arrow|showIcons=false}
    {pagetree2:@home|branchStyle=arrow|showIcons=false}
    

    This builds one tree above the other, with the top one coming from myOtherSpace (as opposed to the current one), but the top one lacks the expand/collapse arrows.

    If I then reverse the order of "myOtherSpace:myPage" and "branchStyle=arrow" so that branchStyle comes first, "myOtherSpace:myPage" is ignored and the top tree shows the current space in the default format as if no root was specified.

    1. do you mean that you are attempting to use {pagetree2:branchStyle=arrow|myOtherSpace:myPage|showIcons=false}

      Which of course wont work ... the whole point about the what's called the 'default' parameter is that is the very first one used in the macro ... this is the expected behaviour!

  8. Unknown User (ilevy@terracotta.org)

    It's not clear to me why branchStyle and setting the root in a certain way should conflict. Are you saying that branchStyle also sets the root, not just the style?

    This shows the root and branch style as I want (since I can't suppress display of the root with branchStyle; see my earlier message):
    @home|branchStyle...

    This doesn't work (it suppresses the branchStyle):
    myPageName|branchStyle...

    This causes any root-page setting to be ignored and behaves as "default":
    branchStyle=<whatever>|<some way of setting root>

    The last two cases don't make sense to me.

    1. Please provide complete examples and explain fully what you see happening and how it differs from your expectations.

  9. Unknown User (ilevy@terracotta.org)

    I have a space, and in it a page called Home, its child Page1, and Page1 has a child Page2. Page2 isn't important in these examples except to ensure that Page1 shows up with an expand/collapse arrow.

    In the diagrams below I'm using > and v etc. to represent the expand/collapse arrows.

    1. When I have this:

    {pagetree2:@home|branchStyle=arrow|showIcons=false}
    

    and I get:

    vHome
    >Page1

    Expectation: met.

    2. Then I turn off display of the root:

    {pagetree2:@home|branchStyle=arrow|showRoot=false|showIcons=false}
    

    and I get:

    Page1

    Expectation:

    >Page1

    3. I remove showRoot, and now use the actual name of the root page:

    {pagetree2:Home|branchStyle=arrow|showRoot=false|showIcons=false}
    

    and I get:

    Home

    Unknown macro: {html}

    <br> 

    Page1

    Expectation:

    vHome

    Unknown macro: {html}

    <br> 

    >Page1

    4. Going back to case #1 above, I switch the position of @home and branchStyle:

    {pagetree2:branchStyle=arrow|@home|showIcons=false}
    

    and I get:

    spaceRootPage

    Unknown macro: {html}

    <br> 

    vHome

    Unknown macro: {html}

    <br>  

    >Page1

    Hopefully that's clear.

    1. 1. ok

      2. Unfortunatley this is the expected behaviour, since without the root node there is nothing for the arrows to display against - the expand/collapse links are related to the parent node, not the node being expanded, this is the way that nlstree was designed to work.

      3. This is also the expected behaviour, the 'default' parameter must be the first parameter in the list ... if you wish to use a random order of parameters then you should use the page= & space= parameters for specifying the root page and space key.

      1. Unknown User (ilevy@terracotta.org)

        Thank you for clearing that up. I hope there's going to be more work done on this macro – to me it's very useful and is almost "there." My xmas list for it is short (right now (smile)

        • make nav ui independent of display of root
        • add sorting, at least based on page name
        • allow exclusion of page names based on pattern (e.g., exclude *.png)
        • allow custom nav ui (e.g., my arrows) – minor need
        1. In the future we expect to ditch the nlstree commercial library in favour of a jQuery derived tree ... this will come after we have completed the removal of ext-js, and disposed of the Dynarch hMenu (replacing both with jQuery)

          I will ensure that your use-case will be taken into account during the development of the new tree, since I can certainly see why you would expect things to behave in that way.

          If you need this to happen within a given timescale though it would be best to create an issue at tracker.adaptavist.com in the GSE project requesting a quote for the work.