Forum .LRN Q&A: Re: RFC: Portlet shading

6: Re: RFC: Portlet shading (response to 1)
Posted by Andrew Grumet on
The TCL shaded_p variable comes from the portlet and
sets the default value for my_porlet_shaded_p.

Ah, okay, you're talking about the mechanics of how to implement it on the client. No problem, I've got this code working. It's patterned after the My Yahoo! code.

One issue though: How is the value in my_portlet_shaded_p
stored back on the server for the user, so next time he
accesses the page he will see the portlet shaded (or not).

I've got this working too. There are some neat little javascript tricks you can use to issue image requests back to the server that actually tweak the database state. This is again from the My Yahoo! code.

The content of the portlet is always transfered from the
server to the browser and the browser decides using JS
depending on the my_portlet_shaded_p (e.g.
forums_shaded_p) parameter whether to display the content
or not.

Right. But I'd still like the system to be able to support server side control for people who really want it. The compromise solution I think is to move the "am I shaded?" check up to the theme level. The idea is to still allow old-style shading (where the am I shaded check *should* be on the server), but make things a little safer for client-side shading (where we feed the "am I shaded?" variable to the client for initialization).

Does this make sense?