Embed Portalmodules

From EQdkp Plus
Jump to navigation Jump to search


tools.php?action=compare_version&repo=core&version=2.3.x&lang=en&.png


Versionsinformation
Core 2.3.x


You can embed portalmodules from your EQdkp Plus to external sites.

  • Go to the Portalmodule Management
  • Edit your portal layout
  • Click on the embedd icon of the portal module you want to embed.

Now, a popup window appears with a HTML Code you can copy and paste into your external site.

<script src="https://test.eqdkp-plus.eu/master/portal/widget.js" type="text/javascript"></script><div id="eqdkp_portal_374de4_17" ></div><script type="text/javascript">EQdkpPortal.init(17, '374de4', 'https://test.eqdkp-plus.eu/master/');</script>

Permissions

You have to adjust some permissions, so that your module can be used from the external site.

Domain

Add the domain of your external site to the allowed JavaScript-Domain (ACP > Settings > Portal > Allowed JavaScript Domains). Please include the protocol of your site, e.g. https://eqdkp-plus.eu

Portal Permissions

Also, you have to configure the portal permission to allow the embedd. Just select "External embed" as permission.

Styling

Please not that the modules do not bring many CSS Stylings with them, to prevent conflicts. Therefore, you have to add own CSS Codes. For example, for the flags of the next events module:

<style>
i.icon-color-green{
	color: #00a400;
}
i.icon-color-red, span.error-message-red{
	color: #E80000;
}
i.icon-color-yellow{
	color: #e9ec00;
}
i.icon-color-orange{
	color: orange;
}
i.icon-color-blue{
	color: blue;
}
i.icon-color-purple{
	color: purple;
}
i.icon-color-gray{
	color: gray;
}
</style>

Preventing conflicts (since 2.3)

The modules load their own jQuery Library and Code, as well as basic CSS Code. You can set Options that these things are not loaded

Prevent loading CSS

Add the following Code before the init method call:

EQdkpPortal.setVar("nocss", 1);

So it should look like this:

<script src="https://test.eqdkp-plus.eu/master/portal/widget.js" type="text/javascript"></script><div id="eqdkp_portal_374de4_17" ></div><script type="text/javascript">EQdkpPortal.setVar("nocss", 1); EQdkpPortal.init(17, '374de4', 'https://test.eqdkp-plus.eu/master/');</script>

Prevent loading JavaScript

Add the following Code before the init method call:

EQdkpPortal.setVar("nojs", 1);

So it should look like this:

<script src="https://test.eqdkp-plus.eu/master/portal/widget.js" type="text/javascript"></script><div id="eqdkp_portal_374de4_17" ></div><script type="text/javascript">EQdkpPortal.setVar("nojs", 1); EQdkpPortal.init(17, '374de4', 'https://test.eqdkp-plus.eu/master/');</script>

Please keep in mind that not all functions from the modules work if JavaScript is not loaded.