Forum OpenACS Development: IE bug and full screen display in xowiki using ?master=0

I have discovered a problem in Internet Explorer with the full screen functionality of xowiki.

Internet explorer does not switch to 'strict mode' unless the doctype declaration is the very first element of the document. This means that IE will not honour various aspects of the CSS standard such as the child selector, the sibling selector, and the firstchild selector (to name but three) when xowiki is set to display master=0.

(This IE bug of course right royally breaks my menu bar CSS when I switch to display full screen! :-| )

As things stand xowiki wraps full-screen output in this:

<div class='Form-page_template_blank'>
</div>

I had tried putting the doctype definition at the top of my xowiki::form template, but this results in:

<div class='Form-page_template_blank'>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

...which puts IE into 'quirks' mode instead of 'strict' mode.

To switch IE into 'strict' mode (as I believe is the intention) we need:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<div class='Form-page_template_blank'>

I will edit my xowiki adp template to suit nut thought I should log the discovery!

Regards
Richard

As discussed already earlier, there is no full-screen mode in xowiki. master=0 is useful in several situations, such as e.g. with ajax.

i would recommend a different path:
a) copy xowiki/www/view-default.adp to xowiki/www/full-screen.adp
b) in full-screen.adp, change the first line to <master src="/www/blank-master">

Then call the page with http://.../...?template_file=full-screen. This should get you pretty close to what you want. You might have to fiddle around with the xowiki-template and/or some master templates, but this way you get all .css/.js-files included, you get reasonable doctypes, etc.

hope this helps

-gustaf neumann

Oh wonderful, thank you Gustaf. I am sorry, I must have mis-interpreted your perfectly clear statement in the earlier post in my excitement, and took it to be a sort of 'full screen' mode.

I have spent a few hours searching through the code to find the point at which <div class="Form-page_template_blank"> is added but have not succeeded yet. I can see that it is prepended to the @content@ variable before it is returned to the template file, but I have not yet found the code that adds it. I have learned a lot about the structure of the code in the process though!

Thank you for the guidance above. I will do that immediately. I anticipate that I can still use the following to set default behaviour:

{{set-parameter template_file=full-screen}}

Regards & thanks,
Richard

Ok, well that's just better than fantastic! I now have master template display conditional upon whether or not the user is logged-in, which is even better than I hoped for!

So if the site is viewed by 'the public' all they see is a full-screen website, but if a user with appropriate access is logged in, they see the full xowiki layout plus OpenACS header as usual.

To do this add:

<if @admin_link@ not nil>
  <master>
</if>
<else>
  <master src="/www/blank-master">
</else>

The same conditional can be applied to the @top_includelets@ and @footer@ variables if required.

I used the xowiki template parameter to set the default template to the new 'full-screen' template, as adding {{set-parameter template_file full-screen}} to the template was not effective. I also tried {{set-parameter full-screen 1}}. I imagine therefore that passing arbitrary parameters is not supported and would require custom code in the page rendering method.

One surprise I encountered was that when I removed the header info from my template and put [[my-css.css]] into the template section of the xowiki::Form, instead of adding the css file to the document header, a link to the css file was rendered on the unstyled page. Not sure what I've done wrong there but as a workaround I added the css file to the xowiki instance package parameters.

Regards
Richard

Solved the issue with the included css file. The documentation suggests that included css files should be referenced like this:

[[my-css.css]]

To get mine to work I had to do:

[[css:my-css.css]]

...which I think has to do with the fact that I had already uploaded the css files rather than waiting for xowiki to [prompt me] for them.

R.

No, I have double checked by deleting and re-loading the css file. The reference on my system has to be [[css:filname.css]]

Still not sure why I can't set the template using {{set-parameter template_file full-screen}} though.

R.

Is it ok if I update the xowiki docs to reflect this?

R.

That's absolutely great - thank you so much!

I have done as you said above, and the only other change required was to comment out @top_includelets@ and the conditional @title@ display.

No other changes were necessary, which is fantastic, because that means that no 'core' files have had to be changed.

I still wonder though, how could you ever return a complete HTML document to IE using ?master=0 (which I agree could be very useful) if the content gets wrapped in a div block?

Regards,
Richard.