sorting viewlets in a grok viewlet manager

Andrew Altepeter <[email protected]> Tue, 26 Jul 2011 14:17:27 -0500
Newsgroups gmane.comp.web.zope.silva.devel
Message-ID <CAEssFdDDWOTGRrTFcTf3-nQkGJTsR=e67+HhaE_OcPs48JVhSQ@mail.gmail.com>
--===============7743725020388373283==
Content-Type: multipart/alternative; boundary=20cf3011db1f468f4104a8fdc82f

--20cf3011db1f468f4104a8fdc82f
Content-Type: text/plain; charset=ISO-8859-1

Hi Devs,

We'll be rolling out our Silva 2.3 upgrade soon.  During final testing of
our new silva.core.layout public layout, we noticed that a viewlet manager
which had two viewlets in it was rendering the viewlets in the wrong order.

In each viewlet, we were using the 'silvaconf.priority' directive to try and
force an order to the viewlets.  It turns out that this does not work.
 While silvaconf.priority is used in some places, for example to control the
order of silva addables in the 'add' list, viewlet managers use this
lower-level grok directive: grok.order.

I wasn't aware of this directive until now, but it turns out it is clearly
explained in the grok reference manual in the directives section:
http://grok.zope.org/doc/current/reference/directives.html

So, after replacing the 'silvaconf.priority' directives in my two viewlets
with 'grok.order', my two viewlets are now sorted the way I want them to be.

happy coding,
Andy

--20cf3011db1f468f4104a8fdc82f
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi Devs,<div><br></div><div>We&#39;ll be rolling out our Silva 2.3 upgrade =
soon. =A0During final testing of our new silva.core.layout public layout, w=
e noticed that a viewlet manager which had two viewlets in it was rendering=
 the viewlets in the wrong order.</div>
<div><br></div><div>In each viewlet, we were using the &#39;silvaconf.prior=
ity&#39; directive to try and force an order to the viewlets. =A0It turns o=
ut that this does not work. =A0While silvaconf.priority is used in some pla=
ces, for example to control the order of silva addables in the &#39;add&#39=
; list, viewlet managers use this lower-level grok directive: grok.order.</=
div>
<div><br></div><div>I wasn&#39;t aware of this directive until now, but it =
turns out it is=A0clearly explained in the grok reference manual in the dir=
ectives section:</div><div><a href=3D"http://grok.zope.org/doc/current/refe=
rence/directives.html">http://grok.zope.org/doc/current/reference/directive=
s.html</a></div>
<div><br></div><div>So, after replacing the &#39;silvaconf.priority&#39; di=
rectives in my two viewlets with &#39;grok.order&#39;, my two viewlets are =
now sorted the way I want them to be.</div><div><br></div><div>happy coding=
,</div>
<div>Andy</div><div><br></div><div><br></div>

--20cf3011db1f468f4104a8fdc82f--

--===============7743725020388373283==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
silva-dev mailing list
silva-dev-IAPFreCvJWM6s/[email protected]
https://lists.infrae.com/mailman/listinfo/silva-dev

--===============7743725020388373283==--