artesaos / seotools

SEO Tools for Laravel
MIT License
3.04k stars 503 forks source link

application/ld+json data add auto 0: when i add multiple context #286

Closed zahidul1994 closed 1 year ago

zahidul1994 commented 1 year ago
J-Brk commented 1 year ago

Can you complete the full issue template & put the json between in code tags/markdown? Thanks

zahidul1994 commented 1 year ago

this is my code image that is my output
image

rich result said its ok
image but semrush said
image

J-Brk commented 1 year ago

I haven't tried to simulate the problem but based on the code you posted it seems the issue is that you are wrapping the data in an array.

On line 8, try changing: JsonLd::addValues([json_decode(@Blogpost->schemainfo)]); to JsonLd::addValues(json_decode(@Blogpost->schemainfo));

zahidul1994 commented 1 year ago

sory not working for array issue

On Wed, Sep 28, 2022 at 5:03 PM J-Brk @.***> wrote:

I haven't tried to simulate the problem but based on the code you posted it seems the issue is that you are wrapping the data in an array.

On line 8, try changing: @.>schemainfo)]); to @.>schemainfo));

— Reply to this email directly, view it on GitHub https://github.com/artesaos/seotools/issues/286#issuecomment-1260741778, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHU7MSK7QPRDMRBVPHQOABTWAQQX3ANCNFSM6AAAAAAQRJE3MU . You are receiving this because you authored the thread.Message ID: @.***>

J-Brk commented 1 year ago

I have run some tests using JsonLd in combination with json_decode and it's behaving correctly without any problems. I suggest you review your code and the JSON data you are using.