[Resolved] Questions from a Newbie =D
#1
Posted 31 January 2008 - 06:38 PM
Can someone please explain to me what a snippet is and how it works when editing a document. Does it need to be inserted into a template, or can I use it in a regular document or parent folder? The company that set up our website I think may have used one to create the menu described below.
There is a snippet that a web company designed for us specifically that has a menu bar on the side with the folder name and links to the child documents on our page entitled "Backline." I want to do the same thing for the parent "Pro Audio" but when I click on it, the menu bar and highlighted parent section at the top of the page stay on backline, while the display on the right of the page displays the info for "Pro Audio."
Thanks! I would reeeeeally love some help on this one, just remember I'm new to all the lingo, but I do catch on pretty quick.
#2
Posted 31 January 2008 - 06:49 PM
If you can't find it, PM me some login specs and I'll help you out.
#3
Posted 31 January 2008 - 06:51 PM
#4
Posted 31 January 2008 - 07:16 PM
The snippets are what power sites, whether it be menus, contact forms, etc.
#5
Posted 31 January 2008 - 07:32 PM
[codebox]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>[*description*] | Bergsten Music Co.</title>
<link href="bmi.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div align="center">
<div id="PAGE">
<div id="BODYCONTAINER">
<div class="relative">
<!--<div class="flash01">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="214" height="202" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="flash/set1.swf" />
<param name="quality" value="high" />
<param name="scale" value="noscale" />
<param name="wmode" value="transparent" />
<param name="bgcolor" value="#ffffff" />
<embed src="flash/set1.swf" quality="high" scale="noscale" wmode="transparent" bgcolor="#ffffff" width="214" height="202" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>
</object>
</div>-->
<!--/ BODYCONTAINER.flash01 -->
<!--<div class="flash02">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="214" height="202" id="flashLayer01" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="flash/set2.swf" />
<param name="quality" value="high" />
<param name="scale" value="noscale" />
<param name="wmode" value="transparent" />
<param name="bgcolor" value="#ffffff" />
<embed src="flash/set2.swf" quality="high" scale="noscale" wmode="transparent" bgcolor="#ffffff" width="214" height="202" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>
</object>
</div>-->
<!--/ BODYCONTAINER.flash02 -->
<!--<div class="flash03">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="214" height="202" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="flash/set3.swf" />
<param name="quality" value="high" />
<param name="scale" value="noscale" />
<param name="wmode" value="transparent" />
<param name="bgcolor" value="#ffffff" />
<embed src="flash/set3.swf" quality="high" scale="noscale" wmode="transparent" bgcolor="#ffffff" width="214" height="202" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>
</object>
</div>-->
<div class="staticphoto">
[[Header Image]]
</div><!--/ BODYCONTAINER.flash03 -->
</div>
<!--/ BODYCONTAINER.relative -->
<img src="images/flashHeader.jpg" alt="Bergsten Music Co. - Instrument rental services for the professional musician" width="941" height="235" />
<div id="NAVCONTAINER">
<ul id="NAVLIST">
[[Top Navigation Instruments]]
</ul>
<br class="clear" />
</div>
<!--/ NAVCONTAINER -->
<div id="DIVIDER"> </div>
<!--/ DIVIDER -->
<div id="CONTENTFRAME">
<div id="LEFTNAV">
<div class="container">
[[aListApart?id=55]]
<!--/ center -->
</div>
<!--/ LEFTNAV.container -->
</div>
<!--/ LEFTNAV -->
<div id="CONTENT">
<div class="container">
<h1>[*pagetitle*]</h1>
[*content*]
</div>
<!--/ CONTENT.container -->
</div>
<!--/ CONTENT -->
<div class="clear"> </div>
<!--/ clear -->
</div>
<!--/CONTENTFRAME -->
</div>
<!--/ BODYCONTAINER -->
<!-- FOOTER -->
<div id="FOOTER" align="center">
<div class="container">
<div class="fontStyles">
<div class="floatRight"><a href="[~54~]">Home</a> | <a href="[~115~]">Directions</a> | <a href="[~114~]">E-mail Us</a> </div>
<!--/ FOOTER.floatRight -->
<strong>Bergsten Music</strong> | 781-740-6600</div>
<!--/ FOOTER.fontStyles -->
</div>
<!--/ FOOTER.container -->
<div class="container2">
<div class="fontStyles2">
<div class="floatRight"><a href="http://www.indigodigital.com/?referral=bmi&mcode=bottomnav"><img src="images/built-by-indigo.gif" title="Indigo Digital provides web design, internet marketing, search engine optimization, programming and ecommerce services to companies of all sizes." alt="Indigo Digital provides web design, internet marketing, search engine optimization, programming and ecommerce services to companies of all sizes." width="122" height="42" border="0" /></a></div>
<!--/ FOOTER.floatRight -->
©[[This Year]] Bergsten Music Co.</div>
<!--/ FOOTER.fontStyles -->
</div>
<!--/ FOOTER.container -->
</div>
<!--/ FOOTER -->
</div>
<!--/ PAGE -->
</div>
<!--/center-->
</body>
</html>#6
Posted 31 January 2008 - 07:52 PM
bergstenmusic, on Jan 31 2008, 07:38 PM, said:
I might me misunderstanding this but I think it's not a template issue
If you ask me it's in the menu snippet.
I think it's set in the menu snippet,
It seems to load the selected page into a frame, and not a new "blank" page.
Look in the snippet to see if you are able to load a menu-page onto a new page
aka target ="_new" or "_self" if you want to use the same page.
I hope this helps
#7
Posted 31 January 2008 - 08:07 PM
[codebox]
$id = 55;
$thispage = $etomite->documentIdentifier;
function getTheList($thisfunction,$id,$thispage) {
$childrena = $thisfunction->getActiveChildren($id);
$menu = "";
$childrenCounta = count($childrena);
if($childrena==false) {
return false;
}
for($xa=0; $xa<$childrenCounta; $xa++) {
$currenta = $childrena[$xa]['id'];
$childrenb = $thisfunction->getActiveChildren($currenta);
$childrenCountb = count($childrenb);
if($childrenCountb) {
if($currenta == $thispage) {
$menu .= "<li><a onclick=\"showElement('child-".$currenta."')\">".'<b class="bulleton"> » </b> <span style="color: #000;">'.$childrena[$xa]['pagetitle']."</span></a>\n";
} else {
$menu .= "<li><a onclick=\"showElement('child-".$currenta."')\">".'<b class="bullet"> » </b> '.$childrena[$xa]['pagetitle']."</a>\n";
}
//$childrenb = $thisfunction->getActiveChildren($currenta);
$submenu = "<ul class=\"sidechild\" id=\"child-".$currenta."\">";
//$childrenCountb = count($childrenb);
if($childrenb==false) {
return false;
}
for($xb=0; $xb<$childrenCountb; $xb++) {
if($childrenb[$xb]['parent'] = 1 || $currentb == $thispage) {$flag = "true";} else {$flag = "";}
$currentb = $childrenb[$xb]['id'];
if($currentb == $thispage) {
$submenu .= "<li>".'<b class="subBullet"> > </b> '.$childrenb[$xb]['pagetitle']."</li>\n";
} else {
$submenu .= "<li><a href=\"[~".$childrenb[$xb]['id']."~]\">".'<b class="subBullet"> » </b> '.$childrenb[$xb]['pagetitle']."</a>".$flag."--".$currentb."</li>\n";
}
//$childrenc = $thisfunction->getActiveChildren($currentb);
//$childrenCountc = count($childrenc);
//if($childrenCountc) {
//$menu .= getTheList($etomite,$current);
//$menu .= $childrenCountc;
//}
}
$submenu .= "</li>\n";
$submenu .= "</ul>\n";
$menu .= $submenu;
} else {
if($currenta == $thispage) {
$menu .= "<li><a href=\"[~".$childrena[$xa]['id']."~]\">".'<b class="bulleton"> » --</b> <span style="color: #000;">'.$childrena[$xa]['pagetitle']."</span></a>\n";
} else {
$menu .= "<li><a href=\"[~".$childrena[$xa]['id']."~]\">".'<b class="bullet"> » --</b> '.$childrena[$xa]['pagetitle']."</a>\n";
}
}
}
$menu .= "</li>\n";
$menu .= "</ul>\n";
return $menu.$flag."--".$thispage;
}
return '<ul class="sidemenu">'.getTheList($etomite,$id,$thispage).$flag;and here is the other it may be in:
[codebox]
$id = 0;
$thispage = $etomite->documentIdentifier;
$children = $etomite->getActiveChildren($id); $menu = ""; $childrenCount = count($children);
if($children==false) {
return false;
}
for($x=0; $x<$childrenCount; $x++) {
$current = $children[$x]['id'];
if($current == "55") {
$menu .= "<li class=\"select\">".$children[$x]['pagetitle']."</li>\n";
} else {
$menu .= "<li><a href=\"[~".$children[$x]['id']."~]\" title=\"".$children[$x]['description']."\">".$children[$x]['pagetitle']."</a></li>\n";
}
}
return $menu;#8
Posted 31 January 2008 - 08:07 PM
Templates are only used for the layout of major sections of your site... If the entire site has the same basic format, then a single template is all that is needed... If the overall format of different sections of the site differe, then several templates may be required... Templates can contain [[cached-snippets]], [!un-cached-snippets!], and {{chunks}}, along with any other standard markup, including Javascript...
Documents are intended to be used for each specific page on your site... They can also contain [[cached-snippets]], [!un-cached-snippets!], and {{chunks}}, but should not contain direct Javascript... To use Javascript within documents you are better off storing the Javascript code in a Chunk and calling it in that way...
From here is gets complicated... Snippets can call Chunks or other Snippets, using API function calls... Chunks can also call Snippets and other Chunks, but there are some limitations that I won't go into here...
The best advice I can offer is to dig through the default resources which came with the install... Then maybe take a peek at some of the resources in the Snippet Library here on this site... And if you really want to get confused, try checking out my two development sites at http://dahlgren.slyip.com and http://ralphdahlgren.com where you will find some example code and tutorials... We're here to help point you in the right direction if you are willing to go out on your own rather than just expecting answers - but it sounds liek you're already dinning in... Good luck and welcome to Etomite...
#9
Posted 31 January 2008 - 08:21 PM
#10
Posted 31 January 2008 - 08:33 PM
Another hint, not that it will help you out of your immediate dilemma, is that by placing global $etomite; within a function inside a snippet will allow the function to use the global class object $etomite properly... There really is no need to send it in the snippet call as a variable - something we didn't realize in earlier releases and I'm sure there are still snippets kicking around that use the more awkward method of passing the object as a variable... This causes a great performance hit with all releases of PHP prior to PHP5...
#11
Posted 31 January 2008 - 08:54 PM
to reiterate, I'm trying to create a separate side menu on the site listing the children (as links to their respective pages) like one on a similar parent page. To acheive this, the page developers I think used a template or snippett, but I can' figure out how to translate this to the other page to display it's separate data.
I'm going to try and play around a bit with what you guys already told me, I haven't had any luck and I've been working on this since this morning (I'm sure its something silly too) but I'll try some other advice you guys gave me. Luckily etomite is pretty forgiving when mistakes are made =)
#12
Posted 31 January 2008 - 09:09 PM
#13
Posted 31 January 2008 - 09:11 PM
Ralph, on Jan 31 2008, 03:33 PM, said:
That was it!!!! I changes the value from 55 to the 103 ( the value corresponding with the other parent folder and voila! I had a side menu with the children listed with links to their respetive pages...
Although in the top menu, the old parent folder is highlighted still, not the new one...
any suggestions?
#14
Posted 31 January 2008 - 09:15 PM
#15
Posted 31 January 2008 - 09:33 PM
Thank You SOO much for your help, I'm sure you'll be hearing more questions from me soon... =)
#16
Posted 31 January 2008 - 09:35 PM
#17
Posted 31 January 2008 - 09:39 PM
#18
Posted 31 January 2008 - 10:01 PM
closed as no longer needed


This topic is locked








