Category pages will indeed be handled by the CategoryController. This is done using URL matching vs the category URL in the database.
If you want to add your own page, you simply create your controller and annotate how you normally would. Let's say you'd like to add a controller that will serve "/testfunctionality". In your controller method, you would for example return "mystore/test". This path corresponds to "/WEB-INF/templates/mystore/test.html" This is because we have "/WEB-INF/templates/" configured as a prefix and ".html" as a suffix. By default, this is done in a Broadleaf application context file and looks like this:
Code: Select all
<bean id="blWebTemplateResolver" class="org.thymeleaf.templateresolver.ServletContextTemplateResolver">
<property name="prefix" value="/WEB-INF/templates/" />
<property name="suffix" value=".html" />
<property name="templateMode" value="HTML5" />
<property name="cacheable" value="false"/>
<property name="characterEncoding" value="UTF-8" />
</bean>
If you declare that bean yourself, you can override these settings.
"mystore/test" should be considered a template fragment, which will by default be included in the standard layout, which as you've identified is at "layout/fullPageLayout". If you'd like to use a different template for this fragment, you can add that definition to the layoutMap object. Say you added
Code: Select all
<entry key="testfunctionality" value="NONE" />
This would then not utilize a layout at all for your page. You could, of course, point it to a different layout as well.
Layouts are served via longest-prefix matching.