wjzijderveld / sculpin-related-content-bundle
Sculpin Bundle to generate related content data
Installs: 27
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.4.0
- sculpin/sculpin: ~2.0
- symfony/config: ~2.1
- symfony/dependency-injection: ~2.1
- symfony/http-kernel: ~2.1
This package is not auto-updated.
Last update: 2024-11-09 15:46:24 UTC
README
This Bundle is written to work with Sculpin.
Installation
Composer
$ composer require wjzijderveld/sculpin-related-content-bundle ~1.0
Usage
At this moment, the usage is pretty simple, but can be expanded later on. It works with Sculpin Taxonomy.
First you need to set some tags on you content:
---
title: Foo document
tags: [foo, bar]
---
On every document where you want to show related content, you define the tags to relate this content to:
---
title: Foobar Document
tags: [foo, bar, foobar]
related_content:
post_tags: [foo]
---
When you have done this, you can now use the related_content
variable in your
templates (in this example Twig):
{% if related_content|length %}
<div class="related">
{% for item in related_content %}
<a href="{{ item.url }}">{{ item.title }}</a>
{% endfor %}
</div>
{% endif %}