Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 1.03 KB

File metadata and controls

45 lines (31 loc) · 1.03 KB

Netgen Open Graph Bundle installation instructions

Requirements

  • Ibexa Platform 4.0+

Installation steps

Use Composer

Run the following command from your project root to install the bundle:

$ composer require netgen/open-graph-bundle

Activate the bundle

Activate the Netgen\Bundle\OpenGraphBundle\NetgenOpenGraphBundle bundle in config/bundles.php file.

Use the bundle

Add the following in your pagelayout template to output the Open Graph meta tags:

{% if content is defined %}
    {{ render_netgen_open_graph(content) }}
{% endif %}

Alternatively, you can use get_netgen_open_graph(content) to just return the tags and render them manually, for example:

{% if content is defined %}
    {% set meta_tags = get_netgen_open_graph(content) %}

    {% for meta_tag in meta_tags %}
        <meta property="{{ meta_tag.tagName|trim }}" content="{{ meta_tag.tagValue|trim }}" />
    {% endfor %}
{% endif %}