Like this:
- level 1 a
-- level 2 a/a
-- level 2 a/b
- level 1 b
-- level 2 b/a
-- level 2 b/b
etc.
with the a's and b's in level to always coresponding to the level 1 item of course.
Edited by Psycho Mantis, 04 October 2005 - 11:16 AM.
Posted 04 October 2005 - 11:15 AM
Edited by Psycho Mantis, 04 October 2005 - 11:16 AM.
Posted 06 January 2006 - 04:27 AM
Posted 20 January 2006 - 03:31 PM
Edited by jaredc, 20 January 2006 - 03:32 PM.
Posted 20 January 2006 - 03:41 PM
It's a style issue. The description is enclosed in a span:I've seen several sites using this snippet where the description gets outputed below the page link instead of directly after it, how can I do this with my own sitemap which uses this snippet?
<span class="LSM_description">...</span>So all you have to do is define in your stylesheet that you want that span displayed as a block.
Yes. There is no config option for this, but the hack is easy enough. Change this line (about 75):Is there a way to make the snippet list the sites alphabetically?
$children = $funcEtomite->getAllChildren($listParent, 'menuindex', 'ASC', 'id, pagetitle, description, parent, alias, longtitle, published');To:
$children = $funcEtomite->getAllChildren($listParent, 'pagetitle', 'ASC', 'id, pagetitle, description, parent, alias, longtitle, published');
Posted 15 April 2006 - 12:12 AM
// --------------------
// Snippet: ListSiteMap
// --------------------
// Version: 0.6i
// Date: 2005.07.08
// jaredc@honeydewdesign.com
//
// This snippet was designed to show a nested
// list site map 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.
// 0.6i changes by Lloyd Borrett - 2006-04-15
// Strip " out of title attributes
// Fixed problems with removeNewLine and selfAsLink
// Added show description as a parameter
// Config
 // $siteMapRoot [int]
 // The parent ID of your root. Default 0. Can be set in
 // snippet call with LSM_root (to doc id 10 for example):
 // [[ListSiteMap?LSM_root=10]]
 $siteMapRoot = 0;
 // $showDescription [true | false]
 // Specify if you would like to include the description
 // with the page title link. Can be set in snippet call
 // with LSM_desc as 1 for true or 0 for false
 // [[ListSiteMap?LSM_desc=0]]
 $showDescription = false;
 // $titleOfLinks [ string ]
 // What database field do you want the title of your links to be?
 // The default is pagetitle because it is always a valid (not empty)
 // value, but if you prefer it can be any of the following:
 // id, pagetitle, description, parent, alias, longtitle
 $titleOfLinks = 'pagetitle';
Â
 // $removeNewLines [ true | false ]
 // If you want new lines removed from code, set to true. This is generally
 // better for IE when lists are styled vertically.
 $removeNewLines = true;
Â
 // $maxLevels [ int ]
 // Maximum number of levels to include. The default 0 will allow all
 // levels. Also settable with snippet variable LSM_levels:
 // [[ListSiteMap?LSM_levels=2]]
 $maxLevels = 0;
Â
 // $selfAsLink [ true | false ]
 // Define if the current page should be a link (true) or not (false)
 $selfAsLink = true;
Â
 // $showUnpubs [ true | false ]
 // Decide to include items in unpublished folders. This will show the
 // unpublished items as well. No links will be made for the unpublished items
 // but they will be shown in the structure. You will not likely want to do
 // this but the option is yours.
 $showUnpubs = false;
