I need to support a site made using umbraco. am a total newbie in umbraco. let me explain my scenario. I have left have menu which is used to navigate to different pages. Now i need to change one menu item to navigate to a different page. How is this posible?
It is using macro to create the main menu. The master page shows it has macro DisplayMainMenu. This macro uses XSLT file DisplayMainMenu. Am attaching the xslt code herewith:
<div id="main_navigation" class="jqueryslidemenu unitPng">
<ul>
<li>Home</li>
<xsl:for-each select="$pagesNodeSet">
<xsl:sort select="./#sortOrder" data-type="text" order="ascending"/>
<li>
<xsl:value-of select="./title"/>
<xsl:if test="count(./*[#isDoc and string(umbracoNaviHide) != '1' and string(includeInMainNavigation) = '1']) > 0">
<ul class="sub-menu">
<xsl:for-each select="./*[#isDoc and string(umbracoNaviHide) != '1' and string(includeInMainNavigation) = '1']">
<xsl:sort select="./#sortOrder" data-type="text" order="ascending"/>
<li><xsl:value-of select="./title"/></li>
</xsl:for-each>
</ul>
</xsl:if>
</li>
</xsl:for-each>
</ul>
</div>
Some code part couldnot be included due to some issues with formatting.
Your xslt is dynamically creating the menu based on your site layout as defined in the content section of the umbraco dashboard. Therefore you can't "change a menu item to point to a different page" as such. What you can do is change you site structure to reflect what you want by adding new pages, moving existing pages or removing unwanted pages.
If you want to add a static page link you can do this by adding it to your xslt above (in the same way the 'Home' link has been added) but you will need to ensure that is sits outside the xslt:for-each loop unless you want to get into some complex xslt coding.
Essentially, what the above code is doing is creating an unorderd list with the first list item statically added for the home page. It is then looping each of the child pages and adding a link. Then for each child page ,if it has visible child pages (by ensuring they are not supposed to be hidden and should be included in the main navigation using their umbracoNaviHide and includeInMainNavigation properties), it is looping over each of them and displaying a link.
Related
I am using Dotclear blog software, which provide a widget for the blog categories with a resulting code looking like this:
<div class="widget categories ">
<h3>Catégories</h3>
<ul>
<li>Cat1</li>
<li>Cat2
<ul>
<li>Subcat1</li>
</ul>
</li>
<li>Cat3
<ul>
<li>Subcat2</li>
</ul>
</li>
<li>Cat4</li>
</ul>
</div>
What I am trying to achieve here is using the <a> tag (for Cat2 or Cat3) as header (or a dynamically added <h4> around it) and fold the subcategory list. If I call the accordion like this :
$(".categories").accordion({
header: "li:has(ul) > a",
});
the accordion does work, but when I click on the link it just folds/unfolds the item and doesn’t let me go to the link target (the category page, that is).
I tried wrapping the <a> in an <h4> tag and use that tag as header, but it doesn’t seem to make a difference. Is there a way to do what I seek or should I abandon the idea of collapsing subcategories and have functioning links within the header ?
Thanks for your time.
Well, after reading your comments, I realized I was using the wrong tool to achieve my objective. I have replaced jquery-ui’s accordion with a treemenu jQuery plugin which is actually made for my use. Sorry to have wasted your time and thanks for your kind answers.
I have created menus in Neos backend. Each menu node corresponds to a plugin of a controlleraction.
These controller actions are defined in policy.yaml as resources with their flow access policy roles.
The template for menu is defined in root.ts2 which i took a copy from Typo3.NeosDemoTypo3Org package.
mainMenu part of root.ts2 is
mainMenu = Menu {
entryLevel = 1
templatePath = 'resource://ABC.Demo/Private/Templates/TypoScriptObjects/MainMenu.html'
maximumLevels = 3
site = ${site}
}
MainMenu.html is:
<div class="collapse navbar-collapse navbar-main-collapse">
<ul class="nav nav-pills nav-justified">
<f:for each="{items}" as="item" iteration="menuItemIterator">
<f:then>
<li class="active">
<neos:link.node node="{item.node}">{item.label}</neos:link.node>
</li>
</f:then>
<f:else>
<li>
<neos:link.node node="{item.node}">{item.label}</neos:link.node>
</li>
</f:else>
</f:if>
</f:for>
</ul>
</div>
If I use {parts.mainMenu -> f:format.raw()} in Default.html, it prints all the menu items defined at root of Neos site.
How can i show only those menu items in main menu of webpage for which the user has access to the corresponding resource defined in policy.yaml.
Can anybody give an idea, the way to achieve it.
You should set the access protection on the page node. Currently there no interface for this yet, but you can define access roles for the nodes in the database. See table:
typo3_typo3cr_domain_model_nodedata field accessroles.
It should be a serialized array of role names.
This will then correctly reflect in the menu. And don't forget to set the TYPO3.Neos:Editor role as well otherwise editors won't be able to modify those pages.
It would be quite complicated to fetch the plugins from each page and do access checks against them but that could of course be another option. I cannot directly give you any hints for that thou, because the node type would be different for each page, depending on the plugin.
I'm using the jquery Mobile AutoDivider for a web project of mine and it works great in IE8, but for some reason in Chrome it's not generating the headers for me.
My question is: How exactly does the AutoDivider determine what to make a 'divider'? Is is just the first item within your <li></li>?
Here's my basic HTML structure (it's ultimately placed in a ASP.Net Repeater:
<ul data-role="listview" data-autodividers="true">
<li>
<img src="mySource.jpg" alt="" />
<h3>John Doe</h3>
<p><strong>Company Name Here</strong></p>
<p>User Address</p>
<p class="ui-li-aside">
<strong style="display: none;"><!-- This is what seems to make the headers in IE, placing this right here: -->
Last Name of Employee</strong>
</p>
</li>
</ul>
see the docu http://jquerymobile.com/demos/1.2.0/docs/lists/docs-lists.html
Autodividers
A listview can be configured to automatically generate dividers for its items. This is
done by adding a data-autodividers="true" attribute to any listview.
By default, the text used to create dividers is the uppercased first letter of the
item's text. Alternatively you can specify divider text by setting the > autodividersSelector option on the listview programmatically.
I like to know if it is posible disable the error messages that appear at the bottom of the page when I have some JSF syntax error:
<ul title="Project Stage[Development]: Unhandled Messages"
id="javax_faces_developmentstage_messages">
<li style="Color: orange">
The button/link/text component needs to have a Form in its ancestry. Please
add <h:form>.
</li>
</ul>
And you can't say "add the form tag".
Remove the <context-param> with name of javax.faces.PROJECT_STAGE from your web.xml, or set its value to Production instead of Development.
See also:
The form component needs to have a UIForm in its ancestry. Suggestion: enclose the necessary components within <h:form>
Using uCommerce 2, umbraco 4.7.
I have a category side nav showing the categories using:
<a>
<xsl:attribute name="href">
<xsl:value-of select="CommerceLibrary:GetNiceUrlForCategory($catalogueName, #id)"/>
</xsl:attribute>
<xsl:value-of select="#displayName"/>
</a>
First of all, when hovering over the links it still shows an old catalogue name, even though I've renamed the catalogue and also hardcoded the catalogue name into:
<xsl:variable name="catalogueName" select="'MyCatalogue'"/>
When I click on the link generated by GetNiceUrlForCategory I get the standard template that comes with uCommerce started site. I've tried deleting the whole started site, but I just can't get it to link to a template I did for the category.
I still don't quite understand how ucommerce knows which template to use for a category link.
Soren? :)
Cheers,
Matt
Found answer: Change in UrlRewriting.config ... simpelz