{"id":1620,"date":"2024-12-13T15:55:32","date_gmt":"2024-12-13T15:55:32","guid":{"rendered":"https:\/\/donhit.com\/en\/?p=1620"},"modified":"2025-02-07T08:02:46","modified_gmt":"2025-02-07T08:02:46","slug":"schema-markup","status":"publish","type":"post","link":"https:\/\/donhit.com\/en\/tools\/schema-markup\/","title":{"rendered":"Advanced Schema Markup Generator"},"content":{"rendered":"<p><center> \r\n<div class=\"container mx-auto max-w-6xl\">\r\n        <div class=\"advanced-form rounded-2xl p-8 text-white\">\r\n            <h2 class=\"text-4xl font-bold text-center mb-8 text-white\">Advanced Schema Markup Generator<\/h2>\r\n            \r\n            <div class=\"grid md:grid-cols-2 gap-6\">\r\n                <div>\r\n                    <div class=\"mb-6\">\r\n                        <label class=\"block text-lg mb-2\">Select Schema Type<\/label>\r\n                        <select id=\"schemaType\" class=\"w-full p-3 rounded-lg input-enhanced\">\r\n                            <optgroup label=\"Business & Commerce\">\r\n                                <option value=\"Product\">Product<\/option>\r\n                                <option value=\"LocalBusiness\">Local Business<\/option>\r\n                                <option value=\"Organization\">Organization<\/option>\r\n                                <option value=\"WebSite\">Web Site<\/option>\r\n                            <\/optgroup>\r\n                            <optgroup label=\"Content & Media\">\r\n                                <option value=\"Article\">Article<\/option>\r\n                                <option value=\"BlogPosting\">Blog Posting<\/option>\r\n                                <option value=\"VideoObject\">Video Object<\/option>\r\n                            <\/optgroup>\r\n                            <optgroup label=\"Events & Activities\">\r\n                                <option value=\"Event\">Event<\/option>\r\n                                <option value=\"Course\">Course<\/option>\r\n                            <\/optgroup>\r\n                        <\/select>\r\n                    <\/div>\r\n\r\n                    <div id=\"dynamicSchemaFields\" class=\"space-y-4\">\r\n                        <!-- Dynamic fields will be rendered here -->\r\n                    <\/div>\r\n                <\/div>\r\n\r\n                <div>\r\n                    <div class=\"schema-section p-4 rounded-lg\">\r\n                        <h2 class=\"text-2xl mb-4\">Generated Schema Markup<\/h2>\r\n                        <pre id=\"generatedSchemaOutput\" class=\"bg-black bg-opacity-50 p-4 rounded-lg text-green-300 font-mono max-h-96 overflow-y-auto\"><\/pre>\r\n                    <\/div>\r\n\r\n                    <div class=\"mt-4 flex space-x-4\">\r\n                        <button onclick=\"generateAdvancedSchema()\" class=\"w-full py-3 bg-blue-600 hover:bg-blue-700 rounded-lg transition\">\r\n                            Generate Schema\r\n                        <\/button>\r\n                        <button onclick=\"copySchemaMarkup()\" class=\"w-full py-3 bg-green-600 hover:bg-green-700 rounded-lg transition\">\r\n                            Copy Markup\r\n                        <\/button>\r\n                    <\/div>\r\n                <\/div>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div>\r\n\r\n    <script>\r\n        const advancedSchemaConfig = {\r\n            Product: [\r\n                { name: 'name', type: 'text', label: 'Product Name', required: true },\r\n                { name: 'description', type: 'textarea', label: 'Product Description', required: true },\r\n                { name: 'brand', type: 'text', label: 'Brand Name', required: true },\r\n                { name: 'sku', type: 'text', label: 'SKU', required: false },\r\n                { name: 'price', type: 'number', label: 'Price', required: true },\r\n                { name: 'priceCurrency', type: 'text', label: 'Price Currency', required: true, default: 'USD' },\r\n                { name: 'availability', type: 'select', label: 'Availability', \r\n                    options: ['InStock', 'OutOfStock', 'PreOrder'], \r\n                    required: true \r\n                },\r\n                { name: 'image', type: 'url', label: 'Product Image URL', required: true },\r\n                { name: 'rating', type: 'group', label: 'Product Rating', \r\n                    fields: [\r\n                        { name: 'ratingValue', type: 'number', label: 'Rating Value' },\r\n                        { name: 'reviewCount', type: 'number', label: 'Review Count' }\r\n                    ]\r\n                }\r\n            ],\r\n            LocalBusiness: [\r\n                { name: 'name', type: 'text', label: 'Business Name', required: true },\r\n                { name: 'streetAddress', type: 'text', label: 'Street Address', required: true },\r\n                { name: 'addressLocality', type: 'text', label: 'City', required: true },\r\n                { name: 'addressRegion', type: 'text', label: 'State\/Province', required: true },\r\n                { name: 'postalCode', type: 'text', label: 'Postal Code', required: true },\r\n                { name: 'telephone', type: 'tel', label: 'Phone Number', required: true },\r\n                { name: 'email', type: 'email', label: 'Business Email', required: false },\r\n                { name: 'openingHours', type: 'text', label: 'Opening Hours (e.g., Mo-Fr 09:00-17:00)', required: true },\r\n                { name: 'priceRange', type: 'select', label: 'Price Range', \r\n                    options: ['$', '$$', '$$$', '$$$$'], \r\n                    required: false \r\n                }\r\n            ]\r\n            \/\/ S\u1ebd m\u1edf r\u1ed9ng th\u00eam c\u00e1c schema type kh\u00e1c\r\n        };\r\n\r\n        function renderDynamicFields() {\r\n            const schemaType = document.getElementById('schemaType').value;\r\n            const container = document.getElementById('dynamicSchemaFields');\r\n            container.innerHTML = '';\r\n\r\n            advancedSchemaConfig[schemaType].forEach(field => {\r\n                const fieldElement = createFieldElement(field);\r\n                container.appendChild(fieldElement);\r\n            });\r\n        }\r\n\r\n        function createFieldElement(field) {\r\n            const wrapper = document.createElement('div');\r\n            wrapper.className = 'schema-section p-4 rounded-lg';\r\n\r\n            const label = document.createElement('label');\r\n            label.textContent = field.label + (field.required ? ' *' : '');\r\n            label.className = 'block text-white mb-2';\r\n\r\n            let input;\r\n            if (field.type === 'select') {\r\n                input = document.createElement('select');\r\n                field.options.forEach(opt => {\r\n                    const option = document.createElement('option');\r\n                    option.value = opt;\r\n                    option.textContent = opt;\r\n                    input.appendChild(option);\r\n                });\r\n            } else if (field.type === 'textarea') {\r\n                input = document.createElement('textarea');\r\n            } else {\r\n                input = document.createElement('input');\r\n                input.type = field.type;\r\n            }\r\n\r\n            input.id = field.name;\r\n            input.name = field.name;\r\n            input.className = 'w-full p-3 rounded-lg input-enhanced';\r\n            \r\n            if (field.required) input.required = true;\r\n            if (field.default) input.value = field.default;\r\n\r\n            wrapper.appendChild(label);\r\n            wrapper.appendChild(input);\r\n\r\n            return wrapper;\r\n        }\r\n\r\n        function generateAdvancedSchema() {\r\n            const schemaType = document.getElementById('schemaType').value;\r\n            const schemaData = {\r\n                \"@context\": \"https:\/\/schema.org\",\r\n                \"@type\": schemaType\r\n            };\r\n\r\n            advancedSchemaConfig[schemaType].forEach(field => {\r\n                const input = document.getElementById(field.name);\r\n                if (input.value) {\r\n                    schemaData[field.name] = input.value;\r\n                }\r\n            });\r\n\r\n            document.getElementById('generatedSchemaOutput').textContent = \r\n                JSON.stringify(schemaData, null, 2);\r\n        }\r\n\r\n        function copySchemaMarkup() {\r\n            const schemaText = document.getElementById('generatedSchemaOutput').textContent;\r\n            navigator.clipboard.writeText(schemaText).then(() => {\r\n                alert('Schema markup copied successfully!');\r\n            });\r\n        }\r\n\r\n        document.getElementById('schemaType').addEventListener('change', renderDynamicFields);\r\n        renderDynamicFields();\r\n    <\/script><\/center><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[187],"tags":[],"class_list":["post-1620","post","type-post","status-publish","format-standard","hentry","category-tools"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Advanced Schema Markup Generator - DonHit<\/title>\n<meta name=\"description\" content=\"Advanced schema markup enhances SEO by integrating dynamic features like conditional logic, nesting, and dynamic generation\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/donhit.com\/en\/tools\/schema-markup\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Advanced Schema Markup Generator - DonHit\" \/>\n<meta property=\"og:description\" content=\"Advanced schema markup enhances SEO by integrating dynamic features like conditional logic, nesting, and dynamic generation\" \/>\n<meta property=\"og:url\" content=\"https:\/\/donhit.com\/en\/tools\/schema-markup\/\" \/>\n<meta property=\"og:site_name\" content=\"DonHit - World of Tools\" \/>\n<meta property=\"article:published_time\" content=\"2024-12-13T15:55:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-07T08:02:46+00:00\" \/>\n<meta name=\"author\" content=\"DonHit\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DonHit\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Advanced Schema Markup Generator - DonHit","description":"Advanced schema markup enhances SEO by integrating dynamic features like conditional logic, nesting, and dynamic generation","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/donhit.com\/en\/tools\/schema-markup\/","og_locale":"en_US","og_type":"article","og_title":"Advanced Schema Markup Generator - DonHit","og_description":"Advanced schema markup enhances SEO by integrating dynamic features like conditional logic, nesting, and dynamic generation","og_url":"https:\/\/donhit.com\/en\/tools\/schema-markup\/","og_site_name":"DonHit - World of Tools","article_published_time":"2024-12-13T15:55:32+00:00","article_modified_time":"2025-02-07T08:02:46+00:00","author":"DonHit","twitter_card":"summary_large_image","twitter_misc":{"Written by":"DonHit","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/donhit.com\/en\/tools\/schema-markup\/#article","isPartOf":{"@id":"https:\/\/donhit.com\/en\/tools\/schema-markup\/"},"author":{"name":"DonHit","@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148"},"headline":"Advanced Schema Markup Generator","datePublished":"2024-12-13T15:55:32+00:00","dateModified":"2025-02-07T08:02:46+00:00","mainEntityOfPage":{"@id":"https:\/\/donhit.com\/en\/tools\/schema-markup\/"},"wordCount":10,"commentCount":0,"publisher":{"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148"},"articleSection":["Tools"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/donhit.com\/en\/tools\/schema-markup\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/donhit.com\/en\/tools\/schema-markup\/","url":"https:\/\/donhit.com\/en\/tools\/schema-markup\/","name":"Advanced Schema Markup Generator - DonHit","isPartOf":{"@id":"https:\/\/donhit.com\/en\/#website"},"datePublished":"2024-12-13T15:55:32+00:00","dateModified":"2025-02-07T08:02:46+00:00","description":"Advanced schema markup enhances SEO by integrating dynamic features like conditional logic, nesting, and dynamic generation","breadcrumb":{"@id":"https:\/\/donhit.com\/en\/tools\/schema-markup\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/donhit.com\/en\/tools\/schema-markup\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/donhit.com\/en\/tools\/schema-markup\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Trang ch\u1ee7","item":"https:\/\/donhit.com\/en\/"},{"@type":"ListItem","position":2,"name":"Tools","item":"https:\/\/donhit.com\/en\/category\/tools\/"},{"@type":"ListItem","position":3,"name":"Advanced Schema Markup Generator"}]},{"@type":"WebSite","@id":"https:\/\/donhit.com\/en\/#website","url":"https:\/\/donhit.com\/en\/","name":"DonHit - World of tools","description":"","publisher":{"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/donhit.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148","name":"DonHit","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/donhit.com\/en\/wp-content\/uploads\/2024\/11\/logo-donhit.webp","contentUrl":"https:\/\/donhit.com\/en\/wp-content\/uploads\/2024\/11\/logo-donhit.webp","width":400,"height":267,"caption":"DonHit"},"logo":{"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/image\/"},"description":"DonHit is a website designed to provide useful tools for everyone. Its primary goal is to support and empower the community. All the tools available on the site are completely free to use.","sameAs":["https:\/\/donhit.com\/en"],"url":"https:\/\/donhit.com\/en\/author\/admin_don\/"}]}},"_links":{"self":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1620","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/comments?post=1620"}],"version-history":[{"count":2,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1620\/revisions"}],"predecessor-version":[{"id":2039,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1620\/revisions\/2039"}],"wp:attachment":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/media?parent=1620"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/categories?post=1620"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/tags?post=1620"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}