How to organize contents Options
robfum
Posted: Monday, August 25, 2008 12:40:00 PM
Rank: Newbie

Joined: 7/12/2008
Posts: 13
Location: Italy
I’m creating my first website with Umbraco and I wonder how to organize my contents.

First of all, my website has 2 different navigation menus, one on the left side and one on the top of the page.
Which is the right way to organize my contents? Have I to create two nodes in the content tree (Left and Top) and build each menu in these nodes?

In this site I also have a box in which I display different quotations (from famous people and literature) every time a page is displayed. I have about 1000 quotations to insert. Those quotations should not be in the navigation. My idea is to create the node QUOTES at the top level of the content and to create in this node all the nodes of the quotations. Is this a good approach or this quotations are too much?

I’m a little bit confused because we have our CMS and in it we have a function to create contents and organize them in folders, and a function to create navigation structure (with one or more menus).
To fill this structure we have “Containers“. Every container is specialized for collect contents in different ways, for example by category, by date, with queries on the contents, or simply by creating lists picking up the contents we need.
We are satisfied with our CMS but our customer asks for a DOTNET solution and our CMS is Java and Umbraco is very similar to our CMS.

Any suggestion is welcome!

Regards

ddrayne
Posted: Monday, August 25, 2008 12:53:57 PM
Rank: Newbie

Joined: 7/28/2008
Posts: 17
Location: Edinburgh
Hi Robfum!

first off, do you two menus bear any relationship to each other? E..g should the content of the right hand side tree change depending on what page you are currently looking at?

You could create two nodes at the top level and then essentially create two separate content trees below these, then use xslt to only pick content from the appropriate tree.

For your quotes, this is exactly what I have done and it works fine. Check the following out



I just created a new document type of "customer quotes", then used xslt to pick and display - with a little help from the people on this forum.

Then i just use the following xslt to display a random quote on the website.

Code:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library"
    xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath"
    exclude-result-prefixes="msxml umbraco.library Exslt.ExsltMath">


<xsl:output method="xml" omit-xml-declaration="yes"/>

<xsl:param name="currentPage"/>
<xsl:variable name="quoteFolder" select="1168"/>

<!-- ============================================================= -->

<xsl:template match="/">
    <xsl:variable name="numNodes" select="count(umbraco.library:GetXmlNodeById($quoteFolder)/node)"/>
    <xsl:variable name="random" select="floor(Exslt.ExsltMath:random() * $numNodes) + 1"/>

   <div class="customer_quote">
        <div class="quote">
            <xsl:value-of select="umbraco.library:GetXmlNodeById($quoteFolder)/node [position() = $random]/data [@alias='quote_text']"/>
            <span>
                <xsl:value-of select="umbraco.library:GetXmlNodeById($quoteFolder)/node [position() = $random]/data [@alias='customer_name']"/>
            </span>
           </div>
       </div>        
<p class="quotes_view"><a href="#">View full list of customer stories</a></p>            
           

</xsl:template>

<!-- ============================================================= -->

</xsl:stylesheet>




Hope this helps a little anyhow,

Dan
Dirk
Posted: Monday, August 25, 2008 1:00:50 PM

Rank: Addict

Joined: 9/27/2007
Posts: 977
Location: Belgium
Hi,

No matter how you build and organize the content tree, you'll still need xslt to parse the content tree and get the right navigation! No technical issues here I suppose, just depends on how the content editors are going to use the navigation in the admin backend! Just ask what makes more sense, and build the content tree to their needs. Navigation comes second! you'll always find that fine piece of xslt that does the trick (Can become complex, but it's almost always do-able). Avoid creating duplicating content in the admin section (that is, as you said, creating two navigation structures), just create a single navigation, and use xslt to create both left- and top navigation. If you need help with this, just ask here in the forum.

Quote:
My idea is to create the node QUOTES at the top level of the content and to create in this node all the nodes of the quotations. Is this a good approach or this quotations are too much


It's certainly a good approach. Just create two document types, one used as a container ('Quotes') and another one for a single 'Quote'.

Hiding certain pages from navigation can be easily accomplished. Just add an extra general property called Hide page (alias = 'umbracoNaviHide'). In your xslt, you can check for the value of this property to include/exclude nodes from navigation. Have a search here for umbracoNaviHide on the forum, you'll get lots of pointers.

[EDIT] And Dan has already given some nice xslt and screenshots! Great![/EDIT]

Good luck!

Regards,
/Dirk


level 1 certified - umbraco blog at netaddicts.be - working on an integrated forum4umbraco
robfum
Posted: Monday, August 25, 2008 4:04:02 PM
Rank: Newbie

Joined: 7/12/2008
Posts: 13
Location: Italy
Thank you Dave and Dirk!

Dave, I found very useful your post and I'm going to use your XSLT for the random quote.

The two menus are not related each other in any way. Then I think that the approach to create two branch at the top level is the right way.

Dirk, as the two menus are related to different contents ther is no duplication.
Do you mean that it is possible to create the navigation regardless of the content sructure? (Maybe also using properties: what about adding properities in the documents to store the logic of navigation ?)

By the way, I'm looking for an XSLT to create a multilevel left menu (actually 3 levels) with different styles for each level, and the ability to show the childs nodes of the current level open. Any sample?

Thanx a lot

Rob
daniel_l
Posted: Monday, September 01, 2008 2:19:46 PM
Rank: Aficionado

Joined: 6/25/2007
Posts: 132
Location: Malmo, Sweden
robfum wrote:

Do you mean that it is possible to create the navigation regardless of the content sructure? (Maybe also using properties: what about adding properities in the documents to store the logic of navigation ?)


Yes it is indeed possible to create the navigation regardless of the structure. Of course, it is easiest to set up navigation if it directly corresponds to the structure in the back end. then it is just a matter of iterating the nodes in XSLT.

But you could create your menus regardless of the structure in the back end, using document types and properties of the nodes to select and sort the nodes that should go in your menus.

Two short examples to explain the principle:

For example, you could have a top menu item called 'News' under which all document types of the document type 'News item' is listed regardless of where in the site structure they have been created.

Or to use properties, you could fetch and list all document nodes that has a property called 'list under news' checked. The use of a property called 'umbracoNaviHide' to hide documents from navigation menus is an example of this strategy.

All done using XSLT.

Is it me or umbraco? Umbraco Certified Professional Level 2.
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.