Adding extension logic to all store pages
Before you begin
- Enable the
env_includeJSPFExtension
JSTL variable. Set the value for theenv_includeJSPFExtension
variable to"true"
in the EnvironmentSetup.jspf file for your store to enable the capability to add extension logic with the JSPFExtToInclude.jspf file. For more information about theenv_includeJSPFExtension
variable and other JSTL variables for your store, see Commonly used JSTL variables in starter store pages.
About this task
By default, all store pages for the Aurora starter store include the JSPFExtToInclude.jspf file, which dynamically retrieves custom extension JSP files for the store pages. The JSPFExtToInclude.jspf file is used to retrieve a list of configuration entries in the STORECONF database table that belong to the store ID for the store pages. The store page JSP files then include the file that is specified in the value column for each entry.
When
you apply this fix, the EnvironmentSetup.jspf file
for your store updates to include the env_includeJSPFExtension
JSTL
variable. This variable controls whether all store pages include the JSPFExtToInclude.jspf file.
By default, this variable is set to "false"
, which
disables the use of the JSPFExtToInclude.jspf file
to dynamically retrieve extension logic.
If you need to include
custom logic on store pages, but you do not need to dynamically retrieve
the custom JSP files, you can update the JSPFExtToInclude.jspf file
manually to include the files. You can then disable the env_includeJSPFExtension
JSTL
variable for your store to improve store performance.
If your site uses an extended sites store model, you can add extension logic to all store pages for any or all stores. You can add entries into the STORECONF table using the ID for either the storefront asset store or a specific store. The list of files that are added to the pages for a store, include the value for all entries for that specific store and for the storefront asset store.
<%@ include file="/Widgets/Common/EnvironmentSetup.jspf"%>
insert into storeconf (storeent_id, name, value, optcounter)values (storeent_id, 'name', 'value', 0);
Where STOREENT_ID
- The store identifier, which identifies the store that is updated to include logic on all pages. For example, 10001
NAME
- The name of the configuration entry. The prefix
'wc.pgl.jspInclude_'
must be declared in the name for a store to include logic within the body of store pages. To include logic within the header section of store pages, use the prefix'wc.pgl.jspIncludeHead_'
in the name.If your site uses logic from multiple vendors, include the vendor name in the name of the configuration entry. For example,
'wc.pgl.jspInclude_vendor_SiteMap'
Where vendor is the name of your company or the company that provides the logic. The value of the name field must be unique for a store in the STORECONF table. VALUE
- The value of the relative path for the configuration entry. This
relative path points to the extension JSP fragment file that you want
to include in every store page. For example,
'/Widgets/com.myCompany.commerce.store.widgets.SiteMap/SiteMap.jsp'
insert into storeconf (storeent_id, name, value, optcounter) values (10001, 'wc.pgl.jspInclude_myCompany_SiteMap',
'/Widgets/com.myCompany.commerce.store.widgets.SiteMap/SiteMap.jsp', 0);
insert into storeconf (storeent_id, name, value) values (10152, 'wc.pgl.jspInclude_myCompany_SiteMap',
'/Widgets/com.myCompany.commerce.store.widgets.SiteMap/SiteMap.jsp', 0);
insert into storeconf (storeent_id, name, value) values (10751, 'wc.pgl.jspInclude_myCompany_SiteMap',
'/Widgets/com.myCompany.commerce.store.widgets.SiteMap/SiteMap.jsp', 0);