Iframe height do not resize to match my theme! (how to change heightCalculationMethod)

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

If you wish to attach one or more files enter the details below.

Maximum filesize per attachment: 1 MiB.

Expand view Topic review: Iframe height do not resize to match my theme! (how to change heightCalculationMethod)

Re: Iframe height do not resize to match my theme! (how to change heightCalculationMethod)

by Twist » Thu Mar 04, 2021 8:33 pm

Thank you for your swift reply. I updated to 2.4.4 already and did the entire process from the start over afterwards but it didn't do anything.

I did find what was causing the problems though. Typically just a few minutes after posting my question here. :)

The resizer script got the wrong allowed domains. The array contained only http:// URL's for my domain, which are not allowed in the server config, and not the correct https:// URLs. The entire site is running on SSL and I haven't been able to find a setting for this so I hardcoded the URLs into the page code and viola, it works. :)

Re: Iframe height do not resize to match my theme! (how to change heightCalculationMethod)

by axew3 » Thu Mar 04, 2021 8:22 pm

p.s check that your document domain setting (based on cookie setting) is correctly set.
It is possible to check it viewing online example, or if you know how, look into browser console

note these lines into page-forum:

Code: Select all

		document.domain = '".$document_domain."'; // NOTE: for domains like 'mysite.co.uk' remove this line, if you setup the next to match the correct document.domain
		// document.domain = 'mydomain.com'; // NOTE: reset/setup this with domain (like mysite.co.uk) if js error when WP is installed like on mysite.domain.com and phpBB on domain.com: js origin error can come out for example when WordPress is on subdomain install and phpBB on domain. The origin fix is needed: (do this also on phpBB overall_footer.html added code, it need to match)

Re: Iframe height do not resize to match my theme! (how to change heightCalculationMethod)

by axew3 » Thu Mar 04, 2021 8:04 pm

strange that it do not resize:
if it is a new install online, may let see the example linking the site.

If updated from previous plugin version to 2.4.4, may update files:
MEMO: to update to latest code, it is required to rebuild page-forum.php (or whatever you named it) via plugin admin, OR manually substitute it into your active WP template folder, with the new one that you find/copy into /wp-content/plugins/wp-w3all-phpbb-integration/addons. You’ll may need to update also the iframeResizer.contentWindow.min.js and iframeResizer.contentWindow.map files added into phpBB root, with news updated files you’ll find into /wp-content/plugins/wp-w3all-phpbb-integration/addons/resizer folder (this step is not ever required, but only when iframe resizer library updates, which is notified on plugin changelog when plugin released). Done this, substitute the phpBB overall_header.html and overall_footer.html code (re-adding needed values) with the new v5 code here below. Do not forget to rebuild phpBB template to make phpBB template modifications take effect.
note:
You’ll may need to update also the iframeResizer.contentWindow.min.js and iframeResizer.contentWindow.map files added into phpBB root, with news updated files you’ll find into /wp-content/plugins/wp-w3all-phpbb-integration/addons/resizer folder
Anyway i've try old with news and was working, so may it is not your problem?

Re: Iframe height do not resize to match my theme! (how to change heightCalculationMethod)

by Twist » Thu Mar 04, 2021 7:51 pm

Hi,

I'm sorry to bother you but I just cannot get the iframe to be any other height than maybe 100 pixels, no matter what I do. I've gone through the install process 100% by the book, several times even, and I have tried all the different alternative settings, both from here and from https://github.com/davidjbradshaw/iframe-resizer. Nothing I have done have made any difference at all. Everything stays exactly the same in all browsers and on all devices.

I'm on a fresh install of WordPress with no other plugins activated. The phpBB forum is running from a subfolder of the WP installation and the theme is proSilver_SE.

All I want is the exact same look you have here on your page, with a slim header that auto-hides and the forum nicely inside an iframe. Is there any certain theme that works better for this? I'm building a new WP site around an old forum, so I'd be just fine reinstalling WP from scratch if need be. I just need the forum to work properly inside an iFrame.

Thanks in advance.

Iframe height do not resize to match my theme! (how to change heightCalculationMethod)

by axew3 » Sat Mar 07, 2020 5:52 pm

... this is an excerpt of another old post,
how to resolve resize problems, with any theme:

open the overall_footer.html
just after the js code you added, so before the closing </body> tag:
add something like this:

Code: Select all

<div data-iframe-height=""></div>
(or add the attribute data-iframe-height="" to an element on the bottom of the page)
Save, recompile template.

Now open your wordpress page-forums.php template page and
where this line:

Code: Select all

// heightCalculationMethod: 'documentElementOffset', // If iframe not resize correctly, un-comment (or change with one of others available resize methods)
change into:

Code: Select all

heightCalculationMethod: 'taggedElement', // If iframe not resize correctly, un-comment (or change with one of others available resize methods) 

If using the awesome iframe template integration shortcode, relevant file to look into is:

/wp-content/plugins/wp-w3all-phpbb-integration/views/wp_w3all_phpbb_iframe_short.php

https://github.com/davidjbradshaw/ifram ... options.md

Top