is it possible to make the parent menu not linkable?
#1
Posted 09 January 2008 - 01:02 PM
let's say i have this folder in the main menu: "Products" and some pages(menu items) under it: Product1, Product2, Product3, etc
i could't find a way to make the "Products" folder without its own page.
can this be achieved? how?
#2
Posted 09 January 2008 - 01:30 PM
#3
Posted 09 January 2008 - 01:36 PM
Either uncheck the "show in menu" box for the page or unpublish it (like the repository).
I think i didn't make myself clear enough: i want the menu item to be shown in the main menu, so unpublishing it or hide from menu is not a solution.
i want it to be shown in the menu like this(check the image):
- Templates
-- doc1
-- doc2
-- doc3
-- etc
example.gif 6.05K
12 downloadsWhere Templates is not a link but only doc1, doc2, doc3, etc are links to pages.
so far i couldn't manage to find a way to make "PARENT-ITEM" not linked....
Edited by minadreapta, 09 January 2008 - 01:47 PM.
#4
Posted 09 January 2008 - 02:11 PM
#5
Posted 09 January 2008 - 02:31 PM
#6
Posted 09 January 2008 - 02:34 PM
This issue would need to be handled by the menu snippet... I have done this with some of the menu snippets I have designed... Essentially, what yoy need to do is to have the snippet check to see if the menu entry, in this case the parent folder, document content is empty or not... If there is no content then the link is not created, yet the submenu will be generated as desired... That's how you do it... Just a simple if...then...else type of clause to determine whether to generate the link or just display the menu item...
in deed very very simple
unfortunately i have chosen to use a cms system because my lack of programming skills.
and if i knew how to do it, i wouldn't have opened this thread, right?
to be honest, i was expecting this option to be present in the manager.
could you be more specific?
i am using MollioMainMenu, i really don't know what to do.
any help would be appreciated.
this matter keeps me from using etomite in this moment...
thanks.
#7
Posted 09 January 2008 - 02:36 PM
Ok... I haven't tried this code but it should work as expected... What I did was to add content to the field list of the getActiveChildren() API function call so we can see if there is any content... This needs to be a zero byte count field in order to work properly so you may need to check empty folder documents in HTML mode to assure that they are indeed empty... Next I modified the code which creates the menu items so that it checks to see if the content is empty and if not it creates the menu item link, and if empty it simply creates the menu item text...
// Snippet name: MollioMainMenu
// Snippet description: Outputs the Main Menu for Mollio templates
// Revision: 1.0 ships with Etomite 0.6.1-Final
// Author: Lloyd Borrett - 2006-04-09
//
// Based on elements from the ListSiteMap and ListMenu snippets
// by jaredc@honeydewdesign.com
//
// Modified by Ralph 2008-01-09 to not create active menu links for empty documents
//
// This snippet was designed to show a nested
// list menu with each pagetitle being a
// link to that page. It will not include
// unpublished folders/pages OR its children,
// even if the children ARE published.
// List items are marked with CSS class values of
// active, last or first as appropriate.
// Configuration
// $menuRoot [int]
// The parent ID of your root. Default 0. Can be set in
// snippet call with MMM_root (to doc id 10 for example):
// [[MollioMainMenu?MMM_root=10]]
$menuRoot = 0;
// $titleOfLinks [ string ]
// What database field do you want the title of your links to be?
// it can be any of the following:
// id, pagetitle, description, parent, alias, longtitle.
// If the field you choose is empty for any given document,
// the the pagetitle of the document is used.
$titleOfLinks = 'longtitle';
// $maxLevels [ int ]
// Maximum number of levels to include. The default 2 is the number
// of levels supported by the CSS styles.
// A value of 0 will allow all levels.
// Also settable with snippet variable MMM_levels:
// [[MollioMainMenu?MMM_levels=2]]
$maxLevels = 2;
// ###########################################
// End config, the rest takes care of itself #
// ###########################################
// Initialize
$menuRoot = (isset($MMM_root))? $MMM_root : $menuRoot;
$maxLevels = (isset($MMM_levels))? $MMM_levels : $maxLevels;
// Overcome single use limitation on functions
global $MakeMainMenuDefined;
if(!isset($MakeMainMenuDefined)){
function MakeMainMenu($funcEtomite, $listParent, $listLevel, $titleOfLinks, $maxLevels, $fullGeneology){
$children = $funcEtomite->getActiveChildren($listParent, 'menuindex', 'ASC', 'id, pagetitle, parent, alias, longtitle, content, published');
$childrenCount = count($children);
$ie = "\n";
$pad = str_pad($pad,($listLevel * 2)," ");
// start this level
if ($listLevel == 0) {
$output .= $pad.'<ul id="nav">'.$ie;
} else {
$output .= $pad.'<ul>'.$ie;
}
for($x=0; $x<$childrenCount; $x++) {
$child = $children[$x];
// Is this the current document or an ancestor?
$ancestor = in_array($child['id'], $fullGeneology);
// Set the class to active, last, first or none
if ($ancestor) {
$cssStyle = ' class="active"';
} else {
if (($x+1) == $childrenCount) {
$cssStyle = ' class="last"';
} else {
if ($x == 0) {
$cssStyle = ' class="first"';
} else {
$cssStyle = '';
}
}
}
if ($child[$titleOfLinks] != "") {
$title .= str_replace('"',"'",$child[$titleOfLinks]);
} else {
$title .= str_replace('"',"'",$child['pagetitle']);
}
$output .= $pad.'<li'.$cssStyle.'>';
if($child['content'] != "") $output .= '<a href="[~'.$child['id'].'~]" title="'.$title.'">';
$output .= $child['pagetitle'];
if($child['content'] != "") $output .= '</a>';
if ($funcEtomite->getActiveChildren($child['id']) && (($maxLevels==0) || ($maxLevels > $listLevel+1 ))){
$output .= MakeMainMenu($funcEtomite, $child['id'], $listLevel+1, $titleOfLinks, $maxLevels, $fullGeneology);
}
$output .= '</li>'.$ie;
}
$output .= $pad.'</ul>'.$ie;
return $output;
}
$MakeMainMenuDefined = true;
}
// Create Geneology
$fullGeneology = array();
$geneologyMarker = $etomite->documentIdentifier;
while ($currentMarker=$etomite->getPageInfo($geneologyMarker, null, 'id,parent')){
$fullGeneology[] = $currentMarker['id'];
$geneologyMarker = $currentMarker['parent'];
}
$fullGeneology[] = 0;
return MakeMainMenu($etomite, $menuRoot, 0, $titleOfLinks, $maxLevels, $fullGeneology);
#8
Posted 09 January 2008 - 02:44 PM
#9
Posted 09 January 2008 - 02:52 PM
#10
Posted 09 January 2008 - 02:58 PM
like categories... what's the point in linking a category parent, when there are categories listed under it that have their own pages and descriptions.
instead to be directed to a category, the user is directed to the description page of the parent... he doesn't buy anything from there.... so again, this is confusing, but the other way around...
Edited by minadreapta, 09 January 2008 - 02:59 PM.
#11
Posted 09 January 2008 - 03:49 PM
you are right, but there are things that don't need linking.
like categories... what's the point in linking a category parent, when there are categories listed under it that have their own pages and descriptions.
instead to be directed to a category, the user is directed to the description page of the parent... he doesn't buy anything from there.... so again, this is confusing, but the other way around...
What you're describing is not good usability. Users expect to find the sub options displayed when/if they click on a category. Also, you'd increase your click through this way by having a bulletproof plain html alternative to the javascript/dhtml dropdown menu.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











