Anonymous edits have been disabled on the wiki. If you want to contribute please login or create an account.


Warning for game developers: PCGamingWiki staff members will only ever reach out to you using the official press@pcgamingwiki.com mail address.
Be aware of scammers claiming to be representatives or affiliates of PCGamingWiki who promise a PCGW page for a game key.

Difference between revisions of "Home/ask/assignments/Documentation"

From PCGamingWiki, the wiki about fixing PC games
< Home‎ | ask‎ | assignments
(added iniital documentation)
 
m (removed unnecessary stuff)
Line 1: Line 1:
<div style="clear: both; border: 1px solid #aaaaaa; margin: 1em; margin-top: 3em;">
 
<div style="background: #d7e3f4; margin: 0em; padding: 0.5em; font-weight: bold; font-size: 85%;">Documentation for the below page.</div>
 
<div style="padding: 1em;">
 
 
 
'''Description'''
 
'''Description'''
  
Line 43: Line 39:
  
 
* <code><nowiki> AND DATEDIFF(Release_Date, '2019-05-01') < 0</nowiki></code>
 
* <code><nowiki> AND DATEDIFF(Release_Date, '2019-05-01') < 0</nowiki></code>
 
 
</div>
 
<div style="background: #d7e3f4; padding: 0.5em; margin: 0em; font-size: 85%; text-align: right;"></div>
 
</div>
 

Revision as of 07:24, 31 May 2019

Description

This page makes use of the #cargo_query function to query data from the Assignments Cargo table (populated by the the Assignments page) which is then transcluded unto Home. As part of the database query, the page the DATEDIFF() function to validate if the specified Release Date (also set on the the Assignments page) is between two dates, the first day of the month or the first day of the next month.

Syntax

To add a new section or change what month a section covers, simply make a copy of the syntax below and/or update three specific places:

    <div class="month-container">
        <div class="month">
            <p>April</p>
        </div>
        <table class="pcgwikitable sortable template-infotable" style="max-width: 100%; min-width: 100%; margin: 0 auto">
            {{#cargo_query:
            tables=Assignments
            |fields=Game,Status,Release_Date
            |where=DATEDIFF(Release_Date, '2019-04-01') >= 0 AND DATEDIFF(Release_Date, '2019-05-01') < 0
            |format=template
            |template=:Home/ask/assignments/row
            |limit=10
            |order by=Release_Date ASC
            |more results text=
            }}
        </table>
    </div>

Update these places

  • <p>April</p>
This is the header shown above the table, so just update it so it shows the appropriate name of the month.


  • where=DATEDIFF(Release_Date, '2019-04-01') >= 0
This evaluates if the release date is after the specified date, so change the 2019-04-01 part to the first day of the month that the section should list.
    • For


  • AND DATEDIFF(Release_Date, '2019-05-01') < 0