{"id":1030,"date":"2025-08-25T19:19:36","date_gmt":"2025-08-25T19:19:36","guid":{"rendered":"http:\/\/edk-tech.net\/?p=1"},"modified":"2025-08-25T19:19:36","modified_gmt":"2025-08-25T19:19:36","slug":"add-custom-structured-data-to-invision-community-pages-database","status":"publish","type":"post","link":"https:\/\/edk-tech.net\/?p=1030","title":{"rendered":"Add Custom Structured Data to Invision Community Pages Database"},"content":{"rendered":"<html><body><p><style>.siteseo-toc-wrapper { padding: 20px; border: 1px solid #a2a9b1; background-color: #f8f9fa;}.siteseo-toc-wrapper p { display:flex; align-items:center; gap: 10px; font-size: 1.5rem; font-weight: 500; margin: 0 0 10px 0;}.siteseo-toc-wrapper > ol { margin: 0; padding: 0;}.siteseo-toc-wrapper p>label { font-weight: 400; font-size: 0.9rem;}#siteseo-toc-toggle~span { cursor: pointer;}#siteseo-toc-toggle:checked~.siteseo-toc-hide,p:has(#siteseo-toc-toggle:checked) ~ ol { display: none;}#siteseo-toc-toggle:not(:checked) ~ .siteseo-toc-hide{ display: inline;}#siteseo-toc-toggle:not(:checked) ~ .siteseo-toc-show { display: none;}<\/style>\n\t\t\t<div class=\"siteseo-toc-wrapper\">\n\t\t\t<p>Table of Content <label for=\"siteseo-toc-toggle\">\n\t\t\t<input type=\"checkbox\" style=\"display:none;\" id=\"siteseo-toc-toggle\" name=\"siteseo-toc-toggle\"\/>\n\t\t\t[<span class=\"siteseo-toc-hide\">hide<\/span><span class=\"siteseo-toc-show\">show<\/span>]<\/label><\/p>\n\t\t\t<ol><ol><li><a href=\"#basic-implementation-create-a-custom-field-where-static-json-ld-structured-data-can-be-added\">Basic Implementation: Create a custom field where static JSON-LD structured data can be added<\/a><\/li><li><a href=\"#moderatorate-implementation\">Moderate Implementation: Create a custom field that dynamically calls and maps variables and properties<\/a><\/li><ol><li><a href=\"#necessary-variables\">Necessary Variables<\/a><\/li><li><a href=\"#properties-fieldtypes\">Schema.org Properties and DB Field Types<\/a><\/li><li><a href=\"#basic-instructions\">Basic Instructions<\/a><\/li><ol><li><a href=\"#display-custom-format\">Display Custom Format<\/a><\/li><\/ol><\/ol><li><a href=\"#frequently-asked-questions\">Frequently Asked Questions<\/a><\/li><\/ol><\/div>\n\n\n\n<\/p><p>Notice: This article is for providing insight on how to add custom schema markup to \u201cDatabases\u201d in Invision Community\u2019s Pages application.<\/p>\n\n\n\n<p>There are a few ways to structured data an Invision Community Pages\u2019 Database:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Implement Microdata, RDFa, or JSON-LD into a Database template and custom fields,<\/li>\n\n\n\n<li>Create a custom field that allows authors to create customized JSON-LD schema markup,<\/li>\n\n\n\n<li>Use a custom field to implement JSON-LD and map variables to properties.<\/li>\n<\/ol>\n\n\n\n<div class=\"wp-block-group has-global-padding is-layout-constrained wp-block-group-is-layout-constrained\">\n<h2 class=\"wp-block-heading\" id=\"basic-implementation-create-a-custom-field-where-static-json-ld-structured-data-can-be-added\">Basic Implementation: Create a custom field where static JSON-LD structured data can be added<\/h2>\n\n\n\n<p>This is the simplest method and will require post authors to create custom JSON-LD structured markup for each post. See <a href=\"\/#moderatorate-implementation\">Moderate Implementation<\/a> below for automatically generating structured markup.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In your Invision Community AdminCP, navigate to \u201cPages\u201d menu item and click the \u201cfields\u201d menu item for your database.<\/li>\n\n\n\n<li>Create a new field and give a title, such as \u201cSchema Markup\u201d or whatever you\u2019d like.<\/li>\n\n\n\n<li>For the \u201cType\u201d, select \u201cCode\u201d.<\/li>\n\n\n\n<li>Optional: If you are to generated forum topics for posts in your database, you can include this schema markup to help search engine understand what the topic is and about.\n<ul class=\"wp-block-list\">\n<li>You can add <code>&lt;script type=\"application\/jd+json\"&gt;{value}&lt;\/script&gt;<\/code> to the \u201cTopic Format\u201d field box.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Toggle the Accept HTML option.<\/li>\n\n\n\n<li>In the \u201cDisplay Options\u201d tab, you can give the field any template key name you want as in will not specifically be called to display it on a post page, i.e., visitors will not see it or know it is on the page.<\/li>\n\n\n\n<li>Optional: As with forum topics, you can include JSON-LD structured data in the listings pages of your database. This can be beneficial for search engines to understand the data on the listing pages as their in no schema markup including on these pages by default. Keep in mind that adding this data to each post can affect the performance of your website, which can affect SEO.\n<ul class=\"wp-block-list\">\n<li>To add JSON-LD structured data to listing post:<\/li>\n\n\n\n<li>Make sure the \u201cshow in listing template\u201d option is toggled to on,<\/li>\n\n\n\n<li>Listing View Format: Custom,<\/li>\n\n\n\n<li>Enter: <code>{{if $formValue}}&lt;script type=\"application\/jd+json\"&gt;{$value|raw}&lt;\/script&gt;{{endif}}<\/code> into the editor box.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Display View section:\n<ul class=\"wp-block-list\">\n<li>Make sure the \u201cshow in display template\u201d option is toggled to on,<\/li>\n\n\n\n<li>Display View Format: Custom,<\/li>\n\n\n\n<li>Enter: <code>{{if $formValue}}&lt;script type=\"application\/jd+json\"&gt;{$value}&lt;\/script&gt;{{endif}}<\/code> into the editor box.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<p>Congrats, you can now enter custom JSON-LD structured data into your posts. To learn more about constructing JSON-LD schema, visit <a href=\"https:\/\/schema.org\/docs\/schemas.html\">Schema.org<\/a> vocabulary website. <\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-group has-global-padding is-layout-constrained wp-block-group-is-layout-constrained\">\n<h2 class=\"wp-block-heading\" id=\"moderatorate-implementation\">Moderate Implementation: Create a custom field that dynamically calls and maps variables and properties<\/h2>\n<\/div>\n\n\n\n<p>This is a more advanced method for dynamically embedded values into JSON-LD structured data. This is likely the best way to implement custom data because once setup, markup is added to each post automatically based on custom fields values.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"necessary-variables\">Necessary Variables<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Variable<\/th><th>Title<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>{$record-&gt;_title}<\/code><\/td><td>Record Title<\/td><td><\/td><\/tr><tr><td><code>{$record-&gt;truncated()|raw}<\/code><\/td><td>Record Content<\/td><td><\/td><\/tr><tr><td><code>{$record-&gt;container()-&gt;url()}<\/code><br><br><code>{$record-&gt;container()-&gt;_title}<\/code><\/td><td>Record Container\/Category<\/td><td><\/td><\/tr><tr><td><code>{$record-&gt;fieldValues()['field_{id#}']}<\/code><\/td><td>fieldValues<\/td><td>Accessing <code>$values<\/code> for Text fields or the <em>key<\/em> (rather than <em>value<\/em>) for <em>Selectbox<\/em> and <em>Checkbox Set<\/em>.<\/td><\/tr><tr><td><code>{$record-&gt;customFieldDisplayByKey('{Template Key}')}<\/code><\/td><td>customFieldDisplayByKey<\/td><td>Accessing the formatted input from the <em>Display View Format<\/em> option.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Note<\/strong>: For fields that will be displayed with any format other than just the value of the field, the ID of those fields are required to populate JSON-LD data with just the field value without the formatting data. The ID will be used with the {$record-&gt;fieldValues()[\u2018field_{id#}\u2019]} variable, replacing {id#} with the ID number, e.g. {$record-&gt;fieldValues()[\u2018field_123\u2019]}.<\/p>\n\n\n\n<p><strong>Note<\/strong>: For <em>Select box<\/em> and <em>Checkbox Set<\/em> fields with multiple options, the <em>fieldValues<\/em> variable will pull the key of the individual option(s). So, it is important to give the options a key that comply with the format of your structured data type from the Schema.org vocabulary. For example, if you are making a \u201cBooks\u201d database, and you want to populate the <em>bookFormat<\/em> property with options from a <em>Checkbox set<\/em>. In order to have valid schema markup, you have to comply with the Schema.org enumeration members for the enumeration type: <em>BookFormatType<\/em>, which are limited to: <em>AudiobookFormat<\/em>, <em>EBook<\/em>, <em>GraphicNovel<\/em>, <em>Hardcover<\/em>, <em>Paperback<\/em>. enumeration will be the key for your options even if your options value is in another language.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"properties-fieldtypes\">Schema.org Properties and DB Field Types<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Schema.org Properties<\/th><th>Database Field Type<\/th><th>Notes<\/th><\/tr><\/thead><tbody><tr><td>genre<\/td><td>Select box or Checkbox Set<\/td><td><\/td><\/tr><tr><td>isbn<\/td><td>Text or Number<\/td><td><\/td><\/tr><tr><td>inLanguage<\/td><td>Select box or Checkbox Set<\/td><td><\/td><\/tr><tr><td>author<\/td><td>Text<\/td><td><\/td><\/tr><tr><td>editor<\/td><td>Text<\/td><td><\/td><\/tr><tr><td>illustrator<\/td><td>Text<\/td><td><\/td><\/tr><tr><td>contributor<\/td><td>Text<\/td><td><\/td><\/tr><tr><td>publisher<\/td><td>Select box or Checkbox Set<\/td><td><\/td><\/tr><tr><td>publisherImprint<\/td><td>Select box or Checkbox Set<\/td><td><\/td><\/tr><tr><td>isPartOf<\/td><td>Select box or Checkbox Set<\/td><td>Used with the <em>BookSeries<\/em> schema.org type.<\/td><\/tr><tr><td>abridged<\/td><td>Checkbox, Radio, or Yes\/No<\/td><td><\/td><\/tr><tr><td>bookFormat<\/td><td>Select box or Checkbox Set<\/td><td><\/td><\/tr><tr><td>bookEdition<\/td><td>Text<\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"basic-instructions\">Basic Instructions<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Create a Database,<\/li>\n\n\n\n<li>Add your custom fields, including any of <a href=\"\/#properties-fieldtypes\" data-type=\"internal\" data-id=\"#properties-fieldtypes\">the above<\/a> that will be mapped to Schema.org Properties. <\/li>\n\n\n\n<li>Create the field that will hold the JSON-LD structured data.\n<ul class=\"wp-block-list\">\n<li>\u201cGeneral Options\u201d tab:\n<ul class=\"wp-block-list\">\n<li><strong>Title<\/strong>: your choice,<\/li>\n\n\n\n<li><strong>Type<\/strong>: Checkbox or Radio,<\/li>\n\n\n\n<li><strong>Default Value<\/strong>: <code>1<\/code>.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\u201cDisplay options\u201d tab:\n<ul class=\"wp-block-list\">\n<li><strong>Template Key<\/strong>: your choice; if you leave this blank, it will be generated automatically when you save the field,<\/li>\n\n\n\n<li><strong>List View section<\/strong>: If you want the structured data to be included on listing pages, you can follow and use the steps below:<\/li>\n\n\n\n<li><strong>Display View section<\/strong>:\n<ul class=\"wp-block-list\">\n<li><strong>Display View Format<\/strong>: Custom,<\/li>\n\n\n\n<li><strong>Display<\/strong>: your choice; If you select <em>Under the item content<\/em> and there are no other fields are there will be a horizontal line with a nothing under it.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"display-custom-format\">Display Custom Format<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>{{if $formValue}}\n&lt;script type=\"application\/ld+json\"&gt;\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@graph\": {\n    \"@type\": \"Book\",\n    \"name\": \"{$record-&gt;_title}\",\n    {{if $record-&gt;customFieldDisplayByKey('pages', 'display')}}\n    \"numberOfPages\": \"{$record-&gt;fieldValues()['field_123']}\",\n    {{endif}}\n    {{if $record-&gt;customFieldDisplayByKey('genre', 'display')}}\n    \"genre\": \"{$record-&gt;fieldValues()['field_123']}\",\n    {{endif}}\n    {{if $record-&gt;customFieldDisplayByKey('isbn', 'display')}}\n    \"isbn\": \"{$record-&gt;fieldValues()['field_11']}\",\n    {{endif}}\n    \"description\": \"{$record-&gt;truncated()|raw}\",\n    {{if $record-&gt;customFieldDisplayByKey('date', 'display')}}\n    \"datePublished\": \"{$record-&gt;fieldValues()['field_123']}\",\n    {{endif}}\n    {{if $record-&gt;customFieldDisplayByKey('language', 'display')}}\n    \"inLanguage\": {\n      \"@type\": \"Language\",\n      \"name\": \"{$record-&gt;fieldValues()['field_123']}\"\n    },\n    {{endif}}\n    \"url\": \"{$record-&gt;url()}\",\n    \"discussionUrl\": \"{$record-&gt;url()?&amp;tab=comments}\",\n    {{if $record-&gt;customFieldDisplayByKey('author', 'display')}}\n    \"author\": {\n      \"@type\": \"Person\",\n      \"name\": \"{$record-&gt;fieldValues()['field_123']}\"\n    },\n   {{endif}}\n   {{if $record-&gt;customFieldDisplayByKey('editor', 'display')}}\n   \"editor\": {\n      \"@type\": \"Person\",\n      \"name\": \"{$record-&gt;fieldValues()['field_123']}\"\n    },\n   {{endif}}\n   {{if $record-&gt;customFieldDisplayByKey('illustrator', 'display')}}\n   \"illustrator\": {\n      \"@type\": \"Person\",\n      \"name\": \"{$record-&gt;fieldValues()['field_123']}\"\n    },\n  {{endif}}\n  {{if $record-&gt;customFieldDisplayByKey('contributor', 'display')}}\n  \"contributor\": {\n      \"@type\": \"Person\",\n      \"name\": \"{$record-&gt;fieldValues()['field_123']}\"\n    },\n  {{endif}}\n  {{if $record-&gt;record_image}}\n  \"thumbnail\": {\n      \"@type\": \"ImageObject\",\n      \"url\": \"{file=\"$record-&gt;_record_image_thumb\" extension=\"cms_Records\"}\"\n    },\n  {{endif}}\n  {{if $record-&gt;customFieldDisplayByKey('publisher', 'display')}}\n    \"publisher\": {\n      \"@type\": \"Organization\",\n      \"name\": \"{$record-&gt;fieldValues()['field_123']}\"\n    },\n  \"copyrightHolder\": {\n      \"@type\": \"Organization\",\n      \"name\": \"{$record-&gt;fieldValues()['field_123']}\"\n    },\n  {{endif}}\n  {{if $record-&gt;customFieldDisplayByKey('imprint', 'display')}}\n  \"publisherImprint\": {\n      \"@type\": \"Organization\",\n      \"name\": \"{$record-&gt;fieldValues()['field_123']}\"\n    },\n  {{endif}}\n  {{if $record-&gt;customFieldDisplayByKey('series', 'display')}}\n  \"isPartOf\": {\n      \"@type\": \"BookSeries\",\n      \"name\": \"{$record-&gt;fieldValues()['field_123']}\"\n    },\n  {{endif}}\n  {{if $record-&gt;customFieldDisplayByKey('abridged', 'display')}}\n  \"abridged\": \"http:\/\/schema.org\/True\",\n  {{endif}}\n  {{if $record-&gt;customFieldDisplayByKey('format', 'display')}}\n  \"bookFormat\": \"{$record-&gt;fieldValues()['field_123']}\",\n  {{endif}}\n  {{if $record-&gt;customFieldDisplayByKey('edition', 'display')}}\n \"bookEdition\": \"{$record-&gt;fieldValues()['field_123']}\",\n {{endif}}\n    \"awards\": \"{$record-&gt;fieldValues()['field_123']}\"\n  }\n}\n&lt;\/script&gt;\n{{endif}}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"frequently-asked-questions\">Frequently Asked Questions<\/h2>\n\n\n\n\n\n<p>According to Google, it is recommended to place JSON-LD in the &lt;head&gt;, but it is okay and valid to place it in the &lt;body&gt;.<\/p>\n\n\n\n\n\n<p>yes, you can ass property values in other languages, but at this time, Im not sure that the actually JSON-LD language has been translated to other languages. This means that you would have to use the JSON-LD language in English and structure it with values in your language.<\/p>\n\n\n<\/body><\/html>","protected":false},"excerpt":{"rendered":"<p>Notice: This article is for providing insight on how to add custom schema markup to &#8220;Databases&#8221; in Invision Community&#8217;s Pages application. There are a few ways to structured data an Invision Community Pages&#8217; Database: Basic Implementation: Create a custom field where static JSON-LD structured data can be added This is the simplest method and will [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[23],"tags":[26],"class_list":{"0":"post-1030","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-knowledgebase","7":"tag-invision-community"},"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/peQefU-gC","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/edk-tech.net\/index.php?rest_route=\/wp\/v2\/posts\/1030","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/edk-tech.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/edk-tech.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/edk-tech.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/edk-tech.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1030"}],"version-history":[{"count":0,"href":"https:\/\/edk-tech.net\/index.php?rest_route=\/wp\/v2\/posts\/1030\/revisions"}],"wp:attachment":[{"href":"https:\/\/edk-tech.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edk-tech.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edk-tech.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}