// Styles
//
// .LSM_currentPage   span surrounding current page if $selfAsLink is false
// .LSM_unpubPage    span surrounding unpublished page
// .LSM_description   description of page
// .LSM_N Â Â Â Â Â Â Â ul style where N is the level of nested list- starting at 0
// ###########################################
// End config, the rest takes care of itself #
// ###########################################
// Initialize
$siteMapRoot = (isset($LSM_root))? $LSM_root : $siteMapRoot;
$maxLevels = (isset($LSM_levels))? $LSM_levels : $maxLevels;
if (isset($LSM_desc)) {
 if ($LSM_desc == '0') {
  $showDescription = false;
 } else if ($LSM_desc == '1') {
  $showDescription = true;
 }
}
$ie = ($removeNewLines)? '' : "\n";
// Overcome single use limitation on functions
global $MakeMapDefined;
if(!isset($MakeMapDefined)){
 function MakeMap($funcEtomite, $listParent, $listLevel, $description, $titleOfLinks,$maxLevels,$su,$ie,$selfAsLink){
  $children = $funcEtomite->getAllChildren($listParent, 'menuindex', 'ASC', 'id, pagetitle, description, parent, alias, longtitle, published');
  $output .= '<ul class="LSM_'.$listLevel.'">'.$ie;
  foreach($children as $child){
 Â
   // skip unpubs unless desired
   if (!$su && !$child['published']) continue;
  Â
   $descText = ($description)? ' <span class="LSM_description">'.$child['description'].'</span>' : '';
   $output .= '<li>';
   if (!$selfAsLink && ($child['id'] == $funcEtomite->documentIdentifier)){
    $output .= '<span class="LSM_currentPage">'.$child['pagetitle'].'</span>';
   } else if (!$child['published']){
    $output .= '<span class="LSM_unpubPage">'.$child['pagetitle'].'</span>';
   } else {
    $output .= '<a href="[~'.$child['id'].'~]" title="'.str_replace('"',"'",$child[$titleOfLinks]).'">'.$child['pagetitle'].'</a>';
   }
   $output .= $descText;
   if ($funcEtomite->getAllChildren($child['id']) && (($maxLevels==0) || ($maxLevels > $listLevel+1 ))){
    $output .= MakeMap($funcEtomite,$child['id'],$listLevel+1,$description,$titleOfLinks,$maxLevels,$su,$ie,$selfAsLink);
   }
   $output .= '</li>'.$ie;
  }
  $output .= '</ul>'.$ie;
  return $output;
 }
 $MakeMapDefined = true;
}
return MakeMap($etomite, $siteMapRoot, 0, $showDescription, $titleOfLinks,$maxLevels,$showUnpubs,$ie,$selfAsLink);Edited by lloyd_borrett, 15 April 2006 - 12:13 AM.
Posted 21 April 2006 - 09:40 PM
Sitemap.zip 5.25KB
121 downloads
Edited by lloyd_borrett, 10 September 2007 - 09:57 PM.
Posted 21 April 2006 - 11:22 PM
Posted 22 April 2006 - 12:53 AM
Posted 10 June 2006 - 11:38 AM
Edited by 0zz, 10 June 2006 - 11:40 AM.
Posted 10 June 2006 - 11:48 AM
// $showUnpubs [ true | false ] // Decide to include items in unpublished folders. This will show the // unpublished items as well. No links will be made for the unpublished items // but they will be shown in the structure. You will not likely want to do // this but the option is yours. $showUnpubs = false;
Posted 10 June 2006 - 11:50 AM
Posted 10 June 2006 - 03:00 PM
Posted 20 December 2006 - 03:22 PM
// Config
// $siteMapRoot [int]
// The parent ID of your root. Default 0. Can be set in
// snippet call with LSM_root (to doc id 10 for example):
// [[ListSiteMap?LSM_root=10]]
$siteMapRoot = 56;
// $showDescription [true | false]
// Specify if you would like to include the description
// with the page title link.
$showDescription = false;
// $titleOfLinks [ string ]
// What database field do you want the title of your links to be?
// The default is pagetitle because it is always a valid (not empty)
// value, but if you prefer it can be any of the following:
// id, pagetitle, description, parent, alias, longtitle
$titleOfLinks = 'pagetitle';
// $removeNewLines [ true | false ]
// If you want new lines removed from code, set to true. This is generally
// better for IE when lists are styled vertically.
$removeNewLines = false;
// $maxLevels [ int ]
// Maximum number of levels to include. The default 0 will allow all
// levels. Also settable with snippet variable LSM_levels:
// [[ListSiteMap?LSM_levels=2]]
//$maxLevels = 0;
// $selfAsLink [ true | false ]
// Define if the current page should be a link (true) or not
// (false)
$selfAsLink = true;
// $showUnpubs [ true | false ]
// Decide to include items in unpublished folders. This will show the
// unpublished items as well. No links will be made for the unpublished items
// but they will be shown in the structure. You will not likely want to do
// this but the option is yours.
$showUnpubs = false;
// Styles
//
// .LSM_currentPage span surrounding current page if $selfAsLink is false
// .LSM_description description of page
// .LSM_N ul style where N is the level of nested list- starting at 0
// ###########################################
// End config, the rest takes care of itself #
// ###########################################
// Initialize
$siteMapRoot = (isset($LSM_root))? $LSM_root : $siteMapRoot;
$maxLevels = (isset($LSM_levels))? $LSM_levels : $maxLevels;
$ie = "";
// Overcome single use limitation on functions
global $MakeMapDefined;
if(!isset($MakeMapDefined)){
function MakeMap($funcEtomite, $listParent, $listLevel, $description, $titleOfLinks,$maxLevels,$su){
$children = $funcEtomite->getAllChildren($listParent, 'menuindex', 'ASC', 'id, pagetitle, description, parent, alias, longtitle, published, deleted');
// $output .= "" . '<ul class="navlist'.$listLevel.'">'.$ie;
foreach($children as $child){
// skip unpubs unless desired
if (!$su && !$child['published']) continue;
if($child['deleted']) continue;
$descText = ($description)? ' <span class="LSM_description">'.$child['description'].'</span>' : '';
//$output .= '<li class="level' . $listLevel . '">';
if($child['id'] == $funcEtomite->documentIdentifier){
$aktiverlink = ' activel' . $listLevel;
}
if (!$selfAsLink && ($child['id'] == $funcEtomite->documentIdentifier)){
$output .= '<li class="level' . $listLevel . $aktiverlink . '"><a href="' . '[~'. $child['id'].'~]' . '" title="'.$child[$titleOfLinks].'">'.$child['pagetitle'].'</a></li>'."\n";
} else if (!$child['published']){
$output .= $child['pagetitle'];
}else{
$output .= '<li class="level' . $listLevel . '"><a href="' . '[~'. $child['id'].'~]' . '" title="'.$child[$titleOfLinks].'">'.$child['pagetitle'].'</a></li>'."\n";
}
$output .= $descText;
if ($funcEtomite->getAllChildren($child['id']) && (($maxLevels==0) || ($maxLevels > $listLevel+1 ))){
$output .= MakeMap($funcEtomite,$child['id'],$listLevel+1,$description,$titleOfLinks,$maxLevels,$su);
}
//$output .= '</li>'."\n";
}
// $output .= '</ul>'.$ie;
return $output;
}
$MakeMapDefined = true;
}
return MakeMap($etomite, $siteMapRoot, 0, $showDescription, $titleOfLinks,$maxLevels,$showUnpubs);Posted 20 December 2006 - 04:07 PM
Posted 02 March 2007 - 09:34 AM
/**
* --------------------
* Snippet: ListSiteMap
* --------------------
* Version: 0.6j
* Date: 2007-03-02
* Original author: jaredc@honeydewdesign.com 2005-07-08
* This snippet was designed to show a nested
* list site map 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.
* Changes by Lloyd Borrett
* Version: 0.6i-starscribe 2006-04-21
* Adapted for use with Mollio-ScubaDoc templates
* Strip " out of title attributes
* Fixed problems with removeNewLine and selfAsLink
* Added show description as a parameter
* Version: 0.6j 2007-03-02
* Modified to not list deleted documents
*/
// Config
// $siteMapRoot [int]
// The parent ID of your root. Default 0. Can be set in
// snippet call with LSM_root (to doc id 10 for example):
// [[ListSiteMap?LSM_root=10]]
$siteMapRoot = 0;
// $showDescription [true | false]
// Specify if you would like to include the description
// with the page title link. Can be set in snippet call
// with LSM_desc as 1 for true or 0 for false
// [[ListSiteMap?LSM_desc=0]]
$showDescription = true;
// $titleOfLinks [ string ]
// What database field do you want the title of your links to be?
// The default is pagetitle because it is always a valid (not empty)
// value, but if you prefer it can be any of the following:
// id, pagetitle, description, parent, alias, longtitle
$titleOfLinks = 'pagetitle';
// $removeNewLines [ true | false ]
// If you want new lines removed from code, set to true. This is generally
// better for IE when lists are styled vertically.
$removeNewLines = false;
// $maxLevels [ int ]
// Maximum number of levels to include. The default 0 will allow all
// levels. Also settable with snippet variable LSM_levels:
// [[ListSiteMap?LSM_levels=2]]
$maxLevels = 0;
// $selfAsLink [ true | false ]
// Define if the current page should be a link (true) or not (false)
$selfAsLink = true;
// $showUnpubs [ true | false ]
// Decide to include items in unpublished folders. This will show the
// unpublished items as well. No links will be made for the unpublished items
// but they will be shown in the structure. You will not likely want to do
// this but the option is yours.
$showUnpubs = false;
// Styles
// .LSM_currentPage span surrounding current page if $selfAsLink is false
// .LSM_unpubPage span surrounding unpublished page
// .LSM_description description of page
// .LSM_N ul style where N is the level of nested list- starting at 0
// ###########################################
// End config, the rest takes care of itself #
// ###########################################
// Initialize
$siteMapRoot = (isset($LSM_root))? $LSM_root : $siteMapRoot;
$maxLevels = (isset($LSM_levels))? $LSM_levels : $maxLevels;
if (isset($LSM_desc)) {
if ($LSM_desc == '0') {
$showDescription = false;
} else if ($LSM_desc == '1') {
$showDescription = true;
}
}
$ie = ($removeNewLines)? '' : "\n";
// Overcome single use limitation on functions
global $MakeMapDefined;
if (!isset($MakeMapDefined)) {
function MakeMap($funcEtomite, $listParent, $listLevel, $description, $titleOfLinks, $maxLevels, $su, $ie, $selfAsLink)
{
$children = $funcEtomite->getAllChildren($listParent, 'menuindex', 'ASC', 'id, pagetitle, description, parent, alias, longtitle, published, deleted');
if ($listLevel == 0) {
$output .= '<ul class="last">' . $ie;
} else {
$output .= '<ul>' . $ie;
}
$lastChild = count($children);
$thisChild = 0;
foreach($children as $child) {
$thisChild++;
// skip unpubs unless desired
if ((!$su && !$child['published']) || $child['deleted']) continue;
// has children?
$hasChildren = $funcEtomite->getAllChildren($child['id']);
$descText = ($description)? $child['description'] : '';
if (($thisChild == $lastChild) && ($listLevel != 0)) {
$output .= '<li class="last">';
} else {
$output .= '<li>';
}
// if (!$selfAsLink && ($child['id'] == $funcEtomite->documentIdentifier)){
// $output .= '<span class="LSM_currentPage">'.$child['pagetitle'].'</span>';
// } else if (!$child['published']){
// $output .= '<span class="LSM_unpubPage">'.$child['pagetitle'].'</span>';
// } else {
$output .= '<a href="[~' . $child['id'] . '~]"';
$output .= ' title="' . trim(str_replace('"', "'", $child[$titleOfLinks])) . '"';
if ($hasChildren) {
$output .= ' class="folder"';
}
$output .= '>' . $child['pagetitle'] . '</a>';
// }
if ($descText != '') {
$output .= ' <small>' . $descText . '</small>';
}
if ($hasChildren && (($maxLevels == 0) || ($maxLevels > $listLevel + 1))) {
$output .= MakeMap($funcEtomite, $child['id'], $listLevel + 1, $description, $titleOfLinks, $maxLevels, $su, $ie, $selfAsLink);
}
$output .= '</li>' . $ie;
}
$output .= '</ul>' . $ie;
return $output;
}
$MakeMapDefined = true;
}
$output = '<div id="sitemap">' . $ie;
$output .= MakeMap($etomite, $siteMapRoot, 0, $showDescription, $titleOfLinks, $maxLevels, $showUnpubs, $ie, $selfAsLink);
$output .= '</div> <!-- end sitemap -->' . $ie;
return $output;Edited by lloyd_borrett, 02 March 2007 - 09:36 AM.
Posted 02 March 2007 - 03:47 PM
Wouldn't it have been easier to just change getAllChildren() to getActiveChildren() as, if I'm not mistaken, has been mentioned elsewhere...???G'day,
While starting on a new site today, I noticed that the ListSiteMap snippet lists deleted documents. So I've produced this version which doesn't include deleted documents and their children in the list.<<< SNIP >>>
Best Regards, Lloyd Borrett.
Posted 02 March 2007 - 03:50 PM
Seems like the "$ie" (or "$removeNewLines") is not set/processed as suggested.Missing argument 8 for MakeMap(), called in /.../index.php(591) : eval()'d code on line 109
Posted 02 March 2007 - 04:17 PM
Posted 02 March 2007 - 04:40 PM
The ListSiteMap-Snippet that ships with etomite does not generate any "fieldset" at all.I've been using a version of this snippet that is more semantic, using ul, li, and h1, h2, etc for the formatting instead of the fieldsets.
<ul> <li> <a href="#">Content</a> <ul></ul> </li> </ul>That happens if pages do not have any child. Empty <ul> elements are not allowed in XHTML1.1, so the above code is not valid. Maybe one could also adress this issue while modifying this snippet. I will take a look at this.
Posted 02 March 2007 - 06:33 PM
<ul></ul>problem soon.
0 members, 0 guests, 0 anonymous users