Hello Justine,

the answer to your first question is not that immediate: the whole
structure of Apache OFBiz follow the MVC pattern, so each interaction of an
user with a web page (for example the main page of the eCommerce site) is
processed by a specific component controller that translates the incoming
requests for the underlying model, which, in short, will perform some
business logic to retrieve data (depending on the request fired  initially
by the user) and responds to the user showing him the results of the
elaboration in a view (aka a web page).
This is great to keep data presentation separated by business logic.

The simplified schema is this:
front end user action -> controller request -> controller view -> screen
widget business logic execution -> rendering back the view to the user

*Example*:

Let's consider a user that is opening an item detail page of an eCommerce
site.
The click of the user on the product image in a category listing, is the
firing request that is received by the ecommerce component controller: the
controller processes the request and will then perform some business logic,
like finding the product in the database, retrieve product contents
(product name, description and such), calculate prices, stock levels, and
so on, and at the end of this process, all the collected data are passed
back into the view (item page), that the final user will see and where all
the informations are displayed.

In OFBiz, views (pages) are represented by Screen Widget elements: a screen
widget is where specific business logic is performed and data collected
made available to the Freemarker template of the page.
Screen widgets are quite powerful and flexible and they could be composed
by other different widgets, each representing a smaller section of the page.

Returning to the standard eCommerce site main page, it's composed by
several widgets divided in 3 main sections: left, center and right; those
widgets will render the elements (freemarker templates) in the page (Search
Catalog box, Other Catalog box, Category view, Featured product box,and so
on..).
To modify the layout of this page in your custom implementation you should
take a deeper look at the ecommerce plugin, starting from the controller
(WEB-INF subdirectory) and follow all the way down to the "main" screen
widget.
Once you get used to it you will be able to fully customize the screens as
per your needs.

Second question: visibility of the categories.

The standard ecommerce implementation requires that a product category to
be rendered should be related to a root category that has to be of type
"Browse Root" and this Browse Root category should be related to a product
catalog.
In short: PRODUCT_CATALOG -> BROWSE ROOT CATEGORY -> CATEGORY1 / CATEGORY2
/ ... /
So probably you should associate your categories this way to your catalog.

If you take a look at the demo back-end Catalog application of OFBiz you
can see this structure already implemented and it can give you an idea of
how it works behind the scenes. :)

Hope I have been clear enough and helped you.

Kind regards,
Giulio

Il giorno ven 15 ott 2021 alle ore 20:40 Justine Nowak <
[email protected]> ha scritto:

> Hello,
>
> How do we change the content of the front page of the eCommerce site? And
> also we have 20+ categories but the categories are not showing up in the
> categories sidebar.
>
> How do we get to do this?
>


-- 
Giulio Speri


*Mp Styl**e Srl*
via Antonio Meucci, 37
41019 Limidi di Soliera (MO)
T 059/684916
M 347/0965506

www.mpstyle.it

Reply via email to