vaersaagod/seomate

Why does "preview" button in element edit page redirects to seo preview?

Closed this issue · 3 comments

Normally this button would just link to entry on frontend. But in some cases it seems to start redirecting to seomate seo preview.
And when i set this in seomatic settings, button just vanishes instead reverting to its original function:

previewEnabled' => false,

Not sure what is causing this specifically, as i just create new craft install, added new section and installed plugin, and preview just directs to frontiend instead of seo preview.

On "affected" website i made sure that entries have correct template path, as i know that wrong template path would make preview and view button disappear.

This isn't a problem with SEOMate, it's what happens when the section has no preview targets defined in its settings – making the preview target added by SEOMate the only preview target.

The "View" button is never actually a link to the entry's URL or template; it's either a menu with links to all the preview targets (if there are multiple), or a simple link to the first and only preview target (if there is only one).

button just vanishes instead reverting to its original function

That's expected behavior; if you disable SEOMate's SEO preview and the section has no preview targets in its settings, there is nothing for the Preview and View buttons to link to, and Craft doesn't render them.

wrong template path would make preview and view button disappear.

No, entry templates (or URIs) are not relevant for the Preview and View buttons (anymore). It's all about the preview targets.

@mmikkel
thanks for explaining!

Duplicate of #69