Skip to content
A field type to show reverse related elements.
PHP HTML
Branch: v1
Clone or download
Latest commit 3b8df1a Sep 2, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
resources/screenshots Update README Dec 12, 2018
src Hide entry revisions Sep 2, 2019
.gitignore Initial commit Nov 24, 2018
CHANGELOG.md Bump version Sep 2, 2019
LICENSE.md Initial commit Nov 24, 2018
README.md Ability to access relations in template Apr 13, 2019
composer.json Bump version Sep 2, 2019

README.md

Relations plugin for Craft CMS 3

A field type to show reverse related elements.

Requirements

This plugin requires Craft CMS 3.0.0 or later.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:
cd /path/to/project
  1. Then tell Composer to load the plugin:
composer require nav33d/craft-relations
  1. In the Control Panel, go to Settings → Plugins and click the “Install” button for Relations.

Screenshots

Screenshot

Screenshot

Accessing relations in template

You can access relations in template using your field handle. Lets say your field is called relations, you can use the following code block to access relations:

{% if entry.relations %}
  {% for item in entry.relations %}
    <h2>{{ item.title }}</h2>
  {% endfor %}
{% endif %}

Credits

Brought to you by Naveed Ziarab

You can’t perform that action at this time.