We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 54560
    • 1 Posts
    Hi,

    I am new to modx, and I just want to ask if how you can add schema.org to your modx site.

    Thanks,
    Ken
      • 17301
      • 932 Posts
      You add it in just as you would any other html. Lace it into your templates and chunk as and when applicable.

      So for example if you had an organisation you could optionally put this at the top of your HTML (either in a template or chunk).

      <html lang="en-GB" dir="LTR"  itemscope itemtype="http://schema.org/Organization">


      Then proceed to also add in a bunch of meta data like so:

      <!-- SEO Microdata (Schema.org Variant) - Google, Bing, Yahoo -->
      <meta content="[[++company-name]]" itemprop="description">
      <meta content="[[++company-name]]" itemprop="name">
      <meta content="http://www.[[++company-url]]" itemprop="url">
      <meta content="http://www.[[++company-url]]/meta_thumbnail.png" itemprop="image">
      <meta content="info@[[++company-url]]" itemprop="email">
      <meta content="" name="author">
      <meta content="[[*description]]" name="description">
      <meta content="" name="google-site-verification">
      <meta content="[[++company-name]]" name="companyright">

      You could also setup some system settings or template variables and assign those variables to templates to have more control over the microdata of each page - much like the description in the example above would be using the resources individual description.

      Or if you had some products and you were using something like getResources or pdoResources to pull in a bunch of product resources then you could use a chunk laced with schema microdata to do so.

      <div itemscope itemtype="http://schema.org/ItemList">
        <link itemprop="url" href="http://multivarki.ru?filters%5Bprice%5D%5BLTE%5D=39600" />
        <span itemprop="numberOfItems">315</span>
        <div itemprop="itemListElement" itemscope itemtype="http://schema.org/Product">
          <img alt="Photo of product" itemprop="image"
           src="http://img01.multivarki.ru.ru/c9/f1/a5fe6642-18d0-47ad-b038-6fca20f1c923.jpeg" />
          <a itemprop="url" href="http://multivarki.ru/brand_502/">
            <span itemprop="name">BRAND 502</span>
          </a>
          <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
            <span itemprop="price">4399 р.</span>
          </div>...
          <div itemprop="itemListElement" itemtype="http://schema.org/Product">
          ...
          </div>
        </div>
      </div>


      [ed. note: lkfranklin last edited this post 5 years, 8 months ago.]
        ■ email: [email protected] | ■ website: https://alienbuild.uk

        The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
        • 44064
        • 185 Posts
        Alternatively please check also https://json-ld.org/ this format, js code is more useful sometimes than html attributes inclusions
          Anton Tarasov
          MODX Developer

          Email: [email protected]
          Web: antontarasov.com