W3C home > Mailing lists > Public > public-webplatform@w3.org > January 2013

Re: [templates] Listing pages

From: Scott Rowe <scottrowe@google.com>
Date: Thu, 3 Jan 2013 16:11:45 -0800
Message-ID: <CAHZLcPpNvfVtCcv1aSVgss36Z+bew1vQV3m-TN+=zTh2oSLH7w@mail.gmail.com>
To: David Kirstein <frozenice@frozenice.de>
Cc: Alex Komoroske <komoroske@google.com>, "public-webplatform@w3.org" <public-webplatform@w3.org>
Okay, we're done.

We have created a
Template:Concept_Listing<http://docs.webplatform.org/wiki/Template:Concept_Listing>
that
can be called in any location on any page where you want to create a table
of links and summaries. (However, it does not allow you to change where the
table is produced on API_Listing pages - see below.)

All you have to do is drop the template call with the query into your page.
Here's the usage:

{{Concept_Listing|
Query=
Use_page_title= {Yes, No, ""}
List_all_subpages= {Yes, No, ""}
}}

This decouples the Basic Listing Configuration section from the
Template:API_Listing
<http://docs.webplatform.org/wiki/Template:API_Listing> (which
now serves only to provide the appropriate category, "API_Listings" to the
page that uses it). This allows you to do landing pages that list and
summarize all of the pages corresponding to the query you supply. See
the Mobile
Web landing page <http://docs.webplatform.org/wiki/concepts/mobile_web> for
an example.

Note, earlier in the thread we considered providing more than the two
extant options for the table header, "Page" and "API Name" - and this is a
good idea, we should pursue it - but we only had bandwidth to do as much as
we did for now.

Also, the Form:API_Listing<http://docs.webplatform.org/wiki/Form:API_Listing>will
continue to include the
Template:Concept_Listing_Form_Section<http://docs.webplatform.org/wiki/Template:Concept_Listing_Form_Section>,
which calls the
Template:Concept_Listing<http://docs.webplatform.org/wiki/Template:Concept_Listing>
at
a specific location, so you can't put the
Template:Concept_Listing<http://docs.webplatform.org/wiki/Template:Concept_Listing>
anywhere
you want in an API_Listing page. The PHP engine will just put it back under
the Summary section when you edit the form. Here's the WebRTC API listing
page <http://docs.webplatform.org/wiki/apis/webrtc> for an example. If you
are creating a new API_Listing page, you do it just like you used to -
there is no change required in creating new API_Listing pages.

However, we will need to update the extant API_Listing pages to use this
new method, because these pages are not yet calling the new
Template:Concept_Listing_Form_Section<http://docs.webplatform.org/wiki/Template:Concept_Listing_Form_Section>
with
a query. Don't worry, though, the
Template:API_Listing<http://docs.webplatform.org/wiki/Template:API_Listing>
provides
for legacy usage in API_Listing pages that still pass the query to it the
old way, so there should be no wreckage in extant API_Listing pages. Once
we have updated all the API_Listing pages, we'll remove the legacy usage.

To update existing API_Listing pages to use the new forms and templates,
see these instructions<http://docs.webplatform.org/wiki/WPD:Creating_API_pages/updating_template_changes>
.

We should also provide instructions for using the Concept_Listing template
call (above) in the appropriate section of the editing guide - perhaps
under a section about creating landing pages. I can do that once Julee has
the architecture set up.

+Scott




On Fri, Dec 28, 2012 at 1:24 AM, David Kirstein <frozenice@frozenice.de>wrote:

