Test-ParserFunctions-in-ExternalData: Difference between revisions

From sandbox
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
==TEST==
==Testing combined use of GetExternalData and ParserFunctions extensions==


=== Current Roster ===
This page is used to test a variety of methods for combining the functionality of the GetExternalData extension with the ParserFunctions extension. Initial attempts to use the two extensions together failed. Though the documentation isn't entirely clear, it appears that since both extensions use the MediaWiki template functionality (using curly braces "{ }" that there is some incompatibility.


Testing will continue but for the immediate future, we have found that using the Display_External_Table format option does work. This option requires the creation of a template for each query and the presence of variable names in both the wiki page and the template makes maintenance somewhat confusing.
=== Test Case:  ===
Display the current Manager / Staff roster from Google Sheet CSV web feed via the CSV import capability of the GetExternalData extension.
Use #ifexist and #ifeq conditionals in the ParserFunctions Extension to "clean up" the import, for example, ensuring that we only show links to a wiki user page if that user page actually exists.
<!--
==== Test Ifeq & Ifexist Outside ExternalData call, with no variables: ====
==== Test Ifeq & Ifexist Outside ExternalData call, with no variables: ====


Line 9: Line 20:
   Test IfExist: Result is.... {{#ifexist: User:Mharrit1 | Mharrit1 User Page Exists | No User Page]]}}
   Test IfExist: Result is.... {{#ifexist: User:Mharrit1 | Mharrit1 User Page Exists | No User Page]]}}


-->
==== Test ifexist in an ExternalData call: ====
==== Test ifexist in an ExternalData call: ====


Line 16: Line 28:
  |data=Name=Name, Email=BestEmail, Role=Primary Role, FirstName=FirstName, LastName=LastName, NickName=NickName, WikiUsername=WikiUsername
  |data=Name=Name, Email=BestEmail, Role=Primary Role, FirstName=FirstName, LastName=LastName, NickName=NickName, WikiUsername=WikiUsername
}}
}}
====Use Display External Table ====
{| class="wikitable"
! Name
! Role
! Wiki User Page
! Email
! WikiUsername
{{#display_external_table:template=ManagerData|data= Name=Name, Role=Role, Email=Email, WikiUsername=WikiUsername }}
|}
ManagerData Template:
{{ManagerData}}
==== Try using display_external_table without table markup. ====
{{#display_external_table:template=ManagerDataNoTable|data= Name=Name, Role=Role, Email=Email, WikiUsername=WikiUsername }}


{| class="wikitable"
{| class="wikitable"
Line 33: Line 66:


====ExternalData without wiki table markup====
====ExternalData without wiki table markup====
{{#for_external_table: {{{ManagerDataNoTable}}}  }}


====Use Display External Table ====
{| class="wikitable"
! Name
! Role
! Wiki User Page
! Email
! WikiUsername


{{#display_external_table:template=ManagerData|data=Name=Name, Role=Role, Email=Email, WikiUsername=WikiUsername }}
|}


ManagerData Template:
{{#for_external_table: {{{wikiusername}}}<p>
{{ManagerData}}
{{CheckUserPage|1= {{{wikiusername}}} }} <p>
{{ManagerDataNoTable| Name={{{Name}}}|Role={{{Role}}}|email={{{email}}}|wikiusername={{{wikiusername}}}  }} <p> }}
 
 
{{ManagerDataNoTable}}

Revision as of 23:53, 23 May 2020

Testing combined use of GetExternalData and ParserFunctions extensions

This page is used to test a variety of methods for combining the functionality of the GetExternalData extension with the ParserFunctions extension. Initial attempts to use the two extensions together failed. Though the documentation isn't entirely clear, it appears that since both extensions use the MediaWiki template functionality (using curly braces "{ }" that there is some incompatibility.

Testing will continue but for the immediate future, we have found that using the Display_External_Table format option does work. This option requires the creation of a template for each query and the presence of variable names in both the wiki page and the template makes maintenance somewhat confusing.


Test Case:

Display the current Manager / Staff roster from Google Sheet CSV web feed via the CSV import capability of the GetExternalData extension.

Use #ifexist and #ifeq conditionals in the ParserFunctions Extension to "clean up" the import, for example, ensuring that we only show links to a wiki user page if that user page actually exists.


Test ifexist in an ExternalData call:

Use Display External Table

Name Role Wiki User Page Email WikiUsername


ManagerData Template:


|- | {{{Role}}} | {{{FirstName}}} | {{{LastName}}} | User:{{{WikiUsername}}} (Page not created)
([[special:Contributions/{{{WikiUsername}}} | {{{FirstName}}}'s Wiki Contributions]]) | send email

Try using display_external_table without table markup.

Name Wiki User Page Role Test


ExternalData without wiki table markup

{{{Name}}} ({{{Email}}}) is WikiUser {{{WikiUsername}}} ({{{Role}}}) and is not a volunteer User Page Doesn't Exist.