No subject


Fri Feb 12 23:10:20 GMT 2010


remain hidden. However, every tag is still accessible to screen readers &
text browsers.  The HTML looks something like this:

<div>
<a href="#tag-a">a</a>
...
</div>

<ul id="tag-a" class="tags">
  <li>alphanumeric</li>
  <li>animal</li>
</ul>

<ul id="tag-z" class="tags">
  <li>zebra</li>
</ul>

*Snags*
The Genshi template ckan/templates/layout_base.html asks for optional head
components in at the end of the head block. This means that any CSS imported
overrides the defaults. This means that downloading from
ajax.googleapis.com/.../jqueryui.css is fast, but leads to inconsistent
styling.

Feedback welcome. If people think this is a beneficial suggestion, I'll add
some polish and submit a patch.

Tim

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

<div class=3D"gmail_quote">On 21 June 2010 10:28, Glen Barnes <span dir=3D"=
ltr">&lt;<a href=3D"mailto:glen at opengovt.org.nz" target=3D"_blank">glen at ope=
ngovt.org.nz</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" sty=
le=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204);=
 padding-left: 1ex;">

Charles Coxhead (<a href=3D"http://twitter.com/charlescoxhead" target=3D"_b=
lank">http://twitter.com/charlescoxhead</a>) did an SEO site review for us =
which can be found here:<br>
<br>
<a href=3D"http://www.quicksitereviews.com/ckan-net/" target=3D"_blank">htt=
p://www.quicksitereviews.com/ckan-net/</a><br></blockquote><div><br>I have =
implemented one of the suggestions in this video. Of all the points in here=
, I think alphabetical pagination of tags would make the biggest difference=
 to users of CKAN. I&#39;ve crafted a fairly attractive solution with JQuer=
yUI&#39;s tabs. I thought I would discuss the solution before I worry about=
 finishing touches like getting JQuery&#39;s CSS to comply with CKAN&#39;s =
default styles. <br>

<br><b>The problem</b><br>Currently, CKAN uses Pylon&#39;s pagination helpe=
r. Which is great at doing what it does, but it uses numerical values. When=
 people visit <a href=3D"http://www.ckan.net/tag/" target=3D"_blank">http:/=
/www.ckan.net/tag/</a>, they encounter pages 1 ... 16. But, if they&#39;re =
looking for a specific tag, it wouldn&#39;t help them too much.<br>
<br><b>My approach</b><br>The tags controller: Select all tags from the db =
by recycling the SQLAlchemy Query object that is already there. From there,=
 create a dict with the 0th letter of each tag as its keys. This results in=
 something like:<br>
<br><span style=3D"font-family: courier new,monospace;">tags =3D dict(</spa=
n><br style=3D"font-family: courier new,monospace;"><span style=3D"font-fam=
ily: courier new,monospace;">=A0 a=3D[&#39;alphanumeric&#39;, &#39;animal&#=
39;, ... ],</span><br style=3D"font-family: courier new,monospace;">
<span style=3D"font-family: courier new,monospace;">=A0 z=3D[&#39;zebra&#39=
;]</span><br style=3D"font-family: courier new,monospace;"><span style=3D"f=
ont-family: courier new,monospace;">)</span><br><br>From there, the templat=
e renders every tag. Using CSS magic, most tags remain hidden. However, eve=
ry tag is still accessible to screen readers &amp; text browsers.=A0 The HT=
ML looks something like this:<br>
<br style=3D"font-family: courier new,monospace;"><span style=3D"font-famil=
y: courier new,monospace;">&lt;div&gt;</span><br style=3D"font-family: cour=
ier new,monospace;"><span style=3D"font-family: courier new,monospace;">&lt=
;a href=3D&quot;#tag-a&quot;&gt;a&lt;/a&gt;</span><br style=3D"font-family:=
 courier new,monospace;">
<span style=3D"font-family: courier new,monospace;">...</span><br style=3D"=
font-family: courier new,monospace;"><span style=3D"font-family: courier ne=
w,monospace;">&lt;/div&gt;</span><br style=3D"font-family: courier new,mono=
space;">
<br style=3D"font-family: courier new,monospace;"><span style=3D"font-famil=
y: courier new,monospace;">&lt;ul id=3D&quot;tag-a&quot; class=3D&quot;tags=
&quot;&gt;</span><br style=3D"font-family: courier new,monospace;"><span st=
yle=3D"font-family: courier new,monospace;">=A0 &lt;li&gt;alphanumeric&lt;/=
li&gt;</span><br style=3D"font-family: courier new,monospace;">
<span style=3D"font-family: courier new,monospace;">=A0 &lt;li&gt;animal&lt=
;/li&gt;</span><br style=3D"font-family: courier new,monospace;"><span styl=
e=3D"font-family: courier new,monospace;">&lt;/ul&gt;</span><br style=3D"fo=
nt-family: courier new,monospace;">
<br style=3D"font-family: courier new,monospace;"><span style=3D"font-famil=
y: courier new,monospace;">&lt;ul id=3D&quot;tag-z&quot; class=3D&quot;tags=
&quot;&gt;</span><br style=3D"font-family: courier new,monospace;"><span st=
yle=3D"font-family: courier new,monospace;">
=A0 &lt;li&gt;zebra&lt;/li&gt;</span><br style=3D"font-family: courier new,=
monospace;"><span style=3D"font-family: courier new,monospace;">
&lt;/ul&gt;</span><br><br><b>Snags</b><br>The Genshi template ckan/template=
s/layout_base.html asks for optional head components in at the end of the h=
ead block. This means that any CSS imported overrides the defaults. This me=
ans that downloading from <a href=3D"http://ajax.googleapis.com/.../jqueryu=
i.css">ajax.googleapis.com/.../jqueryui.css</a> is fast, but leads to incon=
sistent styling.<br>
<br>Feedback welcome. If people think this is a beneficial suggestion, I&#3=
9;ll add some polish and submit a patch.<br><br>Tim<br><br><br></div></div>

--00c09f865bdafe27dd0489edc006--



More information about the ckan-discuss mailing list