On Sat, Sep 14, 2013 at 10:47 PM, Christophe <c...@adiczion.com> wrote:
> I am being tested with Tryton and Nereid. The Nereid demo site online is > very interesting. So I installed it all (Tryton, nereid, nereid-cms, > nereid-catalog, nerieid-cart-b2c) and I test ... of course beginnings are > shy and I have questions. > Welcome to nereid project. Please feel free to ask questions here (preferred), or in the IRC or even on the Openlabs support chatroom [1]. > The first is about the menus in Nereid CMS, how do we use the menuitems > from jinja files? you have an example? > I guess this part is something which needs a bit of documentation explaining how it works. The nereid.cms.menu model acts as a menu generator for a website. For example you may want to generate a menu out of all the product categories in your tryton instance (like in an ecommerce website), or generate your own tree of menus (like in a CMS). This model is an abstract wrapper to do just this. Let us take first example of a where you want to have menu generated just from your product categories: * model [2]: The target model using which you want to generate this menu (product.category) * children_field [3]: The field in target model (product.category) which would give the children of a selected category. In the case of product category it would be `childs` [4] * url_field [5]: The field with will return the url (or link) which the menu will go to when clicked on. * title_field [6]: The field that should be used to show the name of the category in the HTML. Usually name. * identifier_field [7]: This field would be used for searching the root menu item when used with `menu_for` (explained below) from Jinja. To generate custom menu items (like in a CMS) a model is bundled with the CMS module called nereid.cms.menu.item. Using from Jinja files: The module adds a context_processor [8] to the nereid template context. This means that the function `menu_for` would be available anywhere/anytime in the template context and calling it would call the method `nereid.cms.menu.menu_for` [9]. The usage is explained in the doc string. > and more generally, where I could find examples of different treatment > possibility of "urlmap". > Can you be a little more specific in your question ? URLMaps here correspond to the Werkzeug URL maps [10]. 1. http://www.hipchat.com/gSxShDb7L 2. https://github.com/openlabs/nereid-cms/blob/2.6.0.2/cms.py#L73 3. https://github.com/openlabs/nereid-cms/blob/2.6.0.2/cms.py#L74 4. https://github.com/tryton/product/blob/develop/category.py#L13 5. https://github.com/openlabs/nereid-cms/blob/2.6.0.2/cms.py#L80 6. https://github.com/openlabs/nereid-cms/blob/2.6.0.2/cms.py#L86 7. https://github.com/openlabs/nereid-cms/blob/2.6.0.2/cms.py#L92 8. https://github.com/openlabs/nereid-cms/blob/2.6.0.2/cms.py#L205 9. https://github.com/openlabs/nereid-cms/blob/2.6.0.2/cms.py#L148 10. http://werkzeug.pocoo.org/docs/routing/ Thanks & Regards -- -- Sharoon Thomas Openlabs Technologies & Consulting (P) Limited w: http://www.openlabs.co.in m: +1 813.793.6736 (OPEN) Extn. 200 t: @sharoonthomas - We Win When our Customers Win