Opening Turnitin iframe 100% width in Essential Theme

Opening Turnitin iframe 100% width in Essential Theme

by roshan kolar -
Number of replies: 11

Hi There,

This is how the Turnitin Iframe opens for us in the college. It's not a big deal to scroll through it, but we were thinking if we could have the iframe open to a 100% width (since we don't have the left and right blocks) and a fixed height (say 1000px)? Some of the teachers have complained that it's difficult for them to scroll the iframe content for more details when there are a lot of things to do within it.

Since I dont see the blocks on either sides, I feel it shouldn't be problem to make it 100%. Please let me know what to do and where.

Thanks a lot in advance. (reference picture attached within this post)

Attachment example_turnitin_iframe.jpg
Average of ratings: -
In reply to roshan kolar

Re: Opening Turnitin iframe 100% width in Essential Theme

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

Could you use browser developer tools to discover what CSS selectors were applied to the 'iframe' tag and then put the appropriate CSS in the 'Custom CSS' box of the theme settings?  If however the 'iframe' is already at 100%, then use the tools to discover what containing tag has CSS that is enforcing the constraint and and change that in the 'Custom CSS' box.  This should work as the contents of the box are applied after the stated CSS files in the themes 'config.php' file.

In reply to roshan kolar

Re: Opening Turnitin iframe 100% width in Essential Theme

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

If I am not mistaken, I think this is a fault of your theme.

Some Moodle Themes add blocks to what, in Moodle terms, is called 'base' layout. It is the block regions in this layout that makes this page look like your screenshot in Turnitin.

If you have access to your theme's folder on your server, then please take a look at the theme's config.php and look for the 'base' layout that looks like this...


