We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19889
    • 616 Posts
    	faqSlide: function() { // faq - requently asked questions
    		this.fsliders = $$('dl.faq-container dd.content').map(function(el) {
    			return new Fx.Slide(el, {
    				duration: 	500,
    				mode: 		'vertical',
    				transition:	Fx.Transitions.Quad.easeOut,
    				wait:		false
    			}).hide();
    		});	
    		
    		$$('dl.faq-container dt.title a').each( function(el, i) {			
    			el.addEvent('click', function(e) {
    				e = new Event(e).stop();
    				this.fsliders[i].toggle();				
    			}.bind(this));	
    		}.bind(this));	
    	},
    


    let me know if you need the ditto chunk as well
      • 10226
      • 412 Posts
      mmjaeger;

      can you give me a bare-bones outline on the data structure?

      here is how mine is now;

      FAQ - has the title and some other junk, calls ditto; ditto has a template to format the q&a’s
      q1
      q2
      ....

      I use a TV for Question, Answer, and the page title to specify the placeholders for my current implementation. And I use the master site template. Obviously there will need to be a special template for what I would like to do.
        • 19889
        • 616 Posts
        I’m just using a folder - each question is a sub-document - the ditto call is like this:

        <p>Frequently and recently asked questions of our clients.</p>
        <dl class="faq-container">
        [!Ditto? id=`dittoCall` &parents=`109`&tpl=`DittoFAQTemplate`&dateFormat=`%d %B %Y, %H:%M:%S` &hideFolders=`1` &extenders=`summary,dateFilter`&language=`english`!]
        </dl>


        the template look like this:
        <dt class="title"><a href="[~[+id+]~]">[+description+]</a></dt>
          <dd class="content"><div>[+content+]</div></dd>
        


        works pretty well so far
          • 10226
          • 412 Posts
          Excellent.. but I’m a little confused as to where everything goes.

          Ditto call - is that a chunk or the document content?

          Template - chunk or document content?

          the js code - ?
            • 19889
            • 616 Posts
            Quote from: fruitwerks at Aug 31, 2007, 01:54 PM

            Excellent.. but I’m a little confused as to where everything goes.

            Ditto call - is that a chunk or the document content?

            Template - chunk or document content?

            the js code - ?


            the ditto call goes into the parent folder - the template is a chunk and the js code can be placed in an external file or inline after you’ve loaded mootools.
              • 10226
              • 412 Posts
              ok I see how you have it.. kinda. I used your model and plugged in my tv’s. I get the question (and that is a link to the page that holds the TV’s for said question) and the answer right below it. So right now, all my links go to a blank page... I put the js code into faq.js and this page has a special template for now since it is my only page using mootools.

              http://sweetskies.fruitwerks.us/moofaq.php

              Your page title is the question? And you answer is just raw text as the page content?

              And your ’template’ is a chunk? how or where is it called?


              Thanks
                • 19889
                • 616 Posts
                the question is put into the description as it allows more characters than the title or longtitle.

                the chunk is called with the ditto call on the main page

                your definition list is missing the dl tags - you also need to change my js code a little bit in order to make it work with your html markup
                  • 10226
                  • 412 Posts
                  I noticed that when you load a link to the question itself from your page that it uses the standard template for the site? if that is tha case something is not quite right... I have changed quite a few things around since you last looked. I’m a bit confused as to how your implementation actually works. So for right now, my page is setup as close as I can get it to yours. Have a look.

                  I have to go solder my mouse cable.. have a bad wire somewhere.

                  Thanks
                    • 19889
                    • 616 Posts
                    there is a javascript error in faq.js - remove the last comma in the code or check the code with firebug
                      • 10226
                      • 412 Posts
                      fixed the faq.js..

                      Error: [Exception... "Could not convert JavaScript argument" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: http://sweetskies.fruitwerks.us/js/mootools.js :: anonymous :: line 964" data: no]
                      Source File: http://sweetskies.fruitwerks.us/js/mootools.js
                      Line: 964

                      bah.. I just downloaded this too...

                      your copy gave me..

                      Error: [Exception... "Could not convert JavaScript argument" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: http://sweetskies.fruitwerks.us/js/mootools.js :: anonymous :: line 4203" data: no]
                      Source File: http://sweetskies.fruitwerks.us/js/mootools.js
                      Line: 4203

                      but no errors from your faq page of course...