We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26363
    • 6 Posts
    Hey folks need a little help because i’m sticking to a problem with the archivist tpl chunk concerning an accordion menu.

    ok lets start from the beginning. I managed to integrate this bullet list accordion menu http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu-bullet.htm from dynamicdrive with this http://wiki.modxcms.com/index.php/Accordion_menu_with_Wayfinder related tutorial into my modx revolution site: http://v5.nappel.de/28/44.html

    wfStyle (comming from my bullet_acc_list.css):
    @charset "utf-8";
    /* CSS Document */
    
    .arrowlistmenu{
    width: 180px; /*width of accordion menu*/
    }
    
    .arrowlistmenu .menuheader{ /*CSS class for menu headers in general (expanding or not!)*/
    font: bold 14px Arial;
    color: white;
    background: black url(../../snippets/bullet_accordion_menu/titlebar.png) repeat-x center left;
    margin-bottom: 10px; /*bottom spacing between header and rest of content*/
    text-transform: uppercase;
    padding: 4px 0 4px 10px; /*header text is indented 10px*/
    cursor: hand;
    cursor: pointer;
    }
    
    .arrowlistmenu .openheader{ /*CSS class to apply to expandable header when it's expanded*/
    background-image: url(../../snippets/bullet_accordion_menu/titlebar-active.png);
    }
    
    .arrowlistmenu ul{ /*CSS for UL of each sub menu*/
    list-style-type: none;
    margin: 0;
    padding: 0;
    margin-bottom: 8px; /*bottom spacing between each UL and rest of content*/
    }
    
    .arrowlistmenu ul li{
    padding-bottom: 2px; /*bottom spacing between menu items*/
    }
    
    .arrowlistmenu ul li a{
    color: #A70303;
    background: url(../../snippets/bullet_accordion_menu/arrowbullet.png) no-repeat center left; /*custom bullet list image*/
    display: block;
    padding: 2px 0;
    padding-left: 19px; /*link text is indented 19px*/
    text-decoration: none;
    font-weight: bold;
    border-bottom: 1px solid #dadada;
    font-size: 90%;
    }
    
    .arrowlistmenu ul li a:visited{
    color: #A70303;
    }
    
    .arrowlistmenu ul li a:hover{ /*hover state CSS*/
    color: #A70303;
    background-color: #F3F3F3;
    }
    


    wfJs:
    <script type="text/javascript">
    
    
    ddaccordion.init({
      headerclass: "expandable", //Shared CSS class name of headers group that are expandable
      contentclass: "categoryitems", //Shared CSS class name of contents group
      revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
      mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
      collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
      defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
      onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
      animatedefault: false, //Should contents open by default be animated into view?
      persiststate: true, //persist state of opened contents within browser session?
      toggleclass: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
      togglehtml: ["prefix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
      animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
      oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
        //do nothing
      },
      onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
        //do nothing
      }
    })
    
    
    </script>


    wfOuter:
    <div class="arrowlistmenu">
      [[+wf.wrapper]]
      <!-- Anmerkung: warum jedesmal das div="arrowlistmenu" mit eingebaut vom wf.wrapper?? sollte normalerweise nur 1 mal da sein um gesamtes accordion_menu zu umschliessen... nja funktioniert trotz dem fehler... -->
    </div>
    


    wfParentRow:
    <h3 class="menuheader expandable">[[+wf.title]]</h3>
    <ul class="categoryitems">
    [[+wf.wrapper]]
    </ul>
    


    wfParentRowHere:
    Not used

    wfInner (i used wfInnerRow here as chunkname):
    <li><a href="[[+wf.link]]" title="[[+wf.title]]">[[+wf.linktext]]</a></li>


    wfRow:
    <h3 class="menuheader" style="cursor: default">
      <a class="menuheader" href="[[+wf.link]]" title="[[+wf.title]]">[[+wf.linktext]]</a>
    </h3>
    


    SnippetCall (in a my TV called sidbar):
    [[!Wayfinder? &startId=`28` &outerTpl=`wfOuter` &parentRowTpl=`wfParentRow` &rowTpl=`wfRow` &innerRowTpl=`wfInnerRow` &jsTpl=`wfJs` ]]

    ... this works fine for Wayfinder!
    Now tried the same thing for my Archivist call in my blog...
    I made the blog after the modx documentation blog tutorial: http://rtfm.modx.com/display/revolution20/Creating+a+Blog+in+MODx+Revolution#CreatingaBloginMODxRevolution-CreatingtheSections which works, also the standard Archivist SnippetCall works like it should. But when i try to use the bullet list accordion menu:

    Archivist SnippetCall in my TV:
    <div class="sidebar">
    <h3>Archiv:</h3>
    <ul>
    [[!Archivist? &parents=`21,22,23,24,25,26,27` &target=`20` &tpl=`archivistTpl` ]]
    </ul>
    </div>


    My Archivist Template archivistTpl:

    <div class="arrowlistmenu">
      <h3 class="menuheader expandable">[[+year]]</h3>
    <ul class="categoryitems">
    <div class="arrowlistmenu">
      <li><a href="[[+url]]" title="[[+date]]">[[+date]]</a>([[+count]])</li>
    </div> 
    </ul>
    </div>


    compared to the standard archivistTpl (which actually work if used):
    <li class="[[+cls]]">
        <a href="[[+url]]" title="[[+date]]">[[+date]]</a> ([[+count]])
    </li>
    

    ... but this doesn’t work, instead i get this: http://v5.nappel.de/nappelblog/
    Feel like i’m missing to wrap something but dunno how to do it with archivist... my objective is something like this: look to Blog-Archiv http://nappel.blogspot.com/

    Any ideas someone?
      • 26363
      • 6 Posts
      [ SOLVED ] its working!! Well i’ve come to a solution that works - have a look: http://v5.nappel.de/nappelblog/, here is what i did:
      I used the standard Template archivistTpl

      Then i inserted into my TV where the Archivist call is located:
      <h3>Archiv:</h3>
      
      <div class="arrowlistmenu">
      <h3 class="menuheader expandable">2010</h3>
      <ul class="categoryitems">[[!Archivist? &parents=`25` &target=`20` &tpl=`archivistTpl`]]</ul>
      
      <h3 class="menuheader expandable">2009</h3>
      <ul class="categoryitems">[[!Archivist? &parents=`24` &target=`20` &tpl=`archivistTpl`]]</ul>
      
      <h3 class="menuheader expandable">2008</h3>
      <ul class="categoryitems">[[!Archivist? &parents=`23` &target=`20` &tpl=`archivistTpl`]]</ul>
      
      <h3 class="menuheader expandable">2007</h3>
      <ul class="categoryitems">[[!Archivist? &parents=`22` &target=`20` &tpl=`archivistTpl`]]</ul>
      
      <h3 class="menuheader expandable">2006</h3>
      <ul class="categoryitems">[[!Archivist? &parents=`21` &target=`20` &tpl=`archivistTpl`]]</ul>
      </div>


      So i basically set up the years by hand, and under it the archivist calls for the single years. The only downer is that i have to make a new one for every year in the future...