on ‎2018 Jun 27 4:52 PM
I have a FooterNavigationComponent, and according to Hybris mechanism, loading impex file matedata, it will go to path:
\hybris\bin\custom\ABC_Extension\web\webroot\WEB-INF\views\responsive\cms\ to retrieve FooterNavigationComponent.jsp.
Now since I have an addon extension, would I change this FooterNavigationComponent.jsp path, so let addon project auto copy this JSP to another ABC_Extension folder path and let Hybris could also recognize it ?
Request clarification before answering.
Guangwei, you can extend the DefaultAddOnCMSComponentRenderer to override methods getVariablesToExpose, exposeVariables and getView() to change the renderer path from extension to your addon.
Followed by creating your own extended renderer class. One needs to define bean for the renderer in your addon-web-spring.xml.
<!-- Renderers for CMS Components in addons -->
<bean id="customAddOnCMSComponentRenderer" class="com.addon.renderer.CustomAddOnCMSComponentRenderer"
parent="addOnJspIncludeCMSComponentRenderer">
</bean>
<!-- Renderer for FooterComponent -->
<bean id="footernavigationcomponentRenderer" parent="customAddOnCMSComponentRenderer" />
<bean id="footernavigationcomponentMapping" parent="addonCmsComponentRendererMapping">
<property name="typeCode" value="FooterNavigationComponent" />
<property name="renderer" ref="footernavigationcomponentRenderer" />
</bean>
Similarly, one can define the bean with the respective custom renderer to can get the default path of JSP from addon.
Thanks, Viji
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guangwei
Please have a look at the link below
https://help.hybris.com/6.7.0/hcd/8acfaf1186691014af82b18f46e90f49.html
Change to reference the customized page view names.
For example, for the page view for the cartPopUp:
Old: String CartPopup = "fragments/cart/cartPopup";
New: String CartPopup = ADDON_PREFIX + "fragments/cart/cartPopup";
Where: String ADDON_PREFIX = "addon:/b2ctelcostorefront/";
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.