> Heya,****
>
> ** **
>
> I can take a look at the weekend, IIRC the things to do were:****
>
> **-          **Move the core stuff from Template:API_Listing to
> Template:Concept_Listing****
>
> **-          **Template:API_Listing now only sets the category****
>
> **-          **In Form:API_Listing the “Basic Listing Configuration” is
> replaced by a call to Template:Concept_Listing_Form_Section****
>
> **-          **You didn’t mention this: is {{{for template|API_Listing}}}
> in Form:API_Listing replaced with {{{for template|Concept_Listing}}}?****
>
> **o   **If so, where is Template:API_Listing called to set the category?**
> **
>
> **o   **If not so, where is Template:Concept_Listing called to generate
> the table?****
>
> ** **
>
> So as it seems this can either be used as {{{for
> template|Concept_listing}}}{{Concept_Listing_Form_Section}}{{{end
> template}}} in Forms or directly via
> {{Concept_Listing|Query={{{Query|}}}|Use_page_title={{{Use_page_title|}}}.
> ****
>
> ** **
>
> You can implement this yourself, if you want – as a learning exercise,
> like you said. :)****
>
> ** **
>
> I’m at work, so no time to check everything, I might have missed something.
> ****
>
> ** **
>
> -fro****
>
> ** **
>
> *Von:* Scott Rowe [mailto:scottrowe@google.com]
> *Gesendet:* Freitag, 28. Dezember 2012 01:07
> *An:* Alex Komoroske
> *Cc:* frozenice; public-webplatform@w3.org
> *Betreff:* Re: [templates] Listing pages****
>
> ** **
>
> Hi frozenice,****
>
> ** **
>
> Alex and I were planning on implementing all this before the holiday
> break, but we got jammed. It would be nice to do this while the site is
> relatively quiet. Would you like to make these changes this week or next
> while the rabble rousers are out of town?****
>
> ** **
>
> +Scott****
>
> ** **
>
> ** **
>
> On Tue, Dec 18, 2012 at 4:48 PM, Alex Komoroske <komoroske@google.com>
> wrote:****
>
> ** **
>
> On Wed, Dec 12, 2012 at 1:27 PM, frozenice <frozenice@frozenice.de> wrote:
> ****
>
> Sounds good! Some remarks inline... :)****
>
>
>
> On 11.12.2012 23:55, Scott Rowe wrote:****
>
> First, we pull the guts out of the Template:API_Listing and make a new
> Template:Concept_Listing:
>
>
> {{#if:{{{Query|}}}|{{#ask:{{{Query|}}}|?Page_Title|?Summary|link=none|format=template|template=Summary_Table_Body|introtemplate=Summary_Table_Header{{#ifeq:{{{Use_page_title|}}}|Yes|_Pages|}}|outrotemplate=Summary_Table_Footer|searchlabel=See
> more pages...}}|}}
> {{#ifeq:{{{List_all_subpages|}}}|Yes|
> ==Subpages==
> {{Special:PrefixIndex/{{PAGENAME}}/}}|}}
>
> Now, I forget, does the following piece go in the above somewhere?
>
> {{Concept_Listing|Query={{{Query|}}}|Use_page_title={{{Use_page_title|}}}*
> ***
>
> ** **
>
> That piece (which is missing }} at the end btw) calls the above one. It
> sits in Form:API_Listing disguised as:
> {{{for template|API_Listing}}}****
>
>
>
> > ! Use page title (instead of API_Name):
> > | <nowiki>{{{field|Use_page_title|input type=checkbox}}}</nowiki>****
>
> As this is going to be included everywhere, should we leave "API Name" as
> the default value or change it?
> The label would have to be adjusted if the default value is changed and we
> propably would need to fix up articles.
> Note that it's currently not possible to pass an arbitrary title to the
> table header template, as I outlined earlier:
> http://lists.w3.org/Archives/Public/public-webplatform/2012Dec/0157.html
>
> Or, we could have more than two values if we change my #ifeq into a
> #switch and provide a select-box instead of a checkbox
> in the form, but that would also require more table header templates (with
> different suffixes, like _Pages).****
>
> ** **
>
> Whew, that could get complicated quickly.  Do we know of use cases for the
> template today that would require more than the two options? If we don't,
> I'd prefer to stay with the checkbox.****
>
> We could reduce redundant code if we put in another nested template, but
> as the summary table header is only 3 lines
> of wiki code, that shouldn't be necessary.
> The select-box would be fueled by a property
> (Property:Concept_Listing_Main_Column_Titles or such :D).
> We could assume "API Name" if nothing is selected yet, so we don't need to
> fix up articles.****
>
> That's a great idea in general.****
>
>
>
> > We replace the above with a call to the Concept_Listing form template
> >
> > {{{for template|API_listing}}
> > {{Concept_Listing_Form_Section}}****
>
> Why did you move {{{end template}}} into the form section template? It's
> the counterpart of {{for template|}},
> so those two should be on the same level (at least for readability,
> Semantic Forms might handle it either way).****
>
> ** **
>
> ** **
>
Received on Friday, 4 January 2013 00:12:13 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:57:37 UTC