Extension:PopupPages

PopupPages is an extension that provides three parser functions to (a) display another wiki page within the page containing the parser function, in a "policy"-based manner (b) closes the panel optionally creating a user-cookie and (c) creates (or removes) a cookie if the user clicks a checkbox.

Display Policies
Display policies determine which users are to see the popup. Policies are specified on the  parser function, e.g.


 * cookie-out: if the user has a certain cookie, then the popup is NOT displayed to the user
 * cookie-in: if the user has a certain cookie, then the popup IS displayed to the user
 * groups-out: if the user is a member of any designated group, then the popup is NOT displayed to the user
 * groups-in: if the user is a member of any designated group, then the popup IS displayed to the user

Parser Functions

 * page - the name of the page to be transcluded (ie formatted) as a popup. Default= 'Mediawiki:PopupPage Default'
 * class - the class to be assigned to the popup container. Default= popupPanel
 * popupID - the id to be assigned to the popup container. Default= none
 * policy - comma-separated list of policies for the popup. Default= cookie-out, group-out
 * cookieName - case-sensitive name of a cookie to be tested against policy. Default=PopupPage
 * cookieValue - a value to be tested against policy. Default= PopupPage
 * groups - comma-separated list of user-groups for a policy. Default= none
 * Note: This parser function is normally used once on a transcluding page, allowing all users to opt-out. However multiple instances of this function may appear on the transcluding page, each testing different cookies or user groups.
 * Note: Every transcluding page must have the __NOCACHE__ magic word.
 * Note: Every transcluding page must have the __NOCACHE__ magic word.


 * checkbox label - a label placed to the right of a checkbox. Default= Opt-out of this message
 * class - the class to be assigned to the button container. Default= popupPutter
 * putterID - the token to be assigned to the checkbox container. Default= popupPutter
 * cookieName - case-sensitive name of a cookie to be created or removed. Default=PopupPage
 * cookieValue - a value to be stored for the cookie. Default= PopupPage
 * cookieDays - the lifetime for the cookie. Default= 1
 * Note: This parser function is used on the transcluded page. Multiple cookie-setting checkboxes may appear on a page, each setting different cookies.
 * Note: This parser function is used on the transcluded page. Multiple cookie-setting checkboxes may appear on a page, each setting different cookies.


 * button label - a label for the button. Default= Close message
 * class - the class to be assigned to the checkbox container. Default= popupCloseButton
 * popupClass - the class of the parent element that is to be closed . Default= popupPanel
 * cookieName - case-sensitive name of a cookie to be created by button cick. Default=none
 * cookieValue - a value to be stored for the cookie upon button-click. Default= none
 * cookieDays - the lifetime for the cookie. Default= 1
 * Note: This parser function is normally used once on a transcluded page, to simply close the popup. Multiple close-buttons may exist, each setting different cookies.
 * Note: This parser function is normally used once on a transcluded page, to simply close the popup. Multiple close-buttons may exist, each setting different cookies.

Setup
To install PopupPages, please follow the steps indicated below.
 * Download instructions
 * The latest release may be found at https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/PopupPages.


 * Prerequisites
 * Extension:MagicNoCache - the transcluding page must have the __NOCACHE__ magic word.


 * Copy Files
 * Extract the downloaded archive into folder $IP/extensions/PopupPages/


 * LocalSettings.php
 * Add the following to :