From: Dan F. <dfr...@cs...> - 2004-08-26 18:50:57
|
Reini, 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. - 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). - 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. Dan Reini Urban wrote: > Which syntax should we use for template vars? > > CreatePage lets you create new pages, with the optional template > argument, which prefills a page with content. > > The new CreatePage version will also allow arbitrary variables to be > passed to CreatePage, which should also be possible via the more > beatiful WikiFormRich plugin (editbox, pulldowns, checkboxes, ...). > > Something like: > > "CreateRestaurant" action page: > <?plugin CreatePage template=Templates/Restaurant > vars="location=New York&type=exclusive&rating=5" ?> > > And at any other page: > Create new restaurant: > <?plugin WikiFormRich action=CreateRestaurant > editbox[] name=name > editbox[] name=location > pulldown[] name=type value="exclusive,cheap" > pulldown[] name=rating value="1,2,3,4,5" > textarea[] name=comment > ?> > > The vars for the new page given in name will then be filled with the > given args. > > Template syntax > --------------- > My current version has "%variable%" > Mediawiki uses "{{{variable}}}" > We also had "%%variable%%" and "%%%variable%%%" > in the 1.2.x branch. > > So it will probably be "%%variable%%". > %%% would clash with the line break syntax. > > Any opinions? > > > > Sample > ------- > pagename=Vorlage%2FNeuerFilm; > > [Land/%land%] [Jahr/%jahr%], %director% > [http://xarch.tu-graz.ac.at/home/rurban/film/img/star20.gif] %%% > [MRQE:%pagename% (%jahr%)] [IMDB:%pagename% (%jahr%)] > > Kategorie: [Preview%jahr%] > |