skip to content
20/07/2018

Define the renderer of a component.

Javlo allows you to associate one or more renderers (a jsp file) with a component, which can vary depending on the configuration and its position.

Reference file

file name: /component-config/#COMP_TYPE#.properties

A file with the component type as its name with the .properties extension lists the renderer (as well as other options). The key for a renderer always starts with "renderer."

Example of references to renderers

renderer.products=/jsp/components/page-reference/product_list.jsp?image=false
renderer.products-image=/jsp/components/page-reference/product_list.jsp?image=true
renderer.products-hover=/jsp/components/page-reference/product_hover.jsp
renderer.square=/jsp/components/page-reference/square.jsp

It is possible to change the renderer depending on the area in which the component is located.

renderer.square.#area#=/jsp/components/page-reference/square_side.jsp

Create a renderer

exposed in jstl, by default, other elements can be exposed by a specific component:

  • comp: the instance of the component (extend IContentVisualComponent)
  • compPage: the current page (PageBean)
  • style: style
  • value: raw value
  • type: the type of the component
  • compid: component id
  • renderer: active renderer
  • previewAttributes: class and id for the component output
  • previewCSS: class css for editing the component + class css of the component
  • previewClass: class css to edit the component
  • previewID: id for editing the component
  • cssStyle: style to configure in the component
  • cssClass: class configure in component
  • manualCssClass: class manually add to component
  • previousSame: true if the previous component is the same type
  • nextSame: true if the next component is of the same type

Example (internal-link)

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"
%><%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"
%><a href="${url}" id="${previewID}" class="${comp.style} ${previewCSS}">${label}</a>