Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2007-01-17 21:39:51

DigitalRealm
Member
From: Greenville, SC
Registered: 2006-07-22
Posts: 139
Website

Re: Simple Community Site Possible?

My only other thought is that you may need to load the page before the javascript file. Place the javascript that I gave you, in the page and at the bottom right above the </body> tag. Try that out, if that does not work, I am lost as well, but I will look at it again later tonight and see if I can find the problem.

Cory

Offline

#17 2007-01-17 22:39:26

dada78
Member
From: New York
Registered: 2005-10-27
Posts: 138
Website

Re: Simple Community Site Possible?

Hi Cory,

I pasted the javascript before the body end tag but unfortunately with “no change in result.

I am at my wits end…

thanks for bearing with me!

Dada

Last edited by dada78 (2007-01-26 19:28:45)

Offline

#18 2007-01-18 06:56:18

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Simple Community Site Possible?

Looks like you have not loaded the Javascript nor the CSS file. Check the paths are correct, they are relative paths. You could try absolute paths like “src=“http://carinafuller.com/Mootools/mooTools_lib.js”

Also make sure you have the correct spelling in the path – capital letters are easy to miss if the actual path is in lowercase.

Offline

#19 2007-01-18 13:00:59

DigitalRealm
Member
From: Greenville, SC
Registered: 2006-07-22
Posts: 139
Website

Re: Simple Community Site Possible?

Dada,

I am thinking that you may not have something loading correctly. As jstubbs mentioned above, make sure that your mootools.js is correct and loading properly. What you have should be working totally fine, as I have looked back at mine and it is the same. I think there may be a problem with your script and not the code that you have.

Last edited by DigitalRealm (2007-01-18 13:01:30)

Offline

#20 2007-01-18 15:04:19

DigitalRealm
Member
From: Greenville, SC
Registered: 2006-07-22
Posts: 139
Website

Re: Simple Community Site Possible?

Dada,

Your page is throwing a js error, but I have no idea why! It looks totally correct and is the same as mine, mine does not throw the error-

document.getElementsByClassName is not a function
[Break on this error] var myToggler = document.getElementsByClassName('display');

I still think it has something to do with your mootools.js script. Did you try getting the script with ALL of the available downloadable components in it just to test?

Offline

#21 2007-01-18 16:24:30

dada78
Member
From: New York
Registered: 2005-10-27
Posts: 138
Website

Re: Simple Community Site Possible?

Hi Cory,

I will try this next.

Thanks so much for sticking with me through this.! (I am starting to lose hair over this). ;-)

Offline

#22 2007-01-18 16:33:52

dada78
Member
From: New York
Registered: 2005-10-27
Posts: 138
Website

Re: Simple Community Site Possible?

SUCCESS!

Thank you, thank you, thank you!!!

That actually did the trick! I downloaded all the scripts from mootools this time (whereas before I just downloaded the ones on the right of the downloads page and the ones that were are requirement for these).

See the result here

Your awesome
*Dada

Offline

#23 2007-01-18 17:20:50

DigitalRealm
Member
From: Greenville, SC
Registered: 2006-07-22
Posts: 139
Website

Re: Simple Community Site Possible?

Cool, glad you have it working finally!

Cory

Offline

#24 2007-01-18 18:24:59

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: Simple Community Site Possible?

Hi Digital Realm and Dada,

I’m trying to sort through the MooTools javascripts to run both Slimbox and the accordion effect mentioned here.

I went to the MooTools site and downloaded the various files which were combined into a single file called mootools.release.83.js. In my textpattern page I’m referencing the scripts (uploaded to a folder called Javascripts) as follows:
<script type="text/javascript" src="/javascripts/mootools.js"></script> <script type="text/javascript" src="/javascripts/slimbox.js"></script>

I then use your sample code, but I can’t get anything to work! Am I missing some files or do I need to change the script type reference to mootools.release.83.js instead of mootools.js? I’m finding the whole mootools experience quite confusing!

Last edited by decoderltd (2007-01-18 18:26:26)

Offline

#25 2007-01-18 19:12:59

dada78
Member
From: New York
Registered: 2005-10-27
Posts: 138
Website

Re: Simple Community Site Possible?

Hi DecoderLtD!

Yes, I agree with you. Mootools experience is confusing – especially when you select the scripts and nothing works. ;-)

Do I need to change the script type reference to mootools.release.83.js instead of mootools.js?

Yes you got to reference the exact name of the file you downloaded. Then paste DigitalRealm’s code into a new javascript file and call it for example mootools_menu.js and reference that in the head section of your page as well. Or just paste the code (within script tags) right before the body closing tag (</body>) in the template page. I have no idea if that makes a difference but it’s worth a try.

Follow DigitalRealm’s advice and make sure you download the script in an uncompressed format (select “none” on their download page on the left). What you can also try is to just select all scripts and download them, if the above advice still doesn’t yield any results.

Dada

Last edited by dada78 (2007-01-18 19:15:25)

Offline

#26 2007-01-18 21:20:54

dada78
Member
From: New York
Registered: 2005-10-27
Posts: 138
Website

Re: Simple Community Site Possible?

Okay now I have implemented the test into my textpattern site and although I have stm_javascript installed the scripts weren’t called it seems.

The following in the head section of the page template didn’t work:

<txp:js n=“mootools_lib” />
<txp:js n=“mootools_menu” />

(I have 2 javascript files saved under the javascripts tab)

*The only way I got it to work is *to reference the script via absolute URL to the script on the server.

Anybody know how the stm_javascript doesn’t work?

Thanks!
Dada

Last edited by dada78 (2007-01-18 21:21:26)

Offline

#27 2007-01-19 14:52:45

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: Simple Community Site Possible?

Many thanks dada78, that worked and my page is finally recognising the mootools javascript. As the Slimbox is now functioning, I’ll move on to implementing the accordion effect.

Sorry, I’m not familar with the stm_javascript plug-in, but I might look at adding that too – it sounds useful.

Offline

#28 2007-01-19 16:21:01

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: Simple Community Site Possible?

Ok since this has turned into a topic about mootools, ;) Does anyone have any experience with using cookies to remember the last state of the accordian effect? I’d like to do that.

Offline

#29 2007-01-19 17:40:30

DigitalRealm
Member
From: Greenville, SC
Registered: 2006-07-22
Posts: 139
Website

Re: Simple Community Site Possible?

mrdale, I am sure that is quite possible but I am not familiar with doing it. I know that MooTools gives you the ability to always have a certain accordion element open on load, which may be easier to do and be close to what you want.

Check out their forum, you may find some info there on the cookie thing.

Offline

#30 2007-03-02 14:36:20

DigitalRealm
Member
From: Greenville, SC
Registered: 2006-07-22
Posts: 139
Website

Re: Simple Community Site Possible?

Just FYI for anyone viewing this thread…..

The JS code that I posted above does not work with MooTools 1.0. 1.0 was recently released and has been updated in several places, therefore, my code above is now outdated.

You can now get updated code and examples at Clientside, from the great Aaron Newton and his MooTools tutorial and working examples.

Offline

Board footer

Powered by FluxBB