Jump to content


[Resolved] Questions from a Newbie =D


  • This topic is locked This topic is locked
17 replies to this topic

#1 bergstenmusic

    Etomite Forum Newbie

  • Member
  • 46 posts

Posted 31 January 2008 - 06:38 PM

I'm sorry if this post is repetitive, but I searched through the previous posts and everyone is using really complicated terminology, so I'm having trouble understanding it.

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 Dean

    Loves Etomite Forums!

  • Admin
  • 4,758 posts
  • Gender:Male

Posted 31 January 2008 - 06:49 PM

Have a look in the template, and it'll show the Snippet that's been used.

If you can't find it, PM me some login specs and I'll help you out.

#3 bergstenmusic

    Etomite Forum Newbie

  • Member
  • 46 posts

Posted 31 January 2008 - 06:51 PM

I see the snippets in the templates-- they're a name surrounded by brackets, but what function do they serve and do I have to make a whole new template for the second folder?

#4 Dean

    Loves Etomite Forums!

  • Admin
  • 4,758 posts
  • Gender:Male

Posted 31 January 2008 - 07:16 PM

I wouldn't think so, copy and paste the template here and I'll tell you what you need to do.

The snippets are what power sites, whether it be menus, contact forms, etc.

#5 bergstenmusic

    Etomite Forum Newbie

  • Member
  • 46 posts

Posted 31 January 2008 - 07:32 PM

Thanks So Much Here's the template code
[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">&nbsp;</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">&nbsp;</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> &nbsp;&nbsp;|&nbsp;&nbsp; <a href="[~115~]">Directions</a> &nbsp;&nbsp;|&nbsp;&nbsp; <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&amp;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 -->
          &copy;[[This Year]] Bergsten Music Co.</div>
        <!--/ FOOTER.fontStyles -->
      </div>
      <!--/ FOOTER.container -->
    </div>
    <!--/ FOOTER -->
  </div>
  <!--/ PAGE -->
</div>
<!--/center-->
</body>
</html>


#6 Ed Headset

    Likes Etomite Forums!

  • Developers
  • PipPip
  • 194 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Etomite, PHP, Ajax.
    3D imaging

Posted 31 January 2008 - 07:52 PM

View Postbergstenmusic, on Jan 31 2008, 07:38 PM, said:

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."

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 bergstenmusic

    Etomite Forum Newbie

  • Member
  • 46 posts

Posted 31 January 2008 - 08:07 PM

Here is one snippet for the side menu, I don't know what to look for, unfortunately.
[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">&nbsp;&raquo;&nbsp;&nbsp;</b> <span style="color: #000;">'.$childrena[$xa]['pagetitle']."</span></a>\n";
            } else {
                $menu .= "<li><a onclick=\"showElement('child-".$currenta."')\">".'<b class="bullet">&nbsp;&raquo;&nbsp;&nbsp;</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">&nbsp;>&nbsp;&nbsp;</b> '.$childrenb[$xb]['pagetitle']."</li>\n";
                } else {
                    $submenu .= "<li><a href=\"[~".$childrenb[$xb]['id']."~]\">".'<b class="subBullet">&nbsp;&raquo;&nbsp;&nbsp;</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">&nbsp;&raquo;&nbsp;&nbsp;--</b> <span style="color: #000;">'.$childrena[$xa]['pagetitle']."</span></a>\n";
            } else {
                $menu .= "<li><a href=\"[~".$childrena[$xa]['id']."~]\">".'<b class="bullet">&nbsp;&raquo;&nbsp;&nbsp;--</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 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 31 January 2008 - 08:07 PM

A good read through the documentation might do some good here...

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 Dean

    Loves Etomite Forums!

  • Admin
  • 4,758 posts
  • Gender:Male

Posted 31 January 2008 - 08:21 PM

Ok, I'm completely confused by what you are trying to achieve now... I thought you were just trying to add another menu?

#10 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 31 January 2008 - 08:33 PM

I'm really not sure what he's trying to do either, but I can see part of why it isn't working... Starting a snippet with $id = 55; is telling the snippet to always start at that exact spot within the document tree... It doesn't matter what you click, the parent level will always be at 55...

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 bergstenmusic

    Etomite Forum Newbie

  • Member
  • 46 posts

Posted 31 January 2008 - 08:54 PM

I think I'm starting to understand a little bit, you guys have been immensely helpful.

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 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 31 January 2008 - 09:09 PM

Here is another tidbit that might help you out... Rather than hard-coding the parent document id into the snippet, why not just send it in a snippet call... That way if you want to call the snippet more than once you can manually define the starting point... To do that you would do something like [!snippet_call?id=55!] for the first call and then something like [!snippet_call?id=68!] for the subsequent call... Notice that I used un-cached snippet calls [!..!] instead of cached snippet calls [[...]] so the menus remain dynamic... Your snippet will automatically get the value of id as it is passed in the snippet call itself so you can eliminate the manual assignment within the snippet code... Not sure if that helps any but by looking at the snippet code it sure wouldn't hurt...

#13 bergstenmusic

    Etomite Forum Newbie

  • Member
  • 46 posts

Posted 31 January 2008 - 09:11 PM

View PostRalph, on Jan 31 2008, 03:33 PM, said:

I'm really not sure what he's trying to do either, but I can see part of why it isn't working... Starting a snippet with $id = 55; is telling the snippet to always start at that exact spot within the document tree... It doesn't matter what you click, the parent level will always be at 55...

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? :P

#14 bergstenmusic

    Etomite Forum Newbie

  • Member
  • 46 posts

Posted 31 January 2008 - 09:15 PM

quick question to add: what does it mean when something is cached or uncached?

#15 bergstenmusic

    Etomite Forum Newbie

  • Member
  • 46 posts

Posted 31 January 2008 - 09:33 PM

I figured everything out and made the necessary modifications to the parts of the site I wanted to change, of course it was something easy that it took me 5 hours to figure out but I did it. I feel really awesome about it.

Thank You SOO much for your help, I'm sure you'll be hearing more questions from me soon... =)

#16 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 31 January 2008 - 09:35 PM

This post has a tutorial (number 2) that explains cached and uncached snippets and the relationship to the document whether it is cached or uncached. Cached documents and snippets are stored in a "text" file which can be retrieved for a faster web page rather than creating it dynamically by running all the database queries and php code to create the same page. Caching makes a page faster, but has some functional drawbacks when you have dynamic content on it like some snippets.

#17 bergstenmusic

    Etomite Forum Newbie

  • Member
  • 46 posts

Posted 31 January 2008 - 09:39 PM

thanks, I'll check it out

#18 Dean

    Loves Etomite Forums!

  • Admin
  • 4,758 posts
  • Gender:Male

Posted 31 January 2008 - 10:01 PM

Glad you got it sorted!

closed as no longer needed



Back to Etomite v0.x Support


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users