(dev/core#5464) Add support for IFRAME URLs via ?_cvwpif=1
#336
+54
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Allow Civi-WP to act as the the provider of IFRAMEs. When embedding a Civi page as an IFRAME, it needs to opt-out of standard cookies, add an alternative session-management ("cosession"), and hide site-wide nav-items.
Before
No option to generate links.
After
You can make an IFRAME referencing a Civi page with these steps::
iframe
extensioncivicrm/admin/setting/iframe
) to see which pages are allowed as IFRAMEs. (Add or remove items to taste.)?_cvwpif=1
to the linkFor example, I used this for my own testing:
Technical Details
The URL formula in this PR is a bit different from the URL in Civi-Drupal/Civi-Backdrop. Compare
iframe.php
with_cvwpif
:http://dmaster.localhost
/iframe.php
/civicrm/event/register?id=7&reset=1
http://wpmaster.localhost/civicrm/event/register?id=7&reset=1
&_cvwpif=1
The key reason is that Drupal/Backdrop have centralized management of the session-cookie, and we can only influence its behavior by intervening at the top of the request. By contrast, WP seems to have sufficient hookability.
To work correctly, this depends on civicrm/civicrm-core#31460. However, it should be safe to merge in either order.