Dataform view for guests

Dataform view for guests

by Pedro Crespo Garcés -
Number of replies: 3

Hi,

I would like to use dataform to publish some information lists in the public part of my Moodle 2.8 (non-authenticated users).

I managed it using the dataform block, but I didn't succeed using the common view module.

I mean, if I try to go to /mod/dataform/view.php?id=41 without authentication, Moodle leads me to the auth page.

I tried to play with guest permissions but with no results.

Is it possible what I need? Any advice to get it?

 

Thank you in advance.

Average of ratings: -
In reply to Pedro Crespo Garcés

Ynt: Dataform view for guests

by Çağlar MERSİNLİ -

hi Pedro,

add a  view's  name   usercontrol      and set  

template;


entry template add only this code

<div id="user_id">EAU:id</div> 

then u add  this code on your page top which page want to redirect

<div class="hidden" id="usercontrol">##viewcontent:usercontrol##</div>


then  u add  js  code  


YUI().use('node', function (Y) {

if (Y.one('#user_id')==null) {
setTimeout(function (){
window.location.replace("put the your auth page link");
},1000);
}

});

please dont forget  change  this code on your js code
put the your auth page link
1000 -> 1 second 
2000  -> 2 seconds
you can change it what do you want 
regards
In reply to Çağlar MERSİNLİ

Re: Ynt: Dataform view for guests

by Pedro Crespo Garcés -

Thank you Caglar, but I'm sorry I don't understand your answer very well.

Where should I put the

<div class="hidden" id="usercontrol">##viewcontent:usercontrol##</div>
code?

And the same question with the js code...

I don't know exactly if I need to change dataform plugin code or your proposal is outside the plugin code.

Regards!

In reply to Pedro Crespo Garcés

Ynt: Re: Ynt: Dataform view for guests

by Çağlar MERSİNLİ -

<div class="hidden" id="usercontrol">##viewcontent:usercontrol##</div>
this code add   top of all pages

you dont need change plugin 's code .  my javascript codes  add dataform js tab of manage panel 


PS: 

<div id="user_id">EAU:id</div> 

please change this code  to code

<div id="user_id">[ [EAU:id] ]</div> (note redundant spaces between brackets)