Skip to content
Twig Portal plugin for Craft CMS
Branch: v1
Clone or download
Latest commit a1f7270 Jul 12, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Implement NodeCaptureInterface Jul 12, 2019
.gitignore Initial commit Jul 11, 2019
CHANGELOG.md Prepare 1.0.0-beta.3 Jul 12, 2019
LICENSE.md Initial commit Jul 11, 2019
README.md Initial commit Jul 11, 2019
composer.json Prepare 1.0.0-beta.3 Jul 12, 2019

README.md

Twig Portal plugin for Craft CMS

Adds a portal tag to Twig, to render DOM anywhere in the document.

Installation

The plugin is in beta right now. You can install it manually from the command line with the following commands.

> composer require carlcs/craft-twigportal:^1.0.0-beta.1
> ./craft install/plugin twig-portal

Usage

_layout.html

<body>
    {% block content %}
    {% endblock %}

    {{ portalTarget('modals') }}
</body>

index.html

{% extends '_layout' %}

{% block content %}
    {{ include('_component') }}
{% endblock %}

_component.html

{% portal 'modals' %}
    <p>This will be rendered where the “modals” portal target function is located.</p>
{% endportal %}

License

MIT

You can’t perform that action at this time.