Embed URL Height = 0px?

Embed URL Height = 0px?

by Zach Vander Veen -
Number of replies: 8

Hi All,

I'm using Moodle 2.0 with a variation of John St "Simple Space" theme. The question directly relates to this theme, but in reality the answer could come from anyone using any theme.

When a teacher adds a url to their course and selects "embed" as the display option, the theme assigns the embed object a style that gives it a display height of 0px (thereby making the embed invisible). FWIW, different themes assign different heights to this style.

I've poured over the various style sheets and can't, for the life of me, find where this style is coming from! I'm hoping someone can help.

Many Thanks,
Zach

Average of ratings: -
In reply to Zach Vander Veen

Re: Embed URL Height = 0px?

by John St -

That height is calculated by some js looking for #page-header and #page-footer and then setting some height.

So, since the theme does not have those containers, the js fails and just makes a 0 height... This way of calculating embedded resources may be fixed in a future version of moodle, but for now, you can just add those empty containers to the layout files or use the version here.

In reply to John St

Re: Embed URL Height = 0px?

by Zach Vander Veen -

Took a while to reply here. But thank you very much!

In reply to Zach Vander Veen

Re: Embed URL Height = 0px?

by Derek Lawrie -

I know it's while ago, but did you solve this by adding those elements? I've added them and the pdf now works but I can't for the life of me figure out how to change the width or height of it.

Anyone who knows please tell!

In reply to Derek Lawrie

Re: Embed URL Height = 0px?

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

Hi Derek,

First of all can you tell me how the PDF is presented on the page. Usually, at least in Moodle 1.9 it opened as a normal PDF file opens using Adobe or some other similar reader.

I've not tried it in Moodle 2.x so I would not know. 

If it's in a page then the only way to make the container bigger is to use CSS.  But here again, I don't know off hand as I have never tried to embed a PDF, I have only ever added them as a link, then I know they will open to a full sized window.

Cheers

Mary

In reply to Mary Evans

Re: Embed URL Height = 0px?

by Derek Lawrie -

Hi Mary,

I think I figured it out, well a bit of it anyway.

The PDF was appearing to only use about half of the available width, but I realised that the space it was leaving was roughly equivalent to the right hand column (which I wasn't using on that page), but I hadn't told the config not to use the right hand column for that layout.

So sort of problem solved, as I'm happy with that size, BUT changing it to some set sizes may also be useful, I'm presuming that I'd just create a class for .pdfsection in my css and force it that way? I'll have a play on my test server and see what I get.

Many thanks for the help though.

Derek

 

In reply to Derek Lawrie

Re: Embed URL Height = 0px?

by Lael ... -

HI Derek,

 

I was just looking into this for our theming / customisation. I found:

http://tracker.moodle.org/browse/MDL-34687 which had the following CSS

#resourceobject {
  width: 100%;
  min-width:100%;
  max-width: 100%;
  min-height: 600px;
}

I modified it slightly for our install / theme:
.resourcepdf #resourceobject {
  min-width:100%;
  max-width: 100%;
  min-height: 950px; //enough for a full A4 page 
 }

hth,

Lael

In reply to John St

Re: Embed URL Height = 0px?

by Yehuda Zimmerman -

Can you explain a generalized way to do this, because changing the containers doesn't seem to do much. Everything defaults to 800 x 600, no matter what I do!

In reply to Yehuda Zimmerman

Re: Embed URL Height = 0px?

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

Hi,

Can you explain a little more what it is you are trying to do, and where?

Thanks