Skip to content

This is an hst (Hippo site toolkit) addon to providing structured data using json-ld.

Notifications You must be signed in to change notification settings

openweb-nl/hippo-structured-data-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Structured data addon for Hippo

This is an hst addon to providing structured data using json-ld.

Usage

  • Add Open Web repository, and structured-data dependency to Hippo Site
<dependency>
  <groupId>nl.openweb.hippo.hst</groupId>
  <artifactId>structured-data</artifactId>
  <version>13.0.X</version>
</dependency>
  • Create mapper classes implementing the interface: nl.openweb.structured.data.schema.mapping.StructuredDataMapper

  • Register them in spring

<bean id="breadcrumbList" class="nl.openweb.structured.data.mapper.BreadCrumbListMapper" />
<bean class="nl.openweb.structured.data.mapper.EventMapper" />
  • Define the tag in your jsp
<%@ taglib prefix="sd" uri="http://open-web.nl/hippo/structured-data"% > 

or freemarker:

<#assign sd=JspTaglibs ["http://open-web.nl/hippo/structured-data"] >

Tags to use for immediate rendering

To map the current contentbean in your jsp

<sd:ldJson />

or freemarker:

<@sd.ldJson /> 

It's also possible to define the object and use a named mapper in your jsp

<sd:ldJson bean="${breadcrumbList}" mapper="breadcrumbList"/>

or freemarker:

<@sd.ldJson bean=breadcrumbList mapper=breadcrumbList/>

Tags for Asynchronous rendering

To use this plugin in an asynchronous matter, as headContributions of hippo, use these tags.
As with the original tag, the bean and mapper attributes are optional.

for JSP:

<sd:ldJsonContribution bean="${bean}" mapper="${myBeanMapper}"/> 
<sd:structuredDataPlaceholder/>

for freemarker:

<@sd.ldJsonContribution bean=bean mapper=myBeanMapper/> 
<@sd.structuredDataPlaceholder/>

About

This is an hst (Hippo site toolkit) addon to providing structured data using json-ld.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages