nav33d/craft-relations

This package is abandoned and no longer maintained. No replacement package was suggested.

A field type to show reverse related elements

Installs: 6 985

Dependents: 0

Suggesters: 0

Security: 0

Stars: 8

Watchers: 3

Forks: 4

Type:craft-plugin

1.2.1 2019-09-02 20:41 UTC

This package is auto-updated.

Last update: 2021-01-31 00:45:32 UTC


README

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