2009/1/13 ipingu <[email protected]>:
>
> Hello,
>
> I'm new to Pylons, there are many things I don't know yet. After
> looking on many docs, I still haven't found what I need, I'm surely
> thinking wrong about something.
>
> Here's my prob, we developed a module that display basically articles.
> It works well.
> Now, we just want to add the ability to subscribe an article to a
> category. Category that are listed into the database.
>
> How can I do to display on the main page both modules, ie a list of
> all categories on one side, and all the articles contained in the
> choosen category on the other ?
>
> 'cause I got one controller for my categories, which has a method list
> () and executes a render('/category/list.mako'), and other one for the
> article, with the method view() and its render('/articles/view.mako').
>
> I'm little confused here, I don't get something.
>
> Is there anyone that can help me / us ?

1st Idea:
Use a SSI or ESI technology:
http://en.wikipedia.org/wiki/Edge_Side_Includes
http://en.wikipedia.org/wiki/Server_Side_Includes

2nd Idea:
In pylons, list() and view() are functions that response an html
content. You can call it, save result, and compose in other page. If
you want only some things you can refactor view() and list() in
sub-functions.

3rd Idea:
Mako (or others template systems) allow you create "functions". Mini
templates in your templates for reuse generation parts. You can use it
for your purpose.

There are more possible ideas (I think). Witch one is better is a very
hard question for me ;-)
1st is speedy in execution (slow in development) solution. 2nd one is
dirtier (example: what about of headers changes in functions?), but
can be useful in some conditions. 3rd one is a standard an easy form
to do it, but a designer gets templates harder to interpret.

Regards,

Javi

>
> Thanks
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to