From: Reini U. <ru...@x-...> - 2004-08-26 22:14:03
|
Dan Frankowski schrieb: > We are also evolving a 'structured data' (a.k.a., 'data with fields') > approach in WikiLens. It's not final yet, but it's getting there. > > Our approach is not necessarily contradictory with yours. I just wanted > to let you know so what we're doing so we can live in harmony. As > always, we'd be happy if Phpwiki would take these changes. As usual, you > can see the latest public source at > http://www.wikilens.org/wikilens-src.tgz. By "public" I mean the code > that's running the web site. We work on internal development versions > that have more changes. > > In detail: > > - a category can have fields (a.k.a., 'structured data'), given by a > field spec page > - fields are stored in meta-data (i.e., not in the page text). We > experimented with in-page text for awhile, and found it looked very > confusing, especially when multi-line data was important (e.g., for > List-s). > - when you edit a page, each field has its own widget. (We have a couple > of WidgetFactory classes for this.) > - when a page is displayed, the 'default' field displayer knows how to > display each field; also, each field is passed through the wiki markup > transformer, so one can include links, italics, etc. > - optionally, you can create a 'detail page template' that is parsed by > Smarty, so the structured data can be displayed more beautifully. A > functional example (not yet implemented) is to take the "address" of a > restaurant, and create on each restaurant page a link to Mapquest, with > the address bits filled in. So you use the Smarty syntax as template. {$object.property} ... Smarty may be a bit too overloaded for this simple approach. But at least you have fool-proof logic then inside the wiki. For the logic I thought of using our existing html templates. if this else that, foreach list, ... <?plugin SqlResult alias=imdb template=imdbnames SELECT movies.title, movies.date FROM movies as m, names as n, jobs as j, characters as c WHERE n.name="Jeremy Davies" AND m.title_id = c.title_id AND c.job_id = j.job_id AND j.description = 'Actor' GROUP BY m.title ORDER BY m.date DESC ?> (See amdbfront how to get the imdb into mysql easily) But then the data is not inside the wiki. To my problem: I think "%%variable%%" will be the best, since it was used in the earlier branches also. Smarty syntax is quite problematic and only relevant if you use the smarty logic also. > - these structured data fields can also be searched, both on the > category page and by plugin > > Examples: > > 1) Restaurants > > - http://www.wikilens.org/wiki.php/Annie%27s%20Parlour shows several > structured data fields. If you click "edit", it also shows the radio > button and drop-down widgets. The link to "Restaurant" is what puts all > that structured data there, although we are planning to take the > category link out of the page text as well (users erase it, then are > confused when all the fields dissappear). Whow! Pretty impressive. I see what your advantages are. Haven't looked at your advances lately. And I poor guy am struggling with my movie database approach. I thought about fields from an external database (via SqlResult), view only. page meta-data with WidgetFactory is of course much better. > - http://www.wikilens.org/wiki.php/Restaurant shows at the bottom > "Fields: Restaurant/Fields" which gives to the fields spec page. > > 2) Lists > > - http://www.wikilens.org/wiki.php/Dan%27s%20quick%20lunch%20places > shows a particular list with a detail page template. > > - http://www.wikilens.org/wiki.php/List has "Detail page template: > List/Detail Page Template" which gives the detail page template > > - http://www.wikilens.org/wiki.php/List/Detail%20Page%20Template has the > fields which are substituted by Smarty when you visit a list. > > For more detail, see > > - http://www.wikilens.org/wiki.php/WikiLens/StructuredData > - http://www.wikilens.org/wiki.php/WikiLens/StructuredDataTutorial > - > http://www.wikilens.org/wiki.php/WikiLens/StructuredDataTutorial/Developers > > For those who might fear we are evolving a CMS that is too far from > Wiki, I say not true(!): we are still Wiki (people can edit pages, pages > are versioned, recent changes, etc. etc.). However, we felt the need for > pages to have some tool-aided structure, that's all. I will not complain. Others might do, but they became silent in the last year. -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |