[geeklog-devel] {blockid}
Dirk Haun
dirk at haun-online.de
Sun May 4 11:25:03 EDT 2008
Here's something I stumbled over while updating geeklog.info:
In block attributes, {blockid} is now available as a variable. It's used
to give blocks a unique ID, e.g.
<div class="block-box" id="{blockid}">
in blockheader.thtml.
Apart from the slight misnomer (it's not the block's ID, bid, but
something derived from the block's title), here are some issues I ran into:
1) It doesn't take national special characters into account. So on
geeklog.info, I now have a block with id="Über_Geeklog2".
Not sure where the 2 comes from, but the actual problem is the umlaut -
it's not valid HTML.
Proposed solution: Instead of trying to clean up the block title using
strtr(), I'd suggest to run it through COM_sanitizeID(). That will give
slightly different results from before, but since this is new code
anyway, it shouldn't affect too many people.
2) Based on the {blockid}, there is some CSS in style.css that controls
how some lists are formatted:
#Admins_Only ul, #User_Functions ul, #Topics ul {
list-style:none;
padding:0px;
margin:0px;
}
In the Professional theme, the Admins Only, User Functions, and Topics
block now all use proper <ul> lists. The above CSS rule makes them
appear like before, i.e. without the bullet points.
But that stops working when you rename the blocks. Like, say, because
you're running a site in German where "Topics" is "Kategorien" ...
Haven't really looked into a proper fix yet - it would probably involve
using more block template files instead of that CSS "hack".
Other ideas?
bye, Dirk
P.S. I actually recognized who wrote that blockid code without looking
it up in CVS ;-)
--
http://www.geeklog.net/
http://geeklog.info/
More information about the geeklog-devel
mailing list