Menu and Links

General talking about the software SomaUI, the tool to generate a Soma-based site.

Menu and Links

Postby Marshall on Mon Dec 14, 2009 12:25 pm

Hi.

My question is, I want to have one menu on the right and another one on the top with 4 links.
I now that for the menu class to show up in the right I have to position the menu in the code with the x and y position, but how can I put one on the top?
Can i use some kind of links and use the deep-linking to the pages that I want?

Finally this is one grate project and will help lots of designers out there.
Keep it up.

Best regards,
Marshall
Marshall
 
Posts: 1
Joined: Sun Dec 13, 2009 1:23 pm

Re: Menu and Links

Postby romu on Mon Dec 14, 2009 12:41 pm

hi Marshall

Deep-linking will always be working as long as your pages are proper page node in the XML.

You'll probably have to change the code of the "normal" menu not to show some items and build another class (your top menu) that shows only the items you need. It shouldn't be hard if you're fine with AS3.

The simplest thing to is create a copy of the XML Site Definition in your menu classes and remove the nodes at run-time.

Code: Select all
var XMLAmended:XML = Soma.getInstance().content.data.copy();
// delete nodes I dont want to display


Or you can also add a custom page node property like @menuSelector and display only the items depending of the menu (using a E4X filter).

Code: Select all
<page id="my page 1" menuSelector="myTopMenu"...
<page id="my page 1" menuSelector="myOtherMenu"...


The links you can use to show a page from anywhere is:

Code: Select all
new PageEvent(PageEvent.SHOW, "myPageNodeID").dispatch();


And to retrieve the XML Site Definition:

Code: Select all
Soma.getInstance().content.data


Hope it helps.

Romu
romu
Site Admin
 
Posts: 195
Joined: Thu Sep 11, 2008 10:01 am


Return to General Talking

Who is online

Users browsing this forum: No registered users and 1 guest

cron