Re: [templates] Listing pages

Today Alex showed me how we might break out the Basic Listing Configuration
form from the API_Listing template so that it can be reused as an
Article/Summary or subpages table in any page.

This will solve the problem with the
concepts/mobile_web<http://docs.webplatform.org/wiki/concepts/mobile_web>
page
where including the API_Listing template call over the extant basic page
causes more than one default form to be defined for the page, and the
listing table to be displayed first, before the main content.

The following are my notes from the session, which may be wrong in places
because we ripped through this in ten minutes. Also, I'm only including the
pertinent changes - you can assume the <noinclude> etc.

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|}}}


Anyway, so now the Template:API_Listing looks like this. All it has to do
is set the category:

<includeonly>
[[Category:API_Listings|{{#titleparts:{{PAGENAME}}||-1}}]]
</includeonly>


In the Form:API_Listing, which used to read like this:

{{{for template|API_Listing}}}
==Basic Listing Configuration==
{| class="formtable"
! Query
| {{{field|Query}}}
|-
! Use page title (instead of API_Name):
| {{{field|Use_page_title|input type=checkbox}}}
|-
! Print all subpages rooted here:
| {{{field|List_all_subpages|input type=checkbox}}}
|}
{{{end template}}}

We replace the above with a call to the Concept_Listing form template

{{{for template|API_listing}}
{{Concept_Listing_Form_Section}}


Now we need a Template:Concept_Listing_Form_Section with <nowiki> tags to
keep MediaWiki from gaaking:

==Basic Listing Configuration==
{| class="formtable"
! Query
| <nowiki>{{{field|Query}}}</nowiki>
|-
! Use page title (instead of API_Name):
| <nowiki>{{{field|Use_page_title|input type=checkbox}}}</nowiki>
|-
! Print all subpages rooted here:
| <nowiki>{{{field|List_all_subpages|input type=checkbox}}}</nowiki>
|}
<nowiki>{{{end template}}}</nowiki>


I think that's it, but I might have missed something.

We're planning to get together again next week to put all this in place.

+Scott




On Sat, Dec 8, 2012 at 1:51 AM, PhistucK <phistuck@gmail.com> wrote:

> Old! They are not needed, I think I was trying to create an API_Object
> that would show up on the same page, inside of the listing, hehe.
> Removed.
>
> ☆*PhistucK*
>
>
>
> On Fri, Dec 7, 2012 at 10:56 PM, frozenice <frozenice@frozenice.de> wrote:
>
>> On 05.12.2012 19:08, Scott Rowe wrote:
>>
>>> It would "Use page title instead of API_Name" - which currently doesn't
>>> seem to be working, by the way.
>>>
>>
>> Fixed! Articles might need a purge, if the new column title doesn't show
>> up.
>>
>> I also updated Phistuck's Template:API_Listing_New with these changes.
>> (@Phistuck: what are the {{#set:Subclass_of="well"}} lines in there
>> needed for?)
>>
>> For Alex and others, the technical bits...
>>
>> I had to create a new Template:Summary_Table_Header_**Pages, this is the
>> relevant part in Template:API_Listing now:
>>   introtemplate=Summary_Table_**Header{{#ifeq:{{{Use_page_**
>> title|}}}|Yes|_Pages|}}
>>
>> I tried with SMW's userparam first, but sadly that one doesn't get passed
>> to introtemplate/outrotemplate, but only to template. :(
>>
>>
>

Received on Tuesday, 11 December 2012 22:55:52 UTC