Auto height on wrapper menu item stopped working

General questions relating to Joomla! 3.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Locked
bamce
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Wed Feb 25, 2015 8:55 am

Auto height on wrapper menu item stopped working

Post by bamce » Mon Feb 05, 2018 3:15 pm

On one site we have a set of wrapper menu items that picks up pages on the same site from another menu. These iFrames should be auto height - the Auto Height setting on the Advanced tab is "Yes". This worked fine for a while when we set this up (J 3.8.2 or 3.8.3), but now suddenly have stopped working. All the iFrames are fixed height, the Auto Height setting has no function.

The site was updated to Joomla 3.8.4 at the end of last week. I do not know if there has been any PHP upgrades on the webhotel, but it is currently running PHP 7.0.27. I have tried to replace the wrapper component with 3.8.2 and 3.8.3 versions, but this did not help.

I noticed that in the component's tmpl/default php there is a line

Code: Select all

JHtml::_('script', 'com_wrapper/iframe-height.min.js', array('version' => 'auto', 'relative' => true));
but that .js file is nowhere to be found? Something missing?

Any ideas how to solve this? Setting the fixed height to a big number is not a suitable option.

gws
Joomla! Champion
Joomla! Champion
Posts: 5950
Joined: Tue Aug 23, 2005 1:56 pm
Location: South coast, UK
Contact:

Re: Auto height on wrapper menu item stopped working

Post by gws » Tue Feb 06, 2018 11:29 am

Try using the wrapper module instead of the menu item and see if that solves the issue.

bamce
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Wed Feb 25, 2015 8:55 am

Re: Auto height on wrapper menu item stopped working

Post by bamce » Tue Feb 06, 2018 2:02 pm

Unfortunately not a solution in this case - we are trying to get rid of myriads of modules by using two sets of menus. Using modules would mean that we need another huge set of articles and modules...

bamce
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Wed Feb 25, 2015 8:55 am

Re: Auto height on wrapper menu item stopped working

Post by bamce » Wed Apr 11, 2018 9:55 am

I found a solution for this in a thread dealing with the same problem in mod_wrapper. Th solution is very simple! :geek:

Make an override for the com_wrapper's default.php in /templates/<your template name>/html/com_wrapper/wrapper/defaut.php

Add this script just before the iframe in the default.php:

Code: Select all

<script type="text/javascript">
function iFrameHeight() {
  var f = document.getElementById('blockrandom');
  f.style.height = '100px' ;
  var d = (f.contentWindow.document || f.contentDocument) ;
  var height = Math.max(d.body.offsetHeight, d.body.scrollHeight) ;
  height += 10; // scrollbars?
  f.style.height = height + 'px' ;
  f.setAttribute("height", height) ;
}
</script>
Set the Auto height to "Yes" on the Advanced tab of your wrapper menu item!

bamce
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Wed Feb 25, 2015 8:55 am

Re: Auto height on wrapper menu item stopped working [SOLVED]

Post by bamce » Thu Apr 12, 2018 8:50 am

The solution mentioned above was found on https://tjohns.co/web-development/36-jo ... per-module

ThePiston
Joomla! Guru
Joomla! Guru
Posts: 643
Joined: Mon Nov 07, 2005 3:45 am
Contact:

Re: Auto height on wrapper menu item stopped working

Post by ThePiston » Tue Oct 23, 2018 3:35 am

this doesn't seem to work in version 3.8.13


Locked

Return to “General Questions/New to Joomla! 3.x”