Re: [tryton-dev] Small questions about Tryton and Nereid

2013-09-23 Thread Sharoon Thomas
On Sun, Sep 22, 2013 at 2:33 PM, Christophe (net)  wrote:

> Le 16/09/2013 04:55, Sharoon Thomas a écrit :
>
>  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.
>>
>
> Yes, I saw this information and I also find a very comprehensive example
> (for me) in the test function of the module. But my question was wearing
> rather the relationship between the object Menu and the object MenuItem.
> Specifically I can not building a custom menu with product category (that's
> OK) and MenuItem objects pointing to article category (my pb is here) or
> any other object.


The full_url field [1] was meant to do exactly that but the function field
is yet to be implemented. However, this is not a difficult job since
version 2.6 since the menu_item.reference (a generic reference field) would
return an active record and you could probably call a method in that which
returns the url. You could then use that to point the menu item to the
object.


[1] https://github.com/openlabs/nereid-cms/blob/master/cms.py#L239


-- 
--
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


Re: [tryton-dev] Small questions about Tryton and Nereid

2013-09-22 Thread Christophe (net)

Le 16/09/2013 04:55, Sharoon Thomas a écrit :

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.


Yes, I saw this information and I also find a very comprehensive example 
(for me) in the test function of the module. But my question was wearing 
rather the relationship between the object Menu and the object MenuItem. 
Specifically I can not building a custom menu with product category 
(that's OK) and MenuItem objects pointing to article category (my pb is 
here) or any other object.



--
Christophe
Adiczion


Re: [tryton-dev] Small questions about Tryton and Nereid

2013-09-16 Thread Christophe
Le lundi 16 septembre 2013 18:55:41 UTC+2, raimonesteve a écrit :
>
> UndefinedError 'trytond.pool.nereid.website object' has no attribute 'menu'
>>
>
> I don't have time to review source code demo. I check website and don't 
> have attribute menu. What CMS tryton module use?
>

Oops, I just re check list of requirements and I realize that I made a 
confusion between your CMS module and nereid-cms module. Sorry for the 
inconvenience and thank you for your answers.


 


Re: [tryton-dev] Small questions about Tryton and Nereid

2013-09-16 Thread Raimon Esteve
>
> UndefinedError 'trytond.pool.nereid.website object' has no attribute 'menu'
>

I don't have time to review source code demo. I check website and don't
have attribute menu. What CMS tryton module use?

Requeriments demo available in:

https://github.com/zikzakmedia/nereid-demo/blob/master/README.md#source-code


Re: [tryton-dev] Small questions about Tryton and Nereid

2013-09-15 Thread Sharoon Thomas
On Sat, Sep 14, 2013 at 10:47 PM, Christophe  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


Re: [tryton-dev] Small questions about Tryton and Nereid

2013-09-15 Thread Christophe
Le dimanche 15 septembre 2013 12:53:56 UTC+2, raimonesteve a écrit :
>
> Nereid-flask repo example:
> https://github.com/zikzakmedia/nereid-demo
>
> You could review sourcecode
>
 Thank you for your reply, I saw your demo and i have testing it, but like 
as I said in the question I asked on github I have an error message on the 
menus when I test this demo:

UndefinedError 'trytond.pool.nereid.website object' has no attribute 'menu'

I have missed something, but I do not know what?


Re: [tryton-dev] Small questions about Tryton and Nereid

2013-09-15 Thread Raimon Esteve
> and more generally, where I could find examples of different treatment
possibility of "urlmap".

Nereid-flask repo example:
https://github.com/zikzakmedia/nereid-demo

You could review sourcecode


[tryton-dev] Small questions about Tryton and Nereid

2013-09-14 Thread Christophe
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. The first is about the menus in Nereid CMS, how 
do we use the menuitems from jinja files? you have an example? and more 
generally, where I could find examples of different treatment possibility 
of "urlmap".

Thank you for any help

Regards

--
Christophe
Adiczion