axew3.com

The (awesome) iframe template integration using shortcode

by

NOTE that required settings of this shortcode resides under the WP_w3all Preferences menu.

To use the w3allphpbbiframe shortcode it is required to apply into the phpBB template files overall_header.html and overall_footer.html the same javascript code as it is for the page-forum procedure, and the result will be a full template integration that can be applied into any WP theme.

NOTE that it is Mandatory to set the WP page-name where the shortcode will be added, into the related shortcode option field of the integration plugin admin page, or the shortcode simply will not fire

then use like this:

[w3allphpbbiframe wp_page_name="board" wp_page_iframe_top_gap="300"]
  • wp_page_name param refer to the page/post name/slug where the shortcode will be added (see hint below about this param if omitted*)

  • wp_page_iframe_top_gap param refer to (in pixel) the position where the WP parent page will scroll to by default. If omitted the value will be 0

  • url_push param if omitted is set to YES, that mean when links are clicked into the phpBB iframe, the URL will be pushed into the browser’s address bar. If you want to avoid this behavior, use/add this param like this into the shortcode: url_push="no"

note that the URL push is always avoided when the shortcode is used into the homepage and should in several more conditions. In short words, in all these situations where, when if the URL is pushed into the parent address bar, it cause/lead to a WordPress page NOT found, in the case that there is an intentionally browser’s page reload (because the pushed URL is an URL that WP will not found)

  • phpbb_default_url param (that can be omitted) refer to any phpBB URL where the iframe will be opened by default, so the above become something like this, to display into a WP post the phpBB, that should open by default into a precise forum topic/post or any other page:
[w3allphpbbiframe phpbb_default_url="https://www.axew3.com/w3/forums/viewforum.php?f=2" wp_page_name="board" wp_page_iframe_top_gap="300"]

NOTE that it is mandatory to set the WP pages names/slugs where the shortcode will be added, into the related shortcode option field, on the integration plugin admin page, or the shortcode will not fire!

See the Option: The (awesome) iframe template integration using shortcode

  • scroll_default param if omitted is set to YES by default. To avoid the page scroll behavior set it to no: scroll_default="no"

To edit some css/html output or something else if required, relevant files to look into are:

/wp-content/plugins/wp-w3all-phpbb-integration/common/wp_phpbb_iframe_shortcode.php

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

Note that these two files can be edited as more like and then, activating the related option on plugin admin Use custom files to display Last Topics Widgets, Login Widget and Shortcodes, and coping these files into the custom folder /wp-content/plugins/wp-w3all-custom, when the plugin will be updated, modifications will not be lost.

*Note wp_page_name param: if using Plain permalinks, for example the page name for a post would be p=45 or if it is a page, page_id=12

Note important: if the iframe do not display and you get mixed insecure content on the browser’s console, you have to fix it doing this:

open your WP header.php template file, may just after the others header meta tags add the follow:

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

Follow instructions into the plugin admin page where there is the iframe template integration using shortcode related option.

Example:

[w3allphpbbiframe url_push="no" phpbb_default_url="https://www.axew3.com/w3/forums/viewtopic.php?t=774" wp_page_name="the-awesome-iframe-template-integration-using-shortcode" scroll_default="no"]

will render something like this:

axew3.com