$THEME->layouts = array(
    'base' => array(
        'file' => 'general.php',
        'regions' => array('side-pre', 'side-post'),
        'defaultregion' => 'side-pre',
    ),

you then need to change it to look like this...


$THEME->layouts = array(
    'base' => array(
        'file' => 'general.php',
        'regions' => array(),
    ),

This tells Moodle that this layout has no blocks.  By default this layout is for those pages that require NO blocks at all.

Unfortunately Canvas theme added blocks to this layout and Moodle HQ refuse to change it, so if your theme using Canvas theme as a parent theme, then this is probably what is causing the problem.

To check this out first, you could try changing theme to the Afterburner theme, which using the correct layout.

Please let me know the out come.

You will need to refresh your browser window if you do make the changes I have highlighted above.

Thanks

Mary

In reply to roshan kolar

Re: Opening Turnitin iframe 100% width in Essential Theme

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

Further to my last comment.

Depending on which Essential version you have then the code will be similar to this.

$THEME->layouts = array(
    // Most backwards compatible layout without the blocks - this is the layout used by default
    'base' => array(
        'file' => 'general.php',
        'regions' => array('side-pre', 'side-post', 'footer-left', 'footer-middle', 'footer-right'),
        'defaultregion' => 'side-post',
    ),

if you downloaded via the plugin database...I just checked.

Since it should have NO blocks whatsoever it should look like this...as already mentioned.

$THEME->layouts = array(
    // Most backwards compatible layout without the blocks - this is the layout used by default
    'base' => array(
        'file' => 'general.php',
        'regions' => array(),
    ),

In reply to Mary Evans

Re: Opening Turnitin iframe 100% width in Essential Theme

by roshan kolar -

Hi Mary,

Thanks for the input. The reply looked really solid so I went for a try, but got the error attached with this post.
Could I be missing something?

I used this in the config.php of the theme:

$THEME->layouts = array(
    // Most backwards compatible layout without the blocks - this is the layout used by default
    'base' => array(
        'file' => 'general.php',
        'regions' => array(),
    ),

 

Thanks,
Roshan

Attachment Screenshot_011314_120453_PM.jpg
In reply to roshan kolar

Re: Opening Turnitin iframe 100% width in Essential Theme

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

Did you check to see if that code was already there, as it looks to me that you may have duplicated it.

Can you attach the config.php here for me to check?

Thanks

In reply to Mary Evans

Re: Opening Turnitin iframe 100% width in Essential Theme

by roshan kolar -

Hi Mary,

I have attached the config file here. Can you please have a look. Thanks for your time and patience.

smile

 

In reply to roshan kolar

Re: Opening Turnitin iframe 100% width in Essential Theme

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

Well if that is a sample of what your changes are like I dread to think what else you may have done elsewhere.

I don't recall telling you to comment code out or duplicate it and then add more comment out characters to hide it.

Why are there two references to frontpage and then one commented out? Also, you cannot add a new block region to a layoout without making changes to the layout file itself.

Can I suggest you test your Turnitin page using Afterburner, and tell me if that page works OK?

This is the only way we will ever resolve this.

Thanks

Mary

In reply to Mary Evans

Re: Opening Turnitin iframe 100% width in Essential Theme

by roshan kolar -

Hi Mary,

Sorry I forgot to mention this when I sent the file.

The uncommented frontpage reference is the one you suggested in this thread https://moodle.org/mod/forum/discuss.php?d=233862&parent=1022938 , the commented one is the original which we left in so we could easily switch back, and never got round to removing. The bits commented out in the 'base' section are the difference between the original and the one you suggested trying in this thread. I always comment out code rather than delete when trying to fix things like this because it makes it much quicker to revert. Everything else should be the same as the original config.php (not the latest version of Essential, admittedly). Not sure what you mean about adding a new block region, I wasn't aware we had done that. cool

Just tried it in both Afterburner and Clean, and in both themes it works correctly - the iframe is full width as we require. It seems to be only Essential where it doesn't work.

Incidentally, I have got it to (kind of) work in Essential by adding the following css to turnitin.css (only loads when on turnitin pages)

div#block-region-side-pre {
display:none;
}
div#block-region-side-post {
display:none;
}
div#region-main-essential, div#region-bs-main-and-pre {
width:100% !important;
}

 This makes it work full width for the iframe pages, but there are some turnitin pages not using the iframe, these pages it breaks the essential layout (as I'm sure you could imagine!). Anyway, this might give you some idea what's causing the issue.

Thanks again for all your help.

In reply to roshan kolar

Re: Opening Turnitin iframe 100% width in Essential Theme

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

Hi,

Well at, least you have narrowed this down.

That means that Essential config.php is wrong so whenever Moodle dictates that a specific layout needs to be used, where NO BLOCK REGIONS exist and ends up in a place where there are some, it returns an Error message.

Having tested this same problem on a university website 18 months ago I know that the Turnitin page uses 'base' layout. So it needs to be like this in your config.php

See attached config.php You can rename your current one to config_old.php then add this one.  That way you should not need the css.

Also, can you tell me how can I test this fully with a copy of Turnitin, or have I to register with some organisation first? I know Dan Marsdan does a lot of work fixing the Turnitin Mod Plugin for Moodle but not knowing how it all works I have never ventured to try installing it. Is this what you use...or something different?

Cheers

Mary

In reply to Mary Evans

Re: Opening Turnitin iframe 100% width in Essential Theme

by roshan kolar -
Thanks Mary, we'll try that out next week once exam boards are over. 
 
As for testing it yourself, you would need an account with Turnitin in order to have access to their API. Not sure if they do testing or demo accounts for this kind of purpose. There are 4 turnitin integrations for Moodle, the basic iframe one we're using, the Direct Turnitin one (everything stays in Moodle, turnitin web services are called behind the scenes), the Dan Marsden one (an improvement on the direct one) and finally the Turnitin Direct integration version 2 (beta) - a combined effort of Dan and Turnitin (I believe). Hopefully we'll switch to this when it's production ready, but until now - the basic iframe one has been the best option for us.
 
Hope that helps.
In reply to roshan kolar

Re: Opening Turnitin iframe 100% width in Essential Theme

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

OK...thanks Roshan for the info.

I'll contact Turnitin and see if I can get a temp account for testing purposes.

Cheers

Mary