dataform gallery example

dataform gallery example

by Sidd Lep -
Number of replies: 7

Hi!

I tried to create a gallery as explained here: https://docs.moodle.org/30/en/Dataform_Photo_Galleries but in my case it doesn't wokred. I followed all of the steps including downloading and uploading fancybox files on server.

Is this documentation still updated or I missed something?


Thank you

Average of ratings: -
In reply to Sidd Lep

Re: dataform gallery example

by Itamar Tzadok -

The example is definitely outdated. JQuery is integrated in recent Moodle versions and there is a particular way for initializing and calling it from the JS tab. I will post an updated version of the instructions soon. smile

Average of ratings: Useful (1)
In reply to Itamar Tzadok

Odgovor: Re: dataform gallery example

by Sidd Lep -

Great. I'm waiting for it.

Thank you, very much.

Kind regards,

In reply to Sidd Lep

Re: Odgovor: Re: dataform gallery example

by Itamar Tzadok -

See if the updated instructions work for you. smile

In reply to Itamar Tzadok

Odgovor: Re: Odgovor: Re: dataform gallery example

by Sidd Lep -

It almost work smile.

I follow the instructions carefully, but the photo is not opening in fancybox. It just download on the computer.

Meanwhile, I realized that the problem might be in view template. When I add the javascript code in html view , it looks like this:



But, when I save it and open again, there is no anymore code, and it looks like this:



So, any ides why code disappears.

Thank you,


In reply to Sidd Lep

Re: Odgovor: Re: Odgovor: Re: dataform gallery example

by Itamar Tzadok -

You may need to enable trusted content in Site administration /  Security /  Site policies. See if that works. smile

In reply to Itamar Tzadok

Odgovor: Re: Odgovor: Re: Odgovor: Re: dataform gallery example

by Sidd Lep -

The code is visible now, but still, the photo is not opening in fancybox. It just download on the computer when I click on it. :/

I tried it on two sites and in both cases the result is the same.


This is what I did:

1. I created image field with name Image

2. added a grid view, where I pasted the code at the bottom of view template

3. modified entry template with the code


4. added  external css path and css.



What I did wrong there?


In reply to Sidd Lep

Re: Odgovor: Re: Odgovor: Re: Odgovor: Re: dataform gallery example

by Netanel Neuman -

Hi Sidd,

If your screenshot represents exactly what you actually did then it would seem firstly, that your paths are incorrect.

"path-to-fancybox-js-files" is not a real path, it's just an example.

Also, you need to set your images as links.

I managed to get this working in moodle 2.8 (2.9 uses JS as AMD and I don't know what would happen if you tried this there...).

See the attachment (based on Itamar's official explanation page you mention at the beginning of your post, but with a couple of "helper" additions)

Good luck wink

Average of ratings: Useful (2)