Forest Bond escribió:
> On Sun, Jul 29, 2007 at 05:49:54PM -0000, Henrik Lied wrote:
>   
>> @Forest: I agree, it should be that simple. But let's say you've got a
>> comment reply plugin. How would we - through a middleware - manage to
>> intercept our usual comment system, and modify the HTML template
>> source to fit the plugin? It's cases like these I see the potential
>> pitfalls of our way of thought. Please, enlighten me if the answer is
>> simple. :-)
>>     
>
> Well, extensibility is tough for exactly that reason.  You have to anticipate
> the ways in which your application might be extended.  This is an extremely
> difficult task, for that simple reason that it is impossible to predict the
> future.
>
> You really don't want to be modifying templates (or any other source files) 
> when
> a new plugin is installed.  What you do want is to have placeholders in your
> templates where plugins may contribute additional markup that will appear on 
> the
> page.
>
> -Forest
>   

What most of you take as prototype is wordpress. And there are quite 
some plugins requiring you to modify your templates. If a plugin is to 
actually *output* anything into a template, it might have a few template 
files that define an outcome. Then, you must only {% include %} that 
file in an appropiate place. Seems flexible enough to me, while newbies 
do only have to copy-paste the include tag into their template.

Of course, if the templating engine is solid, themes are to be released, 
and, as with wordpress, there can be many themes like K2, that are 
already aware of many most-used plugins.

Just to make it clear. It's still the template's job to take care of 
display. The plugin must not *modify* a single source file, as stated above.

And, Forest, if you provide enough hooks where plugins can join the 
app's flow (like the plugin middleware, and the template imports), 
you're done predicting the future. We just have to think about the right 
places where to place hooks.

Actually, is there anyone *really* able to contribute some code to this 
endeavour?

Chris

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

Reply via email to