AKSW / site.ontowiki

HTML Content Publishing system on top of Linked Data
6 stars 7 forks source link

literal helper: allow more then one output (multi value) #21

Closed seebi closed 11 years ago

kkda commented 11 years ago

Something like this? https://github.com/AKSW/site.ontowiki/commit/d41e3e5b36533ef7cf0247865b351ca540f9ea5b

We can add an option to return concatenated string instead of array here, which may also set array && !plain options by default.

kkda commented 11 years ago

Please, explain how exactly you want that to work.

seebi commented 11 years ago

yes, something like "output = first | all" with first as default is fine. @haschek: any more reqs here? you have to use it :-)

haschek commented 11 years ago

We need that to simplify output commands, currently we have to use array/plain configurations and processing the returned array data in the template with for(each) commands and subtemplates. It would be easier to have an literal helper to concenate multiple values of a property with only one command.

I would suggest "foreach" as name of the new parameter, with false|true as possible values. We propably should add another paramter to configure separation output between the single literal outputs.

I personal would even prefer not to use a new "foreach" paramter on the literal method but instead a new literals method that is using the literal method. Probably easier to maintain and better readable code. This literals method can have all configuration of literal method plus the separation parameter.

seebi commented 11 years ago

ok, sounds good for me

white-gecko commented 11 years ago

Isn't this, want the querylist helper does?

kkda commented 11 years ago

querylist currently expects some sparql query (not just a property name) and a template to display query results (it does not provide any markup or output by itself).

kkda commented 11 years ago

We don't really need new arguments for literal helper, if we intend new literals helper to be used in this case.