|
|
Plone Design Question / David Diskin <david.diskin@verizon.net>
Plone Design Question
David Diskin <david.diskin(at)verizon.net> |
2004-08-15 14:39:39 |
[
FULL ]
|
I'd like to pose a scenario and see how you Plone gurus would approach
it. It's quite simple. The scenario is this: When appropriate, I want
to display a flashing red cancellation of activities notice somewhere near
the top of the home page (perhaps just to the right of the logo or just
above the title of the home page). I want to have a form that the
organization's administrator or the school director could fill out when
they have decided to cancel activities because of bad weather. The form
should have a start and end date/time for the cancellation as well as a
short text field for the text message they want to display.
So, I'm thinking my index.html template for the home page should check for
the existence of this cancellation object and display the message if the
current date/time fall within the cancellation objects's start date, end
date. Would you create an archetype for something called a cancellation?
Or do you think this is overkill. What strategy would you suggest?
Thanks,
David
[...]
|
Re: [ZPUGDC] Plone Design Question / joel@joelburton.com
Re: [ZPUGDC] Plone Design Question
joel(at)joelburton.com |
2004-08-15 22:48:23 |
[
FULL ]
|
On Sun, Aug 15, 2004 at 03:47:00PM -0400, David Diskin wrote:[...]
Plone already has effective date/expiration date and review state, so most
of this is a solved problem.
To make this as flexible as possible, I'd say:
(a) use the "News" type. Have the title be the title ("Classes cancelled
today") and the description be the description ("The following classes...")
If you need to use the bottom for a long explanation (which they would
click a link to get to, you could). On the properties/metadata form,
use a particular subject ("Alert") for these items. Fill in the effective
or expiration date as needed, and publish it.
Change main_template so that, right above the content well, have something
like:
<div tal:repeat="alert context.portal_catalog(portal_type='News',
Subject='Alert')" class="message-or-some-bright-red-class">
<p><b tal:content="alert/Title"></b></p>
<p tal:content="alert/Description"></p>
</div>
This actually allows for more than one alert, if needed.
(b) Same idea, but build a simple Archetypes w/Title and Description.
(c) Same idea, but create a new instance of the News Item type, and call
it Alert. This is an underused idea of the CMF/Plone: you can copy the NewsItem
type in portal_types, and give the copy the name "Alert".
The advantages of (b) and (c) is that they're semantically smarter--
ie, you won't see the alerts in the news box, you don't have to teach people
to put the right subject in, they show up differently when searching, etc.
But, in any case, getting the behavior you want--effective/exp date--is easy.
I'd do (c), myself.
HTH,
- j.
|
Re: [ZPUGDC] Plone Design Question / David Diskin <david.diskin@verizon.net>
Re: [ZPUGDC] Plone Design Question
David Diskin <david.diskin(at)verizon.net> |
2004-08-15 22:55:13 |
[
FULL ]
|
Joel,
Thanks - this really helps a lot.
David
On Sun, 15 Aug 2004 22:48:22 -0500, <joel(at)joelburton.com> wrote:
[...][...][...]
[...]
|
Re: [ZPUGDC] Plone Design Question / David Diskin <david.diskin@verizon.net>
Re: [ZPUGDC] Plone Design Question
David Diskin <david.diskin(at)verizon.net> |
2004-08-17 16:19:52 |
[
FULL ]
|
Joel,
I've tried to modify the main_template (in portal_skins/custom), but I
can't figure out where to put the modification so that it will actually
display in the home page. I deleted the query (just to make sure that
wasn't the problem) and just put in a plain vanilla <p> text </p>
and
that doesn't work either. What's the secret? I've tried inserting here:
<!-- start of main content block -->
<td id="portal-column-content"
tal:define="tabindex python:Iterator(pos=0)">
<metal:block define-slot="content">
<!-- (DHD)get all Cancellation events from the portal_catalog
which are published and where
start < currentDate/Time < end. If there are no
such
events, don't do anything more in this div -->
<div class="cancellationMessage">
<p>Everything is cancelled</p>
</div>
and also right below the Portal status message macro div.
THANKS.
David
On Sun, 15 Aug 2004 22:48:22 -0500, <joel(at)joelburton.com> wrote:
[...][...][...]
[...]
|
Re: [ZPUGDC] Plone Design Question / Joel Burton <joel@joelburton.com>
Re: [ZPUGDC] Plone Design Question
Joel Burton <joel(at)joelburton.com> |
2004-08-17 16:24:55 |
[
FULL ]
|
David Diskin wrote:[...]
Read up about ZPT macros. You're in a page but not in a part that
renders. Therefore, your work is disappearing w/o every being
considered. The <p>test</p> was a good instinct, and one you should
continue to draw on--it's the first thing to test when wondering
"where's my dynamically-generated-content gone?"
|
Re: [ZPUGDC] Plone Design Question / David Diskin <david.diskin@verizon.net>
Re: [ZPUGDC] Plone Design Question
David Diskin <david.diskin(at)verizon.net> |
2004-08-17 23:02:40 |
[
FULL ]
|
I know you're trying not to spoonfeed me and I appreciate that sentiment.
And, I've read up about macros. But, for a newbie to wrap his head around
the main_template is not easy. So, ok, I've been beating my head against
the wall trying to figure out how to properly modify main_template. My
first observation is that it is not designed to be modified at all. It's
just a skeleton made up of a bunch of macros and slots to be filled in by
another template (say document_view). And, so maybe this strategy is not
the best. Perhaps, this Cancellation notice should be put in the
document_view template inside portal_skins/plone_content.
Secondly, though, I still can't see why some standard html can't be
embedded inside the main_template as long as it's not inside a "use-macro"
or "define-slot", but this doesn't seem to work.
Bottom line: I need a bit more help. I'll be glad to seek help from the
Plone list if you get tired of this dialogue.
Thanks,
David
On Tue, 17 Aug 2004 10:48:49 -0400, Joel Burton <joel(at)joelburton.com>
wrote:
[...][...][...]
[...]
|
Re: [ZPUGDC] Plone Design Question / David Diskin <david.diskin@verizon.net>
Re: [ZPUGDC] Plone Design Question
David Diskin <david.diskin(at)verizon.net> |
2004-08-17 23:36:39 |
[
FULL ]
|
All,
Ignore the paragraph below about not being able to modify main_template
and have the mods be visible. That is working now. I still have the
question in the first paragraph.
Thanks,
David
On Wed, 18 Aug 2004 00:10:10 -0400, David Diskin
<david.diskin(at)verizon.net> wrote:
[...]
>>> Joel,
>>>
>>> I've tried to modify the main_template (in portal_skins/custom),
but I
>>> can't figure out where to put the modification so that it will
>>> actually display in the home page. I deleted the query (just to
make
>>> sure that wasn't the problem) and just put in a plain vanilla
<p>
>>> text </p> and that doesn't work either. What's the secret?
I've
>>> tried inserting here:[...][...]
[...]
|
|