From: Reini U. <ru...@x-...> - 2004-07-10 08:03:52
|
Dan Frankowski schrieb: > I want to enable the creation of user-friendly lists of restaurants, > like "my top 10 favorites". I also want that those restaurants have a > clear owner (perhaps optional), and a list 'type' (like "favorite"). > > Thus, the owner and type need to > > a) be computer-parsable (i.e. I can parse it out of the page) > b) show up visually nice > > It felt to me like the interwiki-map-style URLs are very close to this, > but I'd also like to control the look and feel of the link in the map. > So, right now, if I define a line in InterWikiMap > > ListOwner http:/index.php/ShowLists?user=%s > > and put a link on a page > > ListOwner:DanFr > > it will nicely redirect that link to a plugin (if I write one, which I > haven't). > > However, I don't want to see "ListOwner:DanFr" on the rendered page, I > want to see > > Click to see DanFr's other lists. > > or something, which is all clickable. > > so I thought about trying to expand the InterWikiMap syntax to something > like > > ListOwner http:/index.php/ShowLists?user=%s Click to see %s's other lists > > where all stuff after the 2nd column is the "display" of the link (if > present). > > I can actually see using this quite a bit, because we are having an > increasing number of situations where we want simple machine-parseable > attributes on a page (like "ListOwner", "ListType", "Buddies:", etc. > etc.), but we'd like it to look friendlier. > > Is that a good idea? Is there a better way? CSS and javascript tricks could also render the link differently. See the monobook theme, which changes a lot of links. We have e.g. this in main.css: #bodyContent a[href ^="http://"], #bodyContent a[href ^="gopher://"] { background: url("images/url.png") center right no-repeat; padding-right: 13px; } > If it is a good idea, what are the right places to look at doing this? I > looked a little at InlineParser.php around LinkBracketLink line 365 > (which is where it says getInterwikiMap()). Is this where all the > Interwiki magic happens? If no answer here, I will pursue this myself > next week, but I thought someone might have hints. In PageType.php:PageType_interwikimap the map is read. In various locations in InlineParser.php the (huge) interwiki regex is checked. The most likely usage is class Markup_interwiki. bracket links are normally not used for interwiki maps. -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |