Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(dev/core#5464) Add support for IFRAME URLs via ?_cvwpif=1 #336

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

totten
Copy link
Member

@totten totten commented Nov 12, 2024

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::

  1. Enable the iframe extension
  2. Check the configuration (civicrm/admin/setting/iframe) to see which pages are allowed as IFRAMEs. (Add or remove items to taste.)
  3. Creatiea regular link to the intended page
  4. Append ?_cvwpif=1 to the link

For example, I used this for my own testing:

<html>
<body>

<iframe src="http://wpmaster.127.0.0.1.nip.io:8001/civicrm/event/register?id=7&reset=1&_cvwpif=1" width="90%" height="500">

</body>

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.

@JoeMurray
Copy link

Thanks, @totten !

@kcristiano I'm wondering if you would be a good person to review the session management approach here?

@kcristiano
Copy link
Member

@JoeMurray I can take a look - I am out of the office this week, but back next.

@JoeMurray
Copy link

Thanks, @kcristiano .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants