Good evening,
I have uploaded version 1.0.0 of the Mercator Variables extension to the Marketplace. It basically allows you to query Pagekit and pure PHP variables. The one I use most is
I have added this to the Footer Widget and allows a user to just click on Edit page and is taken straight to the editor.
Code
- Variable: Pagekit's Internal Page ID Call: (variables){"id":"pageid"} Usage: Create a link that takes the user straight to editor with this page loaded Example: <a href="admin/site/page/edit?id=(variables){"id":"pageid"}" target="pkedit"> Edit page</a>
- Variable: Server-related date and time information Call: (variables){"id":"datetime", "format": "<format from PHP date() function"} Usage: Provide date/time-related information by calling PHP's date() function with format as paramater Example: (variables){"id":"datetime", "format": "H:i:s"} returns the server's current time (hour/min/sec)
- Variable: Server-related information Call: (variables){"id":"server", "element": "<element of PHP's $_SERVER variable"} Usage: Provide information held in the PHP's $_SERVER global variable Example: (variables){"id":"server", "element": "SERVER_NAME"} returns the name of the server Pagekit runs on
- Variable: Specific role Call: (variables){"id":"user-hasRole", "role": ""} Usage: Check if the current user has a specific role Example: (variables){"id":"role", "role": "Administrator"} returns "true" if the user is an Admin, "false" otherwise
- Variable: Authenticated user Call: (variables){"id":"user-isAuthenticated"} Usage: Check if the current user is authenticated Example: (variables){"id":"user-isAutheticated"} returns "true" if the user is autheticated, "false" otherwise
- Variable: Active / Blocked user Call: (variables){"id":"user-isActive"} Usage: Check if the current user is active (as opposed to blocked) Example: (variables){"id":"user-isActive"} returns "true" if the user is active, "false" if the user is blocked.
- Variable: Login name Call: (variables){"id":"user-loginname", "pre":"", "post":""} Usage: Returns the login name for the current user, prepending "pre" and appending "post" if the user is authenticated Example: (variables){"id":"user-username", "pre":"Hello ", "post":"!"} returns "Hello XYZ!" for the user XYZ, "" if the user is not logged in, "" otherwise.
- Variable: User name Call: (variables){"id":"user-fullname", "pre":"", "post":""} Usage: Returns the full name for the current user, prepending "pre" and appending "post" if the user is authenticated Example: (variables){"id":"user-fullname", "pre":"Hello ", "post":"!"} returns "Hello Helmut Kaufmann!" for the user Helmut Kaufmann, "" if the user is not logged in, "" otherwise.
- Variable: Email Call: (variables){"id":"user-email", "pre":"", "post":""} Usage: Returns the email address for the current user, prepending "pre" and appending "post" if the user is authenticated Example: (variables){"id":"user-username", "pre":"Hello ", "post":"!"} returns "Hello foo@bla.com!" for the user XYZ, "" if the user has registered foo@bla.com as his/her email address, "" otherwise.
Enjoy!
Mercator