Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
block-level reusable views
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Eric Drechsel  
View profile  
 More options Oct 16 2008, 1:23 am
From: Eric Drechsel <ericd...@gmail.com>
Date: Wed, 15 Oct 2008 22:23:51 -0700 (PDT)
Local: Thurs, Oct 16 2008 1:23 am
Subject: block-level reusable views
Most frameworks have a convention allowing apps to expose reusable
"blocks" or "portlets" etc. These are views which can be embedded in
any page, which may take context passed from the main page view.

For example, a client wants the login form (of Pinax's account app)
displayed on the homepage. Great. I can just reuse the existing view.
Well, no, since the existing view returns a fully-rendered page.
That's the essential problem with making views reusable in this way.

I'd like to have access to all of an app's views for placement on any
page.

How can we make view reuse easier?
 - clever hacks (maybe just grab the block you want from the template
parser? possible to override the "extends" tag?)
 - architectural directions (return "bare" views, wrap them up in a
site template ?)

How do other systems handle it, and with what level of success/
tradeoffs?
 - Grok viewlets?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Drechsel  
View profile  
 More options Oct 16 2008, 1:38 am
From: Eric Drechsel <ericd...@gmail.com>
Date: Wed, 15 Oct 2008 22:38:42 -0700 (PDT)
Local: Thurs, Oct 16 2008 1:38 am
Subject: Re: block-level reusable views
django-app-plugins seems interesting. It allows the admin to place app-
supplied plugins through the admin? Is it possible for the plugins to
be passed context form the containing view? This is a limitation in
Drupal's blocks system (most blocks guess context by looking at urls
and other globals)

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nicola Larosa  
View profile  
 More options Oct 16 2008, 2:30 am
From: Nicola Larosa <nicola.lar...@gmail.com>
Date: Thu, 16 Oct 2008 08:30:32 +0200
Local: Thurs, Oct 16 2008 2:30 am
Subject: Re: block-level reusable views

Eric Drechsel wrote:
> django-app-plugins seems interesting. It allows the admin to place
> app-supplied plugins through the admin? Is it possible for the
> plugins to be passed context form the containing view? This is a
> limitation in Drupal's blocks system (most blocks guess context by
> looking at urls and other globals)

In Django this is usually done with template tags, which may get the
template context.

I did not try them, but in addition to django-app-plugins, I know of thwo
other projects doing something similar:

http://code.google.com/p/django-chunks/

http://code.google.com/p/django-modular/

--
Nicola Larosa - http://www.tekNico.net/

The Internet runs on free software, and not because it has copied
anything from Microsoft. The proprietary software guys like to accuse
free software of not innovating [...]. That's just not true, but guys
like the Mono Project are reinforcing that stereotype.
 - Mark Shuttleworth, June 2008


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Drechsel  
View profile  
 More options Oct 17 2008, 9:40 pm
From: Eric Drechsel <ericd...@gmail.com>
Date: Fri, 17 Oct 2008 18:40:12 -0700 (PDT)
Local: Fri, Oct 17 2008 9:40 pm
Subject: Re: block-level reusable views
Thanks for the links Nicola

django-chunks is for storing one-off content blocks in the DB, then
placing them in templates via the chunks templatetag. It's definitely
related, since it follows the same "provide globally, place at
runtime" workflow that I'm interested in (coming from Drupal, where
that is the norm, and where the builtin "boxes" features of
block.module serves the same purpose as chunks). I use chunks for
allowing content editors to update template text and I think it's
great.

I was referred to django-modular by James iirc earlier, and it seems
right up the same alley as Drupal's hugely powerful Panels [1] module.
My goal is actually to implement panels for Django, although first it
is important to abstract out an API for providing reusable components
which is as general and simple as possible. That's one place where
Panels needs alot of refactoring (although to be fair Earl developed
it as a sort of clean-room remixing of the core drupal component apis,
not a small task) and perhaps django modular too (although I haven't
played with it yet, since it's not 1.0 updated). After all, not
everyone wants a DnD My Yahoo clone; some of us just want a way to
reuse parts of other people's apps without having to write a bunch of
redundant glue code.

I'll check out modular, and see if there is a good api in there to be
abstracted out. For bling, jQuery's Layout demo [2] looks nice (it's
really similar to Panels' content tab, while panels also includes a
simple layout editor)

[1] http://drupal.org/project/panels
[2] http://ui.jquery.com/repository/real-world/layout/

On Oct 15, 11:30 pm, Nicola Larosa <nicola.lar...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Drechsel  
View profile  
 More options Oct 18 2008, 5:28 pm
From: Eric Drechsel <ericd...@gmail.com>
Date: Sat, 18 Oct 2008 14:28:45 -0700 (PDT)
Local: Sat, Oct 18 2008 5:28 pm
Subject: Re: block-level reusable views
Ok, back on Earth, late October 2008, we have template tags. And
template tags are great! Also if many of the reusable views in Pinax
are converted to templatetags, there will already be a simple function
which returns the bare view, which can be decorated to work with any
component API that comes along in the future.

So I ask James + other Pinax core devs: if a bunch of "add templatetag
version of view Y" patches landed in the queue, would that be a
welcome direction?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Tauber  
View profile  
 More options Oct 18 2008, 6:05 pm
From: James Tauber <jtau...@jtauber.com>
Date: Sat, 18 Oct 2008 23:05:48 +0100
Local: Sat, Oct 18 2008 6:05 pm
Subject: Re: block-level reusable views

