nystudio107 / craft-seomatic

SEOmatic facilitates modern SEO best practices & implementation for Craft CMS 3. It is a turnkey SEO system that is comprehensive, powerful, and flexible.
https://nystudio107.com/plugins/seomatic
Other
165 stars 69 forks source link

Content SEO : Summary from Field not working #653

Closed LouisCuvelier closed 3 years ago

LouisCuvelier commented 4 years ago

Hi @khalwat,

I would like to use Summary from field for SEO Description Source but it keeps fallback to the global SEO text.

When I try with From field, and select the same field as tested for Summary from field, It works just fine.

SEOmatic : 3.3.4

khalwat commented 4 years ago

Does this not work for all entries, or just one? Have you checked web.log for errors?

If I had to guess, perhaps the text passed in doesn't have enough information to allow for a summary to be extracted

LouisCuvelier commented 4 years ago

Yup, I tested with multiple entries. It doesn't work either.

I just checked and here's the error : [error][nystudio107\seomatic\helpers\Manifest::reportError] Module does not exist in the manifest: vendors~content-seo~dashboard.js

davidhellmann commented 4 years ago

@khalwat have the same error in the logs when I go to: SEOmatic > Content SEO

No Data Available

And an AJAX Error is also there: https://xxx.com/index.php/admin/actions/seomatic/content-seo/meta-bundles?sort=sourceName%7Casc&page=1&per_page=20&siteId=10

When I update to 3.3.5 it looks like it works but within the Content SEO Tab I miss some sections.

khalwat commented 4 years ago

This error isn't relavent/related:

[error][nystudio107\seomatic\helpers\Manifest::reportError] Module does not exist in the manifest: vendors~content-seo~dashboard.js
khalwat commented 4 years ago

@davidhellmann that AJAX issue is because you now have to explicitly enabled the endpoints. This is a separate issue. Just enable them via SEOmatic->Plugin Settings -> Endpoints

khalwat commented 4 years ago

So @LouisCuvelier I just tested this locally using my nystudio107.com blog as a test:

Screen Shot 2020-05-28 at 12 59 07 PM

And the output worked as expected:

<meta name="description" content="Here are the advantages of Docker for me: Each application has exactly the environment it needs to run, including specific versions of any of the plumbing…">

This is me choosing a Matrix content builder as the source field.

So the question is, what is the difference between what you're doing, and what I'm doing?

Can you be as explicit as possible in terms of what field type you're trying to get a Summary from? And also what language / character encoding the content is in?

LouisCuvelier commented 4 years ago

@khalwat Ok so I think I figured out what's wrong.

Summary from field is applied correctly to my page. But, I was looking at the SEO Preview (General) and it appears that the SEO Preview with Summary from field for SEO Description Source fallback to the Global SEO

I'm using simple text fields as sources.

cherrykoda commented 4 years ago

I've had a similar experience where doing "Summary from Field" as the selection on Content SEO > Channel applies and doesn't error, but the output of the preview is showing the global description instead of the summary text.

To reproduce:

  1. Go to Content SEO in seoMatic settings
  2. Edit a Channel that uses a Matrix content builder
  3. Choose the "summary from field" option and select the Matrix field as the target
  4. Click Save
  5. Hard Refresh

Description defaults to whatever the globally set description is.

khalwat commented 4 years ago

@cherrykoda @LouisCuvelier I'm trying to replicate this, but I'm unable to.

I have a global description set up... and then in Content SEO I have the SEO Description Source set to Summary From Field and whether I choose a Rich Text Field or I choose a simple Matrix block, it all "just works"

My guess is that somehow, the function that pulls the content and then extracts the text is returning nothing... so it falls back on the global setting.

Either of you able to do a screen share and some debugging so I can track this down? I can't fix it if I can't reproduce it unfortunately.

cherrykoda commented 4 years ago

Sent you a message! Confirmed its working fine when my matrix field just has basic richtext block in it. But doesnt when the field includes more complex blocks (still has basic richtext blocks in-use for those cases too -- just sandwiched between other block types).

terryupton commented 3 years ago

Just to chime in on this @khalwat . I am also seeing the same bug across a few sites when trying to use 'Summary from' it always defaults back to the global description.

I have tried and rested on both a single text field and a single redactor field.

Any ideas where else to look or if you need more info, happy to work through it if you want. Ping me on Discord.

jmauzyk commented 3 years ago

I'm experiencing this as well. When description is set to Summary From Field it correctly outputs the meta tag. However the Google preview in Content SEO edit pages displays the Global SEO description even though the element selected for Google preview has valid text in the selected field.

cherrykoda commented 3 years ago

@jmauzyk can you confirm if you’re using super table in the field that’s having issues? I’m now suspect that this happens with that plug-in, as my problem goes away when the blocks chosen in my matrix forms are regular redactor or plaintext ones

On Tue, Dec 8, 2020 at 3:00 PM jmauzyk notifications@github.com wrote:

I'm experiencing this as well. When description is set to Summary From Field it correctly outputs the meta tag. However the Google preview in Content SEO edit pages displays the Global SEO description even though the element selected for Google preview has valid text in the selected field.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nystudio107/craft-seomatic/issues/653#issuecomment-740942987, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA45ICRU6JWULFEDEO3AU5LST2AVPANCNFSM4NKT5XWA .

jmauzyk commented 3 years ago

@cherrykoda Nope, for me it's happening with any field type, but only affects the Content SEO preview, not the actual SEO output in templates.

khalwat commented 3 years ago

Is anyone able to get on a video conference call with me to reproduce this issue so we can track it down?

PjGeeroms commented 3 years ago

Also got the problem mentioned above @khalwat. Choosing the matrix field here as source with the summary doesn't seem to correctly update the preview. Though it does correctly output it on the page itself. If I can help in anyway, I'll gladly help.

Screenshots

EDIT: Definitely not matrix field related. Just tried it with a redactor field and same thing happens.

It looks like the preview on the page itself is rendering correctly but not on the settings page. I guess it's trying to fetch the description of the current page instead of the page you're editing there.

If I take a look in the code I find this in the googlePreview which I believe is fetching the current page description? seomatic.tag.get('description').renderAttributes()

khalwat commented 3 years ago

@PjGeeroms if we can do a screen share I'd love to get this sorted!

Book it here: https://savvycal.com/nystudio107/chat

khalwat commented 3 years ago

Addressed in: https://github.com/nystudio107/craft-seomatic/commit/76431c001c425c60ed1675ae7d553f6b4d04a8f3

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-seomatic": "dev-develop as 3.4.12”,

Then do a composer clear-cache && composer update