Skip to content

Social media image reverts back to Asset container #45

Description

@AtmoFX

It seems impossible to override the asset container used by Alt Seo.

For a particular collection, I want the container to be Documents (I have created it and it works) and I can set and save it (I can see documents as the container in the yaml file):

Image

Yet opening an entry forces the value back to assets.

I suspect code in seo.php, starting line 79, to be responsible for that:

foreach ($containerSettings as $setting) {
    if ($setting['collection'] === $thisEntryHandle) {
        $contents['tabs']['alt_seo']['sections'][0]['fields'][6]['field']['container'] = $setting['asset_handle'] ?? 'assets';
    }
}

IMHO, the if is missing a condition to make it a default only, i.e. something like:

if ($setting['collection'] === $thisEntryHandle &&  $contents['tabs']['alt_seo']['sections'][0]['fields'][6]['field']['container'] == null)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions