Skip to content

Conversation

@ReLater
Copy link
Contributor

@ReLater ReLater commented Mar 25, 2018

Related to #19965
See discussion there concerning B\C breaks in Joomla 3.x.

@BaleshSrle
Please feel free to take over code and/or idea into your pr. I have no problems to close this one then.

Summary of Changes

  • Adds a new switch Legacy (HTML4) versus HTML5.
  • Legacy is the default setting. Thus, this pr will not break older template overrides that use HTML4 attributes for IFRAME tags that have been removed in HTML5.
  • Doesn't touch old parameter types and names but translates them via PHP for HTML5 mode if necessary.
  • HTML5 uses CSS style instead.
  • Comment: Because most current browsers don't support CSS rule overflow for displaying/hiding scroll bars scrolling attribute cannot be removed in HTML5 mode.

Testing Instructions

  • Apply patch.
  • Create a menu item of type "Wrapper" with setting Mode = Legacy.
  • Create another menu item of type "Wrapper" with setting Mode = HTML5.

25-03-_2018_15-55-15

  • Compare outputs in frontend.
  • Test other settings and compare output in frontend.
  • As far as I see: Old template overrides should still work even if you switch mode to HTML5 because only default.php of core respects new setting.

Expected result

  • No optical difference

Documentation Changes Required

????

New language strings

YES
Please help to optimize description.


if ($isHtml5)
{

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove blank line.


if ($scrolling !== 'auto')
{
$scrolling = ($scrolling === 'no' ? 'hidden' : 'scroll');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

() not necessary. Remove.

$scrolling = ($scrolling === 'no' ? 'hidden' : 'scroll');
}

$frameborder = (!$frameborder ? 'none' : $frameborder . 'px solid #000');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

() not necessary. Remove.

COM_WRAPPER_FIELD_HEIGHTAUTO_LABEL="Auto Height"
COM_WRAPPER_FIELD_LABEL_SCROLLBARSPARAMS="Scroll Bar Parameters"
COM_WRAPPER_FIELD_MODE_LABEL="Mode"
COM_WRAPPER_FIELD_MODE_DESCRIPTION="HTML5 mode uses CSS to style the IFRAME tag. Legacy mode uses HTML 4.01 IFRAME attributes and is backwards compatible with old template overrides."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to COM_WRAPPER_FIELD_MODE_DESC

@Quy
Copy link
Contributor

Quy commented Mar 25, 2018

I have tested this item ✅ successfully on 47a52d6


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19985.

@BaleshSrle
Copy link

BaleshSrle commented Mar 25, 2018

You managed to work all major kinks, but there is an issue with scrolling (in HTML4) or overflow (in HTML5) in components/com_wrapper/views/wrapper/tmpl/default.xml

More about this you can see @ https://www.w3schools.com/cssref/pr_pos_overflow.asp (auto, scroll & hidden are the main options).

In CS there is no need to have line $frameborder = !$frameborder ? 'none' : $frameborder . 'px solid #000';. I tried to add something similar (in default.php and default.xml), but after uploading that file and refreshing my web site, I discovered an error and I left values 1 and 0 in frameborder field (and I can inform you that works).

@ReLater
Copy link
Contributor Author

ReLater commented Mar 25, 2018

border: none; is correct and valid CSS. So I don't see any problems to use it.

border: 1; is invalid CSS. If you see an iframe border in your browser the reason is that the browser that you use ignores this invalid setting and falls back to it's own default CSS rules (if there are no other overruling ones in other CSS files). (EdIT: Or your browser is a nice one ;-) )

25-03-_2018_21-50-18

Only border: 1px; doesn't show a frameborder in current Joomla staging and that's the criterion for this pr. "Be B\C".

So use border: 1px solid #000; to display a border like with frameborder="1" in Legacy mode.

border: 1px; (HTML 5)

25-03-_2018_21-15-01

border: 1px solid #000; (HTML 5)

25-03-_2018_21-15-29

frameborder="1" (Legacy)

25-03-_2018_21-28-33

(auto, scroll & hidden are the main options).

And these three overflow values are used in HTML5 mode and ONLY in HTML5 mode. So, I don't understand what you're talking about.

In Legacy mode nothing has changed an scrolling is yes|no|auto like before.

@ReLater
Copy link
Contributor Author

ReLater commented Mar 25, 2018

I'm closing here until I've found a solution for Scroll Bars in HTML5 mode.
It looks like most browsers don't support CSS rule overflow for tag IFRAME.

@ReLater ReLater closed this Mar 25, 2018
@ReLater ReLater reopened this Mar 25, 2018
@ReLater
Copy link
Contributor Author

ReLater commented Mar 25, 2018

Reopened after additional commit.
I had to add a fallback for setting Scroll Bars .

@ReLater ReLater closed this Apr 4, 2018
@ReLater ReLater deleted the patch-7 branch August 4, 2018 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language Change This is for Translators

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants