SEOSuite Placeholders - fetch data only

Need to: Fetch data only from “Focus Keywords” field

I know I can use the [[!+ss_meta.keywords]] placeholder to produce the meta tag for keywords, but what I want to fetch are the keywords themselves. I do not need the meta tag wrapping them. This is for structured data. Since I can’t see what the field (technically TV) name is when hovering since none of that works in the new SEOSuite addon (used to in SEOPro), I cant just fetch the data. no version of either placeholder (+) or TV tag (*) works (keywords/meta.keywords). I’ve poked around in the package but I’m not exactly sure where to find that info.

Thanks for any advice!

In the chunks used by seoSuite, tplMeta, tplMetaSocial, …, it constructs the entire element < meta property=“[[+name]]” content=“[[+value:escape]]” >, you just need to replace them with the simple value using [[+value:escape]], so with [[!+ss_meta.keywords]] you will only get the keywords.
Be careful, when modifying the chunk (tpl), you must remember to construct all the meta tags in the head, such as < meta name=“keywords” content=“[[!+ss_meta.keywords]]” >.

The data isn’t stored in a TV. SEOSuite uses custom database tables to store the data → database table modx_seosuite_resource (column keywords), PHP class Sterc\SeoSuite\Model\SeoSuiteResource.


So you could also write a custom snippet to query only the keywords:

<?php
// code for MODX 3.x
use Sterc\SeoSuite\Model\SeoSuiteResource;

$ssResource = $modx->getObject(SeoSuiteResource::class, ['resource_id' => $modx->resource->get('id')]);
if ($ssResource) {
    return $ssResource->get('keywords');
}
return '';

That is perfect! Thank you so much!!

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.