On Oct 18, 2008, at 10:28 PM, Eric Drechsel wrote:

> Ok, back on Earth, late October 2008, we have template tags. And
> template tags are great! Also if many of the reusable views in Pinax
> are converted to templatetags, there will already be a simple function
> which returns the bare view, which can be decorated to work with any
> component API that comes along in the future.

> So I ask James + other Pinax core devs: if a bunch of "add templatetag
> version of view Y" patches landed in the queue, would that be a
> welcome direction?

We've already done a bunch of that and plan to do more.

(Pinax-specific discussion should move to pinax-users, though)

James


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dougn  
View profile  
 More options Nov 10 2008, 3:25 am
From: Dougn <doug.napole...@gmail.com>
Date: Mon, 10 Nov 2008 00:25:58 -0800 (PST)
Local: Mon, Nov 10 2008 3:25 am
Subject: Re: block-level reusable views

On Oct 16, 12:38 am, Eric Drechsel <ericd...@gmail.com> wrote:

> django-app-plugins seems interesting. It allows the admin to place app-
> supplied plugins through the admin? Is it possible for the plugins to
> be passed context form the containing view? This is a limitation in
> Drupal's blocks system (most blocks guess context by looking at urls
> and other globals)

This is exactly how app-plugins work, you can also pass in explicit
additional context on the plugin point.

I haven't had any time to get back to this, but I want to add a new
type of plugin point and plugin 'generic' (currently there are
registered and unregistered). This would allow any plugin to be
connected to any point. Then we can add points all over the
templates.

Right now, you could create a registered plugin-point for the login
widget, and then the person writing the templates could stick it on
any page they want. Or they could stick in their own unregistered
point for it. But this point would be tied to the plugin and the
plugin would be tied to the point.

The style I was thinking of was the WordPress Theme plugin style
(where you can add the 'tags' section to the 'right' or 'left' column
in your them, etc...).
The template writer would come up with all the generic plugin points,
and then any generic plugin could be assigned to any of the generic
points (multiple at the same time).

The bulk of the app-plugin code is in managing the migration/upgrade
issues so that adding or removing an app, or editing templates will
'do the right thing'.
This is the hardest thing to get right. Even WordPress does not get it
right 100% of the time.

I could use some help on this.

    -Doug


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Drechsel  
View profile  
 More options Nov 15 2008, 6:35 am
From: Eric Drechsel <ericd...@gmail.com>
Date: Sat, 15 Nov 2008 03:35:05 -0800 (PST)
Local: Sat, Nov 15 2008 6:35 am
Subject: Re: block-level reusable views
I must say I don't entirely understand plugin points, especially their
database component. it seems like it is perhaps trying to do too many
things at once. perhaps some use-cases would be helpful for thinking
about how people would use it.

On Nov 10, 12:25 am, Dougn <doug.napole...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dougn  
View profile  
 More options Nov 20 2008, 1:52 am
From: Dougn <doug.napole...@gmail.com>
Date: Wed, 19 Nov 2008 22:52:08 -0800 (PST)
Local: Thurs, Nov 20 2008 1:52 am
Subject: Re: block-level reusable views

On Nov 15, 6:35 am, Eric Drechsel <ericd...@gmail.com> wrote:

> I must say I don't entirely understand plugin points, especially their
> database component. it seems like it is perhaps trying to do too many
> things at once. perhaps some use-cases would be helpful for thinking
> about how people would use it.

It would be more obvious if I could get around to writing the
interface for it.

The best example would be to fire up Pinax and go into the admin and
go to the plugins list.
You can disable the plugins for the profile page and change the
default order with which they appear on the profile page.
You can mark them as 'required' (which right now has no effect but I
will get to...)

You could create User Plugin Preference.
This is where users can override the default plugin settings for a
plugin point. You can change the plugins order and which plugins are
visible on your profile page.
For the profile page this would be changing the order of the items on
that page (say you want your blog posts at the top and your tweets at
the bottom).
You can remove entries (maybe you don't want your tweets on your
public profile page....). Plugins which are marked 'required' can not
be removed by the user preferences.

The Plugin object/model can have plugin preferences hung off of (for
say a plugin which there are administrative configs)
The User Plugin Preferences are an object/model which you can hang
your user preferences for a plugin off of.

My hope is to get back to this and set up some standard views for
creating and modifying the preferences stuff along with some jquery
for the preferences page to make things more obvious.
I was thinking of a modified version of this:

http://www.sunshinesista.plus.com/worthing_test/sortables.html

    -Doug


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dougn  
View profile  
 More options Nov 20 2008, 2:00 am
From: Dougn <doug.napole...@gmail.com>
Date: Wed, 19 Nov 2008 23:00:17 -0800 (PST)
Local: Thurs, Nov 20 2008 2:00 am
Subject: Re: block-level reusable views

On Nov 20, 1:52 am, Dougn <doug.napole...@gmail.com> wrote:

self-replying is bad form, but what the heck.
To drive the point home, I added two Plugin User Preferences on
cloud27 for my account.
I removed my blog posts and made my photos the first item on my
profile (friends are not put on the page via the plugin system):
http://cloud27.com/profiles/dougn/

My account i the only one with these changes... all others use the
defaults:
http://cloud27.com/profiles/brosner/  (for example)

    -Doug


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »