how to implement javascript accordion in moodle courses?

how to implement javascript accordion in moodle courses?

by Wilmar Daza -
Number of replies: 9

Helloo to everyone...!

I'm creating a new "theme" for moodle but I want that the content of each course will be displayed by a javascript accordion or a Javascript time line project, anybody knows how can I do it?

 

PDT:

recently I made one through of SQL querys in PHP files but itsn't a really theme... you can see it in this link: 

http://siriusproduccionesyfilms.com/jm2/moodle/

1.)  acces with this login account

user: users

pass: One*2=two

2.) Go to the right block where you can see the link (Ingresar A La Nueva Interfaz De Usuario)

I Aprecciate so much your collaboration... I need it very urgent.

Thanks a lot




Average of ratings: -
In reply to Wilmar Daza

Re: how to implement javascript accordion in moodle courses?

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi,

I have just moved this to Course Format forum where Gareth may be able to help you with this question, as it is not strictly theme related. 

Gareth has developed some Course Formats for Moodle which work on the same principle as Accordian. They are called Collapsed Topic and Collapsed Weeks and you can download them from this link...

http://moodle.org/plugins/browse.php?list=category&id=19

Cheers

In reply to Mary Evans

Re: how to implement javascript accordion in moodle courses?

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Wilmar,

My formats are 'Collapsed Topics' and 'Collapsed Weeks' (thanks Mary smile ) which just have a straightforward toggle.  Which can be downloaded and installed in Moodle.  Documentation and screen casts on http://docs.moodle.org/22/en/Collapsed_Topics_course_format.

However, there are accordian widgets -> http://yuilibrary.com/gallery/tag/accordion <- for YUI that could be adapted into a course format if that is the sort of functionality you are looking for.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: how to implement javascript accordion in moodle courses?

by Julian Ridden -

I m currently working on updating the Accordian Format for 1.9 to 2.0

Sadly no news on an ETA at the moment. But it has been started. The oroginal one was pretty badly coded, so lots of things to fix up as part of the port.

Julian

In reply to Julian Ridden

Re: how to implement javascript accordion in moodle courses?

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Cool Julian,

PM me if you want a hand with this smile

Cheers,

Gareth

In reply to Gareth J Barnard

Re: how to implement javascript accordion in moodle courses?

by Wilmar Daza -

Thanks so much by your collaboration... I had seen your links and this is great..! I hope that it will be very util in my future...!

I have delayed answering because actually I'm working with Jquery Library also I started with this from the beginning and my "time line" project in moodle courses could be complete with this library.

I pretend use this examples
http://www.ajaxshake.com/demo/ES/892/992727a1/paginar-contenido-usando-un-paginador-animado-jquery-jpaginator.html

or

http://www.ajaxshake.com/demo/ES/972/8929c926/como-crear-una-linea-de-tiempo-animada-con-jquery-timelinr.html


I hope not to be wrong because I think that it's inevitable to work with sql querys unless I can use these sample projects using functions in php in /layout/general.php to show me the contents of each section of the course in each jquery window project.

if you can help me with any information That... I should know I'll be very grateful.

King regards..!

Wilmar

In reply to Wilmar Daza

Re: how to implement javascript accordion in moodle courses?

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Wilmar,

I did mess around with using jQuery in a course format once -> https://github.com/gjb2048/moodle-format_topmas, where I used the masonry layout to compact the sections onto one page.  There is a great debate that went on and probably is still going with jQuery on 'http://moodle.org/mod/forum/discuss.php?d=188627' where I think it is better to include the jQuery library in the theme header so that it is only included once.

So I probably think you need to include jQuery in the theme and then use it in a separate course format plugin.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: how to implement javascript accordion in moodle courses?

by Wilmar Daza -

Ehyyyy great job maybe we are talking about the same because this seems like the design that i want to do.... but I loose funtionality with my new design of "time line" I reflect all the sections of the courses but I can't add the blocks... in this case the little project just works for students no admins.

Respect to the debate I think that your job could be installed by default in moodle and all the courses of moodle should have it without needs to install other type of course.... just like a other theme...

I can't do it with general.php because this archive works with everything,,,! If i had an archive that works just with the course maybe could be working.

PDT: if you want to see it and tell me one chance to add the blocks like a theme... I will be grateful...
http://siriusproduccionesyfilms.com/jm2/moodle/ (...login here)

next

http://siriusproduccionesyfilms.com/jm2/moodle/newface2/ver.php?id_curso=2

or course 4

http://siriusproduccionesyfilms.com/jm2/moodle/newface2/ver.php?id_curso=4

Cheers...!

Wilmar

In reply to Wilmar Daza

Re: how to implement javascript accordion in moodle courses?

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Wilmar,

Coo - I did log into the courses and they appear to work fine smile.  I do understand what you are saying about 'general.php' and indeed that it would be active for everything.  There was debate about putting jQuery in a block that would be placed for the courses that had plugins, but this would require more administration on the part of the user.  I do wonder if the library could be shipped with Moodle and only inluded with a 'requires_once' call on with the Page Requirements Manager - I will have a look.

Cheers,

Gareth