New URL parameter syntax

4 views
Skip to first unread message

Georg Jaehnig

unread,
Apr 6, 2015, 8:08:48 AM4/6/15
to serc...@googlegroups.com
Hi,

for the relaunch of Serchilo, I also plan to change the URL parameter
syntax (again) – which I want to discuss beforehand.

== Current syntax ==

Currently, the syntax follows the OpenSearch template syntax [1]. In
short, this means that

1) arguments get prefixed with 's:' (for Serchilo), e.g.:

{s:query}

2) variables get a category prefix or no prefix, e.g.

{language}
{user:name}

== New syntax ==

The new syntax shall better distinguish between variables and
arguments, and allow further extensions. [2] It shall come with two
main concepts:

1) Arguments are prefixed with '%', Variables with '$'. For example:

{%query}
{$language}
{$user:name}

2) Optional key/value pairs can be added, separated by '|'. For example:

{%Datum|type=date|output=Y-m-d}
{%second argument|order=2}
{%city|function=de.city}

(The key/value names in the examples are not relevant right now but
they show about what extentions I am thinking of.)


== Discussion ==

With these changes, the syntax is not compatible anymore to
OpenSearch. But actually, it wasn't even now, as OpenSearch seems to
have required the {searchTerms} parameter – which wasn't present in
Serchilo URLs. And the new syntax gives more clarity – and allows a
lot of more extensions.

What I am asking you now:

1) Is the syntax clear and self-explaining?
2) Do you know of other, already-established URL syntaxes that would
also suit our needs?

And if all is OK, then a simple "Yes, looks good" would also help. :)

I've created also an issue on Github about this:
https://github.com/georgjaehnig/serchilo-drupal/issues/94


[1] http://www.serchilo.net/help/url
[2] For old Serchilo users, it will look familiar to the pre-2013 syntax.
[3] http://www.opensearch.org/Specifications/OpenSearch/1.1#Required_template_parameters


--
Georg | http://www.serchilo.net - search with shortcuts

Kilian Evang

unread,
Apr 6, 2015, 1:09:12 PM4/6/15
to serc...@googlegroups.com
On 06/04/15 14:08, Georg Jaehnig wrote:
> 1) Is the syntax clear and self-explaining?

Yes, pretty much.

> 2) Do you know of other, already-established URL syntaxes that would
> also suit our needs?

I don't.

> And if all is OK, then a simple "Yes, looks good" would also help. :)

Yes, looks good. :)
Reply all
Reply to author
Forward
0 new messages