I'm trying to set a fallback description in case there is none. This is the bit of code:

{% if seomaticMeta.seoDescription is empty and entry is defined %}
    {% set fallbackDescription = "" %}
    {% if entry.description is defined %}
        {% set fallbackDescription = extractSummary( entry.description ) %}
    {% endif %}
    {% if fallbackDescription is not empty %}
        {% set seomaticMeta = seomaticMeta | merge({
            seoDescription: fallbackDescription,
            og: {
                description: fallbackDescription
            twitter: {
                description: fallbackDescription
        }) %}
    {% endif %}
{% endif %}

But I get an error: Unknown "extractSummary" function in "_globals/_layout".

Am I doing something wrong?


So it sounds to me like either the plugin isn't installed (which doesn't make a ton of sense, because you'd be getting other errors, too), or if it is installed, pieces of it are missing.

extractSummary is a Twig filter/function and has been available since the start; I'd try making sure there's nothing wrong with your install/deploy, or try re-downloading a fresh copy of the SEOmatic plugin.

  • I installed the plugin using composer. I've overwritten the plugin with a downloaded one. And as expected: exactly the same. But the permissions on some files have changed. And the issue is resolved. But I'm not sure if that had something to do with it. – Diederik Aug 10 '17 at 8:41

That method is definitely available as a global function in the latest version.

And it looks like it's been there from the very beginning.

These might sound silly, but maybe double check that the plugin is installed and that you're using the latest version? Even if you are, might be worth re-downloading to make sure you're not missing any of its files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.