Maheshwari,
After changing the files have you executed loading the data to read in
the content of the Theme.xml to the database?
>./gradlew "ofbiz --load-data readers=demo"
I'm not 100% sure if this is still necessary.
Jason
On 08/11/2021 08:06, Mahi maheshwari wrote:
Hi,
I have a newly created ftl file(NavSidebar.ftl) which I have to render onto
the page.
so far I have done this,
1) have created a plugin for the new theme called "xerusTheme"
plugins/xerusTheme/data/XerusThemeDemoData.xml
<entity-engine-xml>
<VisualTheme visualThemeId="XERUS_THEME" visualThemeSetId="BACKOFFICE"
description="xerus theme"/>
</entity-engine-xml>
2) plugins/xerusTheme/widget/Theme.xml has this
<theme name="xerus-theme"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="
http://ofbiz.apache.org/dtds/widget-theme.xsd">
<visual-themes>
<visual-theme id="XERUS_THEME" display-name="Xerus Theme">
<description> theme </description>
<screenshot location="/xerustheme/screenshot1.png"/>
</visual-theme>
</visual-themes>
<extends location="component://common-theme/widget/Theme.xml"/>
<templates>
<template name="screen" type="html" content-type="UTF-8"
encoding="none" encoder="html" compress="false">
<template-file widget="form" location="component://xerus-
theme/template/macro/HtmlFormMacroLibrary.ftl"/>
</template>
</templates>
<theme-properties>
<!--javascript lib-->
<property name="VT_HDR_JAVASCRIPT['add']"
value="/tomahawk/dropdown.js"/>
<!--Css style-->
<property name="VT_STYLESHEET['add']"
value="/xerusTheme/style.css"/>
<property name="VT_HELPSTYLESHEET['add']"
value="/tomahawk/help.css"/>
<property name="VT_DOCBOOKSTYLESHEET['add']"
value="/tomahawk/webapp/tomahawk/docbook.css"/>
<!--header image -->
<property name="VT_HDR_IMAGE_URL" value="/images/ofbiz_logo.png"/>
<!--template location-->
<property name="VT_HDR_TMPLT_LOC"
value="component://xerusTheme/template/Header.ftl"/>
<property name="VT_SIDEBAR_TMPLT_LOC['add']"
value="component://xerusTheme/template/NavSidebar.ftl"/> =>have tried
without ['add'] also
<property name="VT_FTR_TMPLT_LOC"
value="component://xerusTheme/template/Footer.ftl"/>
<property name="VT_MSG_TMPLT_LOC" value="component://common-
theme/template/includes/Messages.ftl"/>
</theme-properties>
</theme>
3) added macro
plugins/xerusTheme/templates/macro/HTMLFormMacroLibrary.ftl
<#include
"component://common-theme/template/macro/HtmlFormMacroLibrary.ftl"/>
<#macro renderDisplayField type imageLocation idName description title
class alert inPlaceEditorUrl="" inPlaceEditorParams="">
<#if description?has_content>
*###*${description?replace("\n", "<br />")}**<#t/>
<#else>
*# #*<#t/>
</#if>
</#macro>
4) plugins/xerusTheme/ofbiz-component.xml
<ofbiz-component name="xerusTheme"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="
http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<!-- define resource loaders; most common is to use the component
resource loader -->
<resource-loader name="main" type="component"/>
<!-- place the config directory on the classpath to access
configuration files -->
<classpath type="dir" location="config"/>
<classpath type="dir" location="dtd"/>
<!-- entity resources: model(s), eca(s), group, and data definitions -->
<entity-resource type="model" reader-name="main" loader="main"
location="entitydef/entitymodel.xml"/>
<!-- <entity-resource type="eca" reader-name="main" loader="main"
location="entitydef/eecas.xml"/> -->
<entity-resource type="data" reader-name="seed" loader="main"
location="data/XerusThemeTypeData.xml"/>
<entity-resource type="data" reader-name="seed" loader="main"
location="data/XerusThemeSecurityPermissionSeedData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main"
location="data/XerusThemeSecurityGroupDemoData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main"
location="data/XerusThemeDemoData.xml"/>
<!-- service resources: model(s), eca(s) and group definitions -->
<service-resource type="model" loader="main"
location="servicedef/services.xml"/>
<!--
<service-resource type="eca" loader="main"
location="servicedef/secas.xml"/>
<service-resource type="group" loader="main"
location="servicedef/groups.xml"/>
-->
<test-suite loader="main" location="testdef/XerusThemeTests.xml"/>
<!-- web applications; will be mounted when using the embedded
container -->
<webapp name="xerusTheme"
title="XerusTheme"
server="default-server"
location="webapp/xerusTheme"
base-permission="OFBTOOLS,XERUSTHEME"
mount-point="/xerusTheme"/>
</ofbiz-component>
I'm not getting what I'm missing.
all my ftl files are in plugins/xerusTheme/template/ =>referThisImage
<https://www.canva.com/design/DAEvH7oAclM/AY2mO6OkWGuEa28GdSrBGA/edit>
Header.ftl , Footer.ftl are rendering but NavSIdebar.ftl is not rendering.
I have made an entry in below mentioned files for NavSidebar.ftl
1) themes/common/widget/commomScreens.xml
screen name="GlobalDecorator" => added line no:152
<set field="homenavigationsidebarTemplateLocation"
from-field="layoutSettings.VT_SIDEBAR_TMPLT_LOC" /> =>referThisImage
<https://www.canva.com/design/DAEvHyb3GXc/TDczAoTUTniYSXhd6drj-Q/edit>
2) framework/common/data/commonTypeData.xml => added line no:117 =>
referThisImage
<https://www.canva.com/design/DAEvHx3eeYY/go9XkDBgxjvIl4mZYt3RLw/edit>
<Enumeration enumId="VT_SIDEBAR_TMPLT_LOC" description="Home Navigation
Sidebar Template Location" enumTypeId="VT_RES_TYPE" sequenceId="26"/>
(this added an entry in enumeration entity =>referThis
<https://www.canva.com/design/DAEvHzJ4yTg/gDsl-r1DuyxjnnexmK4pEg/edit>)
3) themes/common/widget/Theme.xml => added line no:58 =>referToThisImage
<https://www.canva.com/design/DAEvHzPDeEM/ag3aTPZ77x_7cme6l3x6sg/edit>
<property name="VT_SIDEBAR_TMPLT_LOC"
value="component://xerusTheme/template/NavSidebar.ftl"/>
I'm I missing something?
Thanks and Regards,
maheshwari.