Hi Chris, thanks for your quick answer, but i don't need a menu through the child pages, only i'll need a list with ul li links. the user should be able for edit them later, delete and so on.
the links will be able throught the whole site too, but it need be able for edit and without watching the child pages.
How you render the li tag and class attribute depends on whether you choose to create a simple xslt or a usercontrol. I guess the simple approach would be to create a simple xslt like this - assuming that you add a textstring-type field on your Document Type:
The above example evaluates a set of children of the current node and renders an unordered list with the nodeName and a link to the page. Each of the children should be based on a Document Type, which has a Data Type (ie. textstring) with the following alias: cssclass Using the xsl:attribute function will add the speficied attribute name to the preceding tag with the xsl:value-of. Result would be something like:
the links technology, athletes and so on need be dynamic but they should link to another places, not childs from the current node or something else. then the last link has the class "cart" for show different. i hope this clarify a bit more my question.
Thanks and remember that i'm a newbie on umbraco ;)
Okay, I think I understand what you are trying to do. On your Document Type from which you want to add a list of links, add the Data Type called "Related Links" (alias: links). This Data Type allows you to add a list of internal or external links to your page.
The xml for the Related Links Data Type looks like this:
You might want to check if the link is internal or external in order to decide how the link should be rendered and whether target="_blank" should be added to the a-tag.
I've made the related links and set the alias, but i don't know how i'll can show then in the master template or in the home template. i'm reading about how make content but i think i'll need learn more about umbraco. i'm a newbie on this.
you know if exist a tutorial step by step of how make this?
I've read that this cms is easy to use, but i think not is very intuitive. maybe is because i'm changing from modx
Sorry morten to bother you again, can you explain step by step the message that you've post here a few ago with this message?
On your Document Type from which you want to add a list of links, add
the Data Type called "Related Links" (alias: links). This Data Type
allows you to add a list of internal or external links to your page.
Here is a step by step of how to create a page, which renders an unordered list of links. And this is from total scratch:
First go to the Settings section and Document Types. Right click on Document Type and choose Create. For this example I'll call the Document Type "LinkList". Keep the "Create matching template"-checkbox checked, so a Template will be created for us. I'll return to the Template, but next step is to click on the newly created Document Type.
On the LinkList-Document Type go to Tabs and create a new tab called Content. Now go to the Generic properties and add a new property. I will give my property the following values: Name: My Links Alias: myLinks Type: Related Links Tab: Content
The important thing here is the Alias, which we will use in our XSLT and the Type, which is our selected Data Type of Type: Related Links (as per my previous post). Save the changes made to the Document Type, and move on to the Developer section. Here we will create our XSLT, which we will use to render our unordered list.
Right click on "XSLT Files" and choose create. I have called my XSLT "LinkListRendering" and chose the Clean-xslt template and left the "Create Macro"-checkbox checked, as this will automatically create a Macro for us that we will use on the Template, which was automatically created when we created the Document Type.
Paste the following code into your newly created xslt (LinkListRendering):
and paste in after the following comment in the xslt: <!-- start writing XSLT -->
After saving your XSLT go back to the Settings section and choose the LinkList Template under Templates. Inside the <asp:Content> </asp:Content> tags insert a Macro (Insert Macro button in the top menu). Choose the Macro called "Link List Rendering" and click Ok. Now we have added our XSLT rendering to our Masterpage.
If you go to the Content section and create a new document based on the LinkList-Document Type, add some links to your list and then publish you should see the unordered list rendered. You might need to allow creation of LinkList-documents by setting allowed types under the Structure tab on the different Document Types.
I hope all of this made sense and it helped you create the unordered list you wanted.
Hi Morten, thanks for your step by step guide. i've does the all steps, but i continue without watching the link in the site. i've loaded into the master template and nothing. i've read the all documentation that you've told me before but is like this cms not is for an newbie.
how i'll can load the link list into the master template?
I'm not sure I can explain it any better, so I have made a quick screencast of the step-by-step that I wrote in an earlier post. I hope seeing the steps in action will help you succeed in your creation of the unordered links.
Hi Morten, thanks for you help, you can think that i am idiot but i've does the all steps and fine works, but how i can insert into the template for show in the whole site?
i mean i've has a master template and inside it i have a lot of templates, but i need that this list is showed in the all sites.
i've installed a package (CWS) and i'm changing the code from this place.
I think the last thing you are missing is that the current example uses currentpage as the starting point for creating the list. But I'm guessing the list only resides in one place within your content tree. Lets say your list of links is placed on the Home node (i.e. the Related Links-Data Type on your Home-Document Type), you could use this xsl variable to get the correct starting point (which is Home on the CWS website package or simply the first level node):
Hi Morten, :( nothing happened, here is the structure that now i have Templates LinkList Master Contact Email a Friend Event Item Galleries ... Home .... Textpage(Two Column) RSS XML Sitemap ..... Document Types Contact ..... Home LinkList .... Textpage(Two Col) In the document type LinkList the allowed templates is LinkList and Master. Inside the Master Template i've added this <umbraco:Macro Alias="LinkListRendering" runat="server"></umbraco:Macro> and nothing is showed. the call to the function it's inside a global <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
I know that is a simple thing but i don't understand good how works this CMS. i've saw a lot of videotutorials and i'm continue learning about this. Thanks for you help, and tell me if is wrong something Thanks!!!!
Okay, can you try and explain where you want the list rendered on your site. You mentioned that it should be shown on all pages, but is it like a top menu, left menu or footer where you type the links instead of generating the list from child elements?
I think you could drop the LinkList Document Type and Template, and simply add the Related Links-Data Type to your Master-Document Type, but i'm not 100% sure that this is what you want...? Do you want to be able to create the links on one central node? A good example would be an address, which is only entered on the Home node, but shown on all pages in the footer.
this is my requirement. i'll need add a few list in different places of the master template with links, these links need be edited for the client in an easy form.
For example, have header links, sidebar links and footer links, but not with the child pages and so on. only links.
Mario, I'm setting up CWS locally so I can create a screencast in your context. I'm pretty sure my last post should have worked, but you might have missed something or something is different because of the context.
Here is a screenr of inserting lists of links on the Master of the CWS package. What I have done is to add two tabs (Header Links and Sidebar Links) on the Home-document type, and afterwards added the Related Links data type on each tab.
Next I created two XSLTs with matching Macros: HeaderLinks.xslt and SidebarLinks.xslt - I added the code, which i previously posted. Back to the Settings section, I added the two Macros to the Master (Masterpage).
Lastly I go to the content section and the Home node, and add links to the two fields (one field on each tab). Save and Publish, then click the link to go to the updated page.
I have created an Umbraco package, which you can download and install - try installing it in a fresh umbraco solution. If you also install CWS before installing the package there might be some conflics, but its worth trying out.
Create list of links with different class inside the li tag
Hi, this is my first post about umbraco. i'm making a site and i don't know how build an ul li list with different class inside the li elements.
I've read the most of post in the forum, but nothing. if someone can show me a step by step for a newbie that would be great.
The content is showed fine but i'm not sure how to do that.
Thanks and sorry for my english.
the following code will loop through the child pages of the current page and output a ul/li list.
The class name on the li is chosen in the <xsl:choose> statement. Obviously the test statements need to be replaced.
Hi Chris, thanks for your quick answer, but i don't need a menu through the child pages, only i'll need a list with ul li links. the user should be able for edit them later, delete and so on.
the links will be able throught the whole site too, but it need be able for edit and without watching the child pages.
I'm not sure if i explain this fine.
Thanks
Hi Mario,
How you render the li tag and class attribute depends on whether you choose to create a simple xslt or a usercontrol. I guess the simple approach would be to create a simple xslt like this - assuming that you add a textstring-type field on your Document Type:
The above example evaluates a set of children of the current node and renders an unordered list with the nodeName and a link to the page. Each of the children should be based on a Document Type, which has a Data Type (ie. textstring) with the following alias: cssclass
Using the xsl:attribute function will add the speficied attribute name to the preceding tag with the xsl:value-of. Result would be something like:
Hope this is what you were looking for.
- Morten
Guess I wasn't quick enhough to answer :)
@Mario: Can you list your node tree structure for the pages or nodes that you want listed in your unordered list?
- Morten
Hi Morten, thanks for your quick answer, i'm not sure if this is that i need. for example, here is the html code that i'll need build dynamic
<div class="links">
<ul>
<li><a href="#">Technology</a></li>
<li><a href="#">Athletes</a></li>
<li><a href="#">Events</a></li>
<li><a href="#">Find a dealer</a></li>
<li class="cart"><a href="#">Cart</a></li>
</ul>
</div>
the links technology, athletes and so on need be dynamic but they should link to another places, not childs from the current node or something else. then the last link has the class "cart" for show different. i hope this clarify a bit more my question.
Thanks and remember that i'm a newbie on umbraco ;)
Okay, I think I understand what you are trying to do.
On your Document Type from which you want to add a list of links, add the Data Type called "Related Links" (alias: links). This Data Type allows you to add a list of internal or external links to your page.
The xml for the Related Links Data Type looks like this:
You might want to check if the link is internal or external in order to decide how the link should be rendered and whether target="_blank" should be added to the a-tag.
In the above example I test for the position in order to add a css class name to the last li element in the unordered list.
Is this what you are looking to do?
- Morten
Hi Morten
I've made the related links and set the alias, but i don't know how i'll can show then in the master template or in the home template. i'm reading about how make content but i think i'll need learn more about umbraco. i'm a newbie on this.
you know if exist a tutorial step by step of how make this?
I've read that this cms is easy to use, but i think not is very intuitive. maybe is because i'm changing from modx
Thanks
Sorry morten to bother you again, can you explain step by step the message that you've post here a few ago with this message?
On your Document Type from which you want to add a list of links, add the Data Type called "Related Links" (alias: links). This Data Type allows you to add a list of internal or external links to your page.
Thanks
Hi Mario,
First off here are some links to posts, which I hope you will find usefull in getting started with Umbraco:
http://www.blogfodder.co.uk/post/A-Complete-Newbies-Guide-To-Umbraco-CMS.aspx
http://www.blogfodder.co.uk/post/Using-Master-Document-Type-In-Umbraco.aspx
http://www.blogfodder.co.uk/post/Simple-Umbraco-Footer-Navigation.aspx
http://our.umbraco.org/wiki/how-tos/umbraco-absolute-beginner-tutorial
and off course the www.umbraco.tv site. I highly recommend subscribing to umbraco.tv as it contains a huge amount of helpful videos.
- Morten
Here is a step by step of how to create a page, which renders an unordered list of links. And this is from total scratch:
First go to the Settings section and Document Types. Right click on Document Type and choose Create. For this example I'll call the Document Type "LinkList".
Keep the "Create matching template"-checkbox checked, so a Template will be created for us. I'll return to the Template, but next step is to click on the newly created Document Type.
On the LinkList-Document Type go to Tabs and create a new tab called Content. Now go to the Generic properties and add a new property. I will give my property the following values:
Name: My Links
Alias: myLinks
Type: Related Links
Tab: Content
The important thing here is the Alias, which we will use in our XSLT and the Type, which is our selected Data Type of Type: Related Links (as per my previous post).
Save the changes made to the Document Type, and move on to the Developer section. Here we will create our XSLT, which we will use to render our unordered list.
Right click on "XSLT Files" and choose create. I have called my XSLT "LinkListRendering" and chose the Clean-xslt template and left the "Create Macro"-checkbox checked, as this will automatically create a Macro for us that we will use on the Template, which was automatically created when we created the Document Type.
Paste the following code into your newly created xslt (LinkListRendering):
and paste in after the following comment in the xslt: <!-- start writing XSLT -->
After saving your XSLT go back to the Settings section and choose the LinkList Template under Templates.
Inside the <asp:Content> </asp:Content> tags insert a Macro (Insert Macro button in the top menu). Choose the Macro called "Link List Rendering" and click Ok. Now we have added our XSLT rendering to our Masterpage.
If you go to the Content section and create a new document based on the LinkList-Document Type, add some links to your list and then publish you should see the unordered list rendered.
You might need to allow creation of LinkList-documents by setting allowed types under the Structure tab on the different Document Types.
I hope all of this made sense and it helped you create the unordered list you wanted.
- Morten
Hi Morten, thanks for your step by step guide. i've does the all steps, but i continue without watching the link in the site. i've loaded into the master template and nothing. i've read the all documentation that you've told me before but is like this cms not is for an newbie.
how i'll can load the link list into the master template?
Thanks man and sorry to bother each time
Best,
Mario
I've made the step by step a few times and nothing, in the master template i've added this and nothing
<umbraco:Macro Alias="LinkListRendering" runat="server"></umbraco:Macro>
then the struture of my site is the next
templates
LinkList
Master (with a lot of childs)
RSS
XML Sitemap
I know that i'm not an expert in this, but what step i am doing bad? :(
thanks for the help
Hi Mario,
I'm not sure I can explain it any better, so I have made a quick screencast of the step-by-step that I wrote in an earlier post. I hope seeing the steps in action will help you succeed in your creation of the unordered links.
Check it out here:http://screenr.com/pTx
- Morten
Hi Morten, thanks for you help, you can think that i am idiot but i've does the all steps and fine works, but how i can insert into the template for show in the whole site?
i mean i've has a master template and inside it i have a lot of templates, but i need that this list is showed in the all sites.
i've installed a package (CWS) and i'm changing the code from this place.
Sorry and thanks again.
Mario
Hi Mario, No problem! You are not an idioit, just new to the system which is totally understandable.
If you want the list displayed on every page you would have to add the Macro within this tag:
<asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server"></asp:Content>
I think the last thing you are missing is that the current example uses currentpage as the starting point for creating the list. But I'm guessing the list only resides in one place within your content tree.
Lets say your list of links is placed on the Home node (i.e. the Related Links-Data Type on your Home-Document Type), you could use this xsl variable to get the correct starting point (which is Home on the CWS website package or simply the first level node):
and then change the following line to use the rootNode variable instead of currentPage:
Try it out and let me know if it works.
- Morten
Hi Morten, :(
nothing happened, here is the structure that now i have
Templates
LinkList
Master
Contact
Email a Friend
Event Item
Galleries
...
Home
....
Textpage(Two Column)
RSS
XML Sitemap
.....
Document Types
Contact
.....
Home
LinkList
....
Textpage(Two Col)
In the document type LinkList the allowed templates is
LinkList and Master.
Inside the Master Template i've added this
<umbraco:Macro Alias="LinkListRendering" runat="server"></umbraco:Macro> and nothing is showed.
the call to the function it's inside a global
<asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
I know that is a simple thing but i don't understand good how works this CMS. i've saw a lot of videotutorials and i'm continue learning about this.
Thanks for you help, and tell me if is wrong something
Thanks!!!!
Mario
Okay, can you try and explain where you want the list rendered on your site. You mentioned that it should be shown on all pages, but is it like a top menu, left menu or footer where you type the links instead of generating the list from child elements?
I think you could drop the LinkList Document Type and Template, and simply add the Related Links-Data Type to your Master-Document Type, but i'm not 100% sure that this is what you want...? Do you want to be able to create the links on one central node? A good example would be an address, which is only entered on the Home node, but shown on all pages in the footer.
- Morten
this is my requirement. i'll need add a few list in different places of the master template with links, these links need be edited for the client in an easy form.
For example, have header links, sidebar links and footer links, but not with the child pages and so on. only links.
sorry for my english and thanks for all
Best,
Mario
Mario, I'm setting up CWS locally so I can create a screencast in your context. I'm pretty sure my last post should have worked, but you might have missed something or something is different because of the context.
Stay tuned! A new example is coming up ;)
- Morten
Hi Mario,
Here is a screenr of inserting lists of links on the Master of the CWS package. What I have done is to add two tabs (Header Links and Sidebar Links) on the Home-document type, and afterwards added the Related Links data type on each tab.
Next I created two XSLTs with matching Macros: HeaderLinks.xslt and SidebarLinks.xslt - I added the code, which i previously posted. Back to the Settings section, I added the two Macros to the Master (Masterpage).
Lastly I go to the content section and the Home node, and add links to the two fields (one field on each tab). Save and Publish, then click the link to go to the updated page.
Here is the screenr: http://screenr.com/A2x
I have created an Umbraco package, which you can download and install - try installing it in a fresh umbraco solution. If you also install CWS before installing the package there might be some conflics, but its worth trying out.
Download the package from here: http://c0198291.cdn.cloudfiles.rackspacecloud.com/LinkLists_1.0.zip
Download the complete solution with CWS installed and 2008 database backup: http://c0198291.cdn.cloudfiles.rackspacecloud.com/UmbracoCWS.rar
Hope this does the trick.
- Morten
Maybe I should add that the login to umbraco for the attached db is (u/p): admin / b
When installing you only have to change the connectionstring in the web.config, and you should be up and running.
Again, hope this example gets you on the right path.
- Morten
Hi Morten, Thanks yeah!!! That works fine ;)
Thanks again
Best,
Mario
is working on a reply...