Global Navigation version 2.00 released

July 27, 2009 by: Christian

This is an exciting update, because it makes things easier. From now on you don’t have to think about button IDs anymore. Remember, up to now you had to name the buttons carefully in the correct manner: b0, b1, b2 etc. for the first level, then b1_0, b1_1, b1_2 and so on for the sub navigation of b1 etc. This is now handled automatically, so you can move nodes around in the xml file without having to rearrange the button IDs. At the same time I have taken out the global navigation of the Gaia site.xml. That way the xml file gets clearer. Because the btnIDs are gone, there is a new xml attribute “id” in the global navigation xml file. That is also the link to the Gaia site.xml: Just use for the button IDs the page IDs of the Gaia site.xml and the two files are linked.

Check out the following 3 screenshots.:

Global Navigation XML + Gaia site XML together in one file

gaia_globnav_mixed

As you can see, this is how it used to be up to now (Global Navigation version 1.57a). The attributes of both Gaia and Global Navigation together in one file.

Gaia site.xml without Global Navigation

xml_gaia_site

This is the normal Gaia site.xml without the Global Navigation.

The new Global Navigation XML source file

xml_global_nav

This is the new Global Navigation navig.xml file. Yellow marked you can see that the new attribute “id” is the same as the page IDs of the Gaia site.xml above. The root node can be of any name, but the “navigation” and “button” nodes have to be named like that.

Ok, but what is so exciting about this?

The fact that you don’t have to handle the button IDs by yourself is one thing, the other is that this is one of the last pieces of my own Flash Website Framework called “FLEB” which is based on the Global Navigation. One of the key features of this framework is SEO. Stay tuned!

Visit the docs to download the source files and classes.

.

Comments

8 Responses to “Global Navigation version 2.00 released”
  1. Tiago Pedras says:

    Hey

    Global Navigation was the best solution I’ve found to create a dynamic navigation for Gaia. After figuring it out it is definately a nice choice to complement Gaia.

    There are two things that I would like it to have and I thought I should share them with you.
    The first one is quite simple and is only refering to the default layout of buttons. They kinda made me shiver at first and I even thought of not using this since it didn’t seemed very customizable just by looking at it. Now I understand that it’s not true but as a designer I can’t help of judging things by it’s look.
    The second thing also has to do with this which is the fact that it would be nice if we could edit the button states in a document class instead of the timeline.

    Hope you find this usefull! ;)
    Cheers and thank you for the hard work!

  2. Christian says:

    Hi Tiago

    Thanks for your input! I absolutly agree with your points. My plan is to write a little app to create the xml file visually (where you can try out settings with your own buttons). And I will also put your suggestion about the document class on my to-do list. :-)

  3. cramredan says:

    Hello christian,

    i have two questions concerning the use of your Global Navigation sample code :

    1) where do you switch parameters in your .as files for a vertical (rather than horizontal) display of your top hierarchy buttons ?

    2) how would you proceed to obtain the same menu workflow as the one displayed in the following website http://www.royalsalute.com ? Would that be possible, meaning hiding the level 0 hierarchy once once of its buttons have been clicked

    Thanks for your answer. MARC

  4. Christian says:

    Hi Marc

    Anwser 1: have a look at the xml attribute btnSpacingY – http://www.flashcmsframework.com/docs/doku.php?id=global-navigation2-xml#btnspacingy
    and also the demo file 5,6,7,8,9,10. They have a vertical menu – http://www.flashcmsframework.com/docs/doku.php?id=global-navigation2-examples

    Answer 2: This is also possible :-) Look here (getSiblings) http://www.flashcmsframework.com/docs/doku.php?id=global-navigation2-public-methods#getsiblings
    By using getSiblings, you can retrieve all btns of a level and do what is needed, in your example fade out all buttons of that level.

    Cheers,
    Christian

  5. ottie says:

    Hi Christian,
    Great admirer of your work – really nice programming.
    As I’m a gaia starter, I’d love to check out an example of your combined navigation (site.xml and navigation.xml combined in one file), but trying out your global navigation 2/212 examples, there are still the two files or am I missing something?
    This would also make things easier to change languages.
    And just one more question: I have a navigation with buttons of variable height, depending on the length of the labels. I know self-adjustable width is not a problem, but height is another issue.
    Any ideas?

    Thanks a million.

  6. Christian says:

    hi ottie

    I have separated it into two files to be more independent when the Gaia Framework changes. That’s the way it is handled since Global Navigation version 2.xx. So, yes, if used in Gaia you need two files. Maybe you should have a look at the Fleb Framework here, which is based on the Global Navigation and you have again one xml file. If you want to change the height of your buttons you should do it inside mainBtn.swf. Also have look at this: http://www.flashcmsframework.com/docs/global-navigation2-public-methods#setbtnlabeltextnewline if you need to handle long label text in your menu buttons.

  7. ottie says:

    Hi Christian,

    Thanks for the fast reply – the setlabeltextnewline method indeed gave me good results. Only worry is that some of the buttons have 3 or two lines of text while others only have one, and they are all placed vertically and should be equally proportioned to the text. I know, it’s a pain.
    I managed to “fix it” – probably in an unorthodox way :
    in your Navigationbutton2.as,
    I made a new private var _btnHeight
    and then went into the positionLabel method and inserted:

    _btnHeight = navigBtnAsset.navigBtnLabel.textFieldMc.tf.height;

    if(_btnHeight > navigBtnAsset.navigBtnArea.height)
    {
    navigBtnAsset.navigBtnArea.height = _btnHeight ;
    navigBtnAsset.navigBtnBg.height = _btnHeight ;
    __initHeight = _btnHeight;
    }

    This does the trick, but could be better with some extra parameters – I know.

    If you see a better way – and I’m sure you do – please let me know. Always keen to learn from a pro.
    Thanks.

  8. Christian says:

    Cool that you found a solution that works for you, At first glance your code looks ok to me. I just did not have the need for a vertical navigation with different button heights, in fact I would try to avoid it. But you never know… :-) Maybe the one client who demands it is just around the corner…

Trackbacks

Leave a Reply