dimanche 26 septembre 2021

How to Use If and else In google structured data Json

I am trying to make a custom blogger template and in this i am using google structured data Json

how to use if, else in this json if data:post.firstImageUrl is avilable then - data:post.firstImageUrl else my custom url https://example.com/logo.png

           "image": {
                    "@type": "ImageObject",
                    "width": 1920,
                    "height": 1080,
                    "if": "data:post.firstImageUrl",
                    "then": { 
                        "url": "data:post.firstImageUrl"},
                    "else": {
                        "url":  "https://example.com/logo.png",
                    },
                    "caption": "<data:post.title/>"
            },

Aucun commentaire:

Enregistrer un commentaire