MulitMovie Filter and Wikis

MulitMovie Filter and Wikis

by Jonathan Konrad -
Number of replies: 13
Does anyone know how to use MultiMovie filter in a Wiki? I have installed this filter and verified that it works in most areas of Moodle. However, when I enter the following line in a Wiki, it just shows up as a bold page link instead of displaying the video. Is there any way to display youtube in a Wiki?

This is what I entered:

[[mm:youtube:-dnL00TdmLY|You Tube Video on Wikis]]

It works in other areas, but not Wikis. I am using Moodle 1.9.2.

Jon
Average of ratings: -
In reply to Jonathan Konrad

Re: MulitMovie Filter and Wikis

by Nacho Aguilar -
I've got the same problem. It's not working in A Wik.

I also use Moodle 1.9.2

Thanks.
Nacho
In reply to Nacho Aguilar

Re: MulitMovie Filter and Wikis

by dan roggenkamp -
I can see how there would be problem with the use of the [ tag that is used by both the wiki and mm, but I'm going to venture a bit off topic here and point out that I've posted messages about having similar problems with using MultiMovie and the Multimedia filters in the blog and in the wiki in Moodle 1.9.2. As we haven't had any substantive responses to our inquiries, I'm wondering if maybe we can put our heads together and find a workaround for this problem, i.e., a solution that does not depend on either filter. There has to be a way for those of us who are technically savvy yet code-challenged. We can at least try.

The 'MultiMovie in wiki' problem brings to mind another issue I've been wondering about, and that is how to present code in postings in Moodle. In some wikis it's done with a % element, I believe. In any case, it seems to me that one of the problems with the wiki and MultiMovie filter clearly seems to be the [ tag. But I'm equally concerned with how to present audio and video in blogs.

In any case, if we can't climb the mountain, let's find a way around it.

Brainstorming, anybody?




In reply to Jonathan Konrad

Re: MulitMovie Filter and Wikis

by dan roggenkamp -
Here's all I can come up with so far.

In order for the wiki not to add a wiki link to a square bracket [, you need to precede that with an exclamation mark or tilde, ![ or ~[. I still can't get mm to work, but using [![12345 | title]] seems to come closer to working. That syntax results in

title
//

This is very similar to what I'm getting with the mp3 and flv filters in the wiki. Those filters do work, but they spit out something similar (see exposed code below player).
filters in wiki
With regards to the blog, I have been able to get the flv filter and the mp3 filter to work by adding the files as attachments to a blog posting. I have no idea why that should work while making a link to the same files in a blog entry doesn't.

-Dan
In reply to Jonathan Konrad

Re: MulitMovie Filter and Wikis

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi,

well, obviously some filters syntax (multimovie, moodledocs...) conflicts with wiki module (and potentially with any wiki text format).

And, IMO, there are two ways (none implemented yet) to solve this conflict:

1) Let the wiki parser, to know about some "especial" links, like [[mm:whatever]] or whatever, instructing the parser to ignore them (to be processed later by filters.

2) Modify those filters to support an alternative syntax (different opening and closing tags), so they can be used within a wiki without problems.

The 1st solution is, IMO, difficult to implement, because any new filter, using a new "prefix" should be added to the wiki parser code in some way (yes, it could be a module setting or so, but I think it's far from elegant).

The 2nd solution sounds better, it's easily implementable (if I'm not wrong) an will provide a solution for the problem. But there is one problem... which open/close tags should we use?

Initially I thought about to use curly brackets {{whatever}}, but it seems that current wiki also uses them to make footnotes. sad Also, I thought about to use <<whatever>> or ((whatever)) but I can imagine those being used by someone in normal texts, formulas... i.e. they aren't "exclusive".

So the question is, if we try the 2nd way (support an alternative syntax), which open/close tags can we use (should be easy and exclusive).

Some possibilities (just trying to use open/close-like characters):

<{whatever}>
{#whatever#}
{(whatever)}
...

Please, provide your own ideas or comment about... ciao smile
Average of ratings: Useful (1)
In reply to Eloy Lafuente (stronk7)

Re: MulitMovie Filter and Wikis

by Alison Pope -
Eloy,

Good question.

I tried <{whatever}> but couldn't make this work. {#whatever#} reminded me to much of text formatting, {(whatever)} seems to work OK so far and is easy...whether it is exclusive though is harder to say!

Thanks for a great filter by the way.

Regards,
Alison
In reply to Eloy Lafuente (stronk7)

Re: MulitMovie Filter and Wikis

by sam marshall -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Ideally I think all filters (except those like glossary which alter plain text and don't need tags) should use regular xml-valid tags if possible in a standard format. So in other words you would do something like <filter:movie type="youtube" id="sdg462362sg"/>. Or <filter:moodledocs page="Some wiki page"/>. Or <filter:tex>x^2+y^2</filter:tex>. (Note that the TeX filter already supports an xml-style syntax as well as the one with $ signs.)

Unfortunately this does not work very well for typing them in the html editor as it will interpret them as xml tags and you won't see them. sad

One possibility would be to store all tags like that in the database but process them differently when using html editor, so that:

1) if you save content with the html editor, &lt;filter:[^>]*/&gt; or whatever gets turned into proper < >

2) if you load content with the html editor (unfortunately this is more difficult as I'm not sure it knows), tags <filter: ... > are turned into visible &lt; &gt;.

--sam

In reply to sam marshall

Re: MulitMovie Filter and Wikis

by sam marshall -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Here's a second idea - I already knew nobody at Moodle would like the first one, it was too standardised-seeming and cleanly implementable ;)

How about if filters require tags of some kind, splitting apart the concept of 'tag' and 'filter'. So that the tag surrounds are managed by the system not the filter and are a standard system setting. There'd be a default but eg if you install a filter that uses say {{ }} and you install another one that also wants {{ }} then it can become ## ... ## or whatever. (I originally did that with pairs of @ signs but that hit some filter or other...!)

Haven't really figured out how this would work but that concept might help solve issues of filter conflicts.

Edit: On second thought I don't like this idea because it means backups aren't compatible, users moving between two moodles might have to relearn skills, etc.

--sam
In reply to sam marshall

Re: MulitMovie Filter and Wikis

by sam marshall -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
And third idea - make all these filters use the same tags eg (( double brackets )) but you have to put a special unique word immediately at the start for it to match. So for instance ((doc My Page)) would be a link to a moodledocs page, ((youtube asf35dsd)) would be a youtube movie, etc. Different filters, all using same tags with one word = simple to understand/learn/use...

--sam
In reply to sam marshall

Re: MulitMovie Filter and Wikis

by Jonathan Konrad -
I like this idea the most. Creates a clear standard to follow. What I'm not sure about is how to do this. I'm not much of a coder anymore, and this sounds like core level stuff.

Is there an easy way to implement this change in all filters? (I'm sure not, but thought I'd ask anyway). Thanks.

Also, until this is done you can use escape sequences inside the Wiki to get mm to work. So this

[![mm:youtube:Wv74Avv2Ou0|You Tube Video on Species at Risk]]

Will actually load the youtube video.
In reply to Jonathan Konrad

Re: MulitMovie Filter and Wikis

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Sam,

thanks a lot for all your ideas! cool

Note that right now we have 3 filters (AFAIK) of this type:
  1. In core, the tex filter, that supports various syntaxes (enclosing the formula with the tex tag, using double dollars, using backslashes with simple square brackets...).
  2. In contrib, the multimovie filter, supporting double square brackets.
  3. In contrib, the moodledocs filter, supporting double square brackets.
Also note that both the multimovie and the moodledocs filters support the use of prefixes ("mm:" and "docs:" respectively).

So we are really near of your 3rd proposal, only the tex filter needs to support one prefix ("tex:" I guess is the correct one).

So the proposal is:
  1. Make all those (3) filters to work with double square brackets and with the specified above prefixes.
  2. Make all those filters also to work with a different opening/closing tags, instead of the double square brackets. Still need to agree here about those alternative tags!
  3. Ensure that the exclamation mark within the square brackets trick commented by Jonathan will continue working in new wiki (nwiki) coming in 2.0. It has been addressed as MDL-16840.
So all we need for now is to agree about those alternative tags and implement them in all the (3) filters. Using prefixes, agree and allowing square brackets to continue working (BC). And documenting the new tags and the exclamation trick in relevant pages, of course.

Ciao smile
In reply to Jonathan Konrad

Re: MulitMovie Filter and Wikis

by Alison Pope -
Jonathan,

Thanks for this it works really. I had a problem with the ewiki html balancer thinking that should have separate closing tags. I got this all working on my dev install and then moved it to our test install for UAT and on there it won't work. This *should* be configured exactly the same but on this install the video is only displaying if and are allowed in site policies? I can't understand why this should be happening. Has anyone else experienced this at all or have any ideas?

Thanks,
Alison
In reply to Jonathan Konrad

Re: MulitMovie Filter and Wikis

by Heather P -
Hello
This seems to be only working erratically for us. We are on a moodle 1.9.1 I can put the code in with the exclamation mark and when I save the page and the youtube bit is missing and the last line of writing in the wiki including the referring links seems to have dropped out of the bottom of the wiki and appears bottom left of the page.
However if I click the history tab and then click the view tab suddenly I have the youtube video working and the referring links back in the wiki box.
It seems the youtub bit only appears if we access the page by clicking the view link, so to the average user it isn't working.
I've tried this in both IE and FireFox - same result.
I've switched to standard theme just to make sure it isn't our style sheet but no still behaving very strangely.
Any ideas please?
In reply to Heather P

Re: MulitMovie Filter and Wikis

by Heather P -
Hi
I've now tried this in Moodle 1.9.5 and still got the same problem. It only works if after you have gone to the appropriate wiki page you click one of the other tabs, e.g. links and then click back on the View tab -suddenly it sparks into life so I'm guessing it must be something to do with the way the page is loading.

ANy ideas as I would really like to see this working.

Thanks