0% found this document useful (0 votes)
797 views8 pages

PSTags HTML

Uploaded by

Richard James
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
797 views8 pages

PSTags HTML

Uploaded by

Richard James
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

PS-HTML tags

"PS-HTML" or "PowerSchool HTML" is the term given to the language used to write traditional PowerSchool
pages. It consists of HTML with special PowerSchool tags interspersed. These tags usually have one of the
formats ~(tag) or ~[tag]. They essentially perform server-side operations that can modify the page results
being sent out to the user's browser.
There are many, many PS-HTML tags supported by PowerSchool. This page documents some of the most
useful ones.

System Tags
Tag Available Description/Example

~(curstudid) Admin Displays the students id of the record that was referenced on page
Teachers load.
Guardian Example: 1234
Student
Subs

~(curtchrid) Admin Displays the teacher id of the record that was referenced on page load.
Teachers Example: 4567

~(curschoolid) Admin Displays the school id of the currently selected school.


Teachers Output: School Number, 0 (District), or 999999 (Graduated Students)
Guardian
Student
Subs

~(curtermid) Admin Displays the term id of the currently selected term.


Teachers Example: 2401
Guardian
Student
Subs

~(curyearid) Admin Displays the year id of the currently selected year.


Teachers Example: 1234
Guardian
Student
Subs

~[x:userid] Admin Displays the ID of the currently logged in user. For Guardian the current
Teachers student ID is returned.
Guardian Example: 1234
Student
Subs

~[x:userid;guardianid] Guardian PS 9.0+ Only: Displays the GUARDIAN.GUARDIANID of the currently


logged in user.
Example: 1234

~[x:users_dcid] Admin Displays the users dcid (Teachers.Users_DCID) of the currently logged
Teachers in Teacher/Administrator.
Example: 1234
Tag Available Description/Example

~[x:usersroles] Admin Displays the group number, or group numbers if using multiple roles, of
Teachers the currently logged in Teacher/Administrator in a comma separated
list.
Example: 9 or 9,10,30

~[x:username] Admin Displays the current users name.


Teachers Example: Andle, Brian
Guardian
Student Optional modifier ;firstlast
Subs

~[eaodate] Admin Displays the current date.


Teachers Example: 2/2/2016
Guardian
Student
Subs

~[date] Admin Displays the current date.


Teachers Example: 02/02/2016
Guardian
Student
Subs

~[time] Admin Displays the current time.


Teachers Example: 10:10 AM
Guardian
Student
Subs

~[x:version] Admin Displays the current PS version number.


Teachers Pre 10 this renders 3 places. Example: 9.2.4
Guardian Post 10 this renders 2 places. Example: 9.2
Student
Subs

~[x:version;short] Admin Displays the current PS version number.


(10+) Teachers Example: 9.2.4
Guardian
Student
Subs

~[x:version;long] (10+) Admin Displays the current PS version number.


Teachers Example: 9.2.4.0.1040000
Guardian
Student
Subs

~[x:version;full] (10+) Admin Displays the full PS version number for beta/internal builds.
Teachers Example: 9.2.4.0.1040000.2123
Guardian
Student
Subs

Field DATs
DATs (Data Access Tags) are special tags designed to return a specific data element in current processing. A
typical use is to return a column value from the table that the current page is processing, but there are other
types of DATs also. Here are the formats for specific database field display DATs.
Tag Field Type Description/Example

~([{Table_Name}]{Field_Name}) Real Displays the {Field_Name} value for the current


Legacy {Table_Name}.
Custom Example: ~([Students]lastfirst)
Output: Jones, Tom

~([{Table_Name}. Database Displays the {Field_Name} value for the current


{Database_Extension}] Extension {Table_Name}'s associated {Database_Extension}.
{Field_Name}) Example: ~([Students.StudentCoreFields]guardian)
Output: Tom Jones

IF Statements
Each of these statements has the following form:

~[if.CONDITION]
True Content
[else]
False Content
[/if]

The line breaks are optional and do not affect the result (except that line breaks will be in the result also).
Please note that PS-HTML tags do not nest normally; if you want to nest one "if" inside another, you need to
use the following type of construct:

~[if#cond1.CONDITION1]
~[if#cond2.CONDITION2]
True Content for both conditions
[else#cond2]
False Content for condition 2 (only!)
[/if#cond2]
[else#cond1]
False Content for condition 1 only
[/if#cond1]

Conditions must be a simple conditional (i.e. "AND", "OR", or other Boolean operations are not allowed).
Among the most useful of the available conditions are the following:

CONDITION Available Description/Example

{value}={testvalue} Admin Tests if {value} equals {testvalue}.


Teachers Example:
Guardian ~[if.1=1] It Works [/if]
Subs Available Operators: =, #, >, >=, <, <=, $ (Contains), !$
(Does not contain)

gpv.{postedname}={testvalue} Admin Tests if the posted value equals {testvalue}.


Teachers Example:
Guardian ~[if.gpv.my_gpv=1] It Works [/if]
Subs Available Operators: =

pref.{prefname}={testvalue} Admin Tests if the preference value equals {testvalue}.


Teachers Example:
Guardian ~[if.pref.my_pref=1] It Works [/if]
Subs Available Operators: =
CONDITION Available Description/Example

prefschool.{prefname}= Admin Tests if the school preference value equals {testvalue}.


{testvalue} Teachers Example:
Guardian ~[if.prefschool.my_school_pref=1] It Works [/if]
Subs Available Operators: =

security.inrole={group_number} Admin Tests if a user belongs to at least one of the defined groups.
Teachers Example:
~[if.security.inrole=1,2,3,4,9,20]
True if part of one of these security groups/roles
(1,2,3,4,9,20)
[/if]

security.pagemod={path/page} Admin Tests if the currently logged in user has modify access to
the page.
Example:
~[if.security.pagemod=/admin/students
/generaldemographics.html]
<a href="generaldemographics.html?frn=~
(studentfrn)">Demographics</a>
[/if]

security.pageview={path/page} Admin Tests if the currently logged in user has view access to the
page.
Example:
~[if.security.pageview=/admin/students
/generaldemographics.html]
<a href="generaldemographics.html?frn=~
(studentfrn)">Demographics</a>
[/if]

security.pagenone={path/page} Admin Tests if the currently logged in user has no access to the
page.
Example:
~[if.security.pagenone=/admin/students
/generaldemographics.html]
No Access
[else]
<a href="generaldemographics.html?frn=~
(studentfrn)">Demographics</a>
[/if]

security.canmodifyfield= Admin Tests if the currently logged in user has modify access to
{Table.Field} the Table.Field.
Example:
~[if.security.canmodifyfield=Students.DOB]
Full Access
[/if]

security.canviewfield= Admin Tests if the currently logged in user has view access to the
{Table.Field} Table.Field.
Example:
~[if.security.canviewfield=Students.DOB]
View Acess or Possibly Modify
[/if]
CONDITION Available Description/Example

security.noaccessfield= Admin Tests if the currently logged in user has no access to the
{Table.Field} Table.Field.
Example:
~[if.security.noaccessfield=Students.DOB]
No Access
[/if]

security.fieldlevel={Table.Field} Admin Tests if the currently logged in user has no access to the
{Operator}{Access_level} Table.Field based on access level.
Example:
~[if.security.fieldLevel=Students.Dob>NoAccess]
Has view or modify access
[/if]
Available Operators: >=, <=, !=, >, <, =
Available Access_level: NoAccess, ViewOnly, FullAccess

GPVs (Get Post Value)


The Get Post Value (gpv) tags get values sent in to the request as either Query String or POST parameters.
There are two formats for these tags, as seen in various areas of the documentation:

~(gpv.{posted_value_name})

~[gpv:{posted_value_name}] DO NOT USE!

The two do basically the same thing, but are processed by PowerSchool in different ways. You should always
use the round bracket version. (Among other things, the square bracket version does not have all the options
below.)

Tag Available Description/Example

~(gpv. Admin Returns the posted value from the URL or the
{posted_value_name};encodejsstring) Teachers previous page submit and returns the JavaScript
Guardian encoded result.
Subs URL Request: /admin/home.html?my_gpv=it's
>< alive
GPV Tag: ~(gpv.my_gpv;encodejsstring)
Result: it\'s >< alive
Where to use: When the gpv returned is to be
used in JavaScript string.

~(gpv.{posted_value_name};urlencode) Admin Returns the posted value from the URL or the
Teachers previous page submit and returns the url
Guardian encoded result.
Subs URL Request: /admin/home.html?my_gpv=it's
>< alive
GPV Tag: ~(gpv.my_gpv;urlencode)
Result: it%27s+%3E%3C+alive
Where to use: When the gpv returned is to be
used as part of a link.
Tag Available Description/Example

~(gpv.{posted_value_name};encodehtml) Admin Returns the posted value from the URL or the
Teachers previous page submit and returns the html
Guardian encoded result.
Subs URL Request: /admin/home.html?my_gpv=it's
>< alive
GPV Tag: ~(gpv.my_gpv;encodehtml)
Result: it's &gt;&lt; alive
Where to use: When the gpv returned is
displayed in a webpage.

~(gpv.{posted_value_name};num) Admin Returns the posted numeric value from the URL
Teachers or the previous page submit.
Guardian URL Request: /admin/home.html?my_gpv=it's
Subs >< alive
GPV Tag: ~(gpv.my_gpv;num)
Result: 0
URL Request: /admin/home.html?my_gpv=43
GPV Tag: ~(gpv.my_gpv;num)
Result: 43
Where to use: When the gpv returned is to be
guaranteed or supposed to be a number.

~(gpv.{posted_value_name};sqlText) Admin Returns the posted value from the URL or the
Teachers previous page submit and returns the sql
Guardian encoded result.
Subs URL Request: /admin/home.html?my_gpv=it's
>< alive
GPV Tag: ~(gpv.my_gpv;sqlText)
Result: it''s >< alive
Where to use: When the gpv returned is to be
used in a tlist_sql tag

~(gpv.{posted_value_name};if.blank.then= Admin Returns the posted value from the URL or the
{some_default_value}) Teachers previous page submit and returns a default value
Guardian if the value is blank.
Subs URL Request: /admin/home.html?my_gpv=
GPV Tag: ~(gpv.my_gpv;if.blank.then=-1)
Result: -1
Where to use: When the gpv returned will
possibly be blank

The modifiers on GPV's can be combined to


ensure a value it returned and formatted
correctly. For example:
GPV Tag: ~(gpv.my_gpv;if.blank.then=-1;sqlText)

TLIST_SQL
"TLIST_SQL" is the name of a tag that executes SQL right in the page and returns the results. It is STRONGLY
DEPRECATED in new development work for several reasons: if not used carefully it can easily introduce
security holes, reflects improper layering, and because there is almost always a better way to do the same
operation. (See PowerQuery reference.)

The following table is a reference of the modifiers that can be applied to variables in the tlist_sql statement.

Modifier Description/Example
Modifier Description/Example

;d Date - Formats a column that's a DATE or TIMESTAMP type to display in currently logged
in users locale format.
Example:
Tag: ~[tlist_sql;select sysdate from dual]~(sysdate;d)[/tlist_sql]
Output: 2/2/2015

;l;format=time Time - Converts a column that's a NUMBER that represents seconds as HH:MM.
Example
Tag: ~[tlist_sql;select start_time, end_time from bell_schedule_items]~
(start_time;l;format=time) -- ~(end_time;l;format=time)[/tlist_sql]
Output: 9:34 AM -- 10:34 AM

;url URL escapes text to be used as part of a link


Example
Tag: ~[tlist_sql;select 'hello world' myLink from dual]<a href="/admin/test.html?mygpv=~
(myLink;url)">My Link</a>[/tlist_sql]
Output: &lt;a href="/admin/test.html?mygpv=hello+world">My Link&lt;/a>

;Js JS will escape specific characters so that the returned value in the TList_SQL can be
injected into a Javascript String value.
As of 8.3 this was modified to perform true JavaScript escaping.
Example
Tag: ~[tlist_sql;select 'Every "High" ''School''' schoolName from dual]~(schoolName;js)
[/tlist_sql]
Output: Every \"High\" \'School\'

;Json (9.0+) Json will escape specific characters so that the returned value in the TList_SQL can be
injected into a JSON object.
Example
Tag: ~[tlist_sql;select 'Every "High" ''School''' schoolName from dual]~(schoolName;json)
[/tlist_sql]
Output: Every \"High\" 'School'

;Html (9.0+) Html will escape specific characters so that the returned value in the TList_SQL can be
rendered to the page while preventing html injection.
Example:
Tag: ~[tlist_sql;select '< >' gtLt from dual]~(gtLt;html)[/tlist_sql]
Output: &lt; &gt;

;Xml10 (9.0+) Xml10 will escape specific characters so that the returned value in the TList_SQL can be
injected into a XML v1.0 object.
Example:
Tag: ~[tlist_sql;select '< > ''' gtLt from dual]~(gtLt;xml10)[/tlist_sql]
Output: &lt; &gt; &apos;

;Xml11 (9.0+) Xml11 will escape specific characters so that the returned value in the TList_SQL can be
injected into a XML v1.1 object.
Example:
Tag: ~[tlist_sql;select '< > ''' gtLt from dual]~(gtLt;xml10)[/tlist_sql]
Output: &lt; &gt; &apos;

Home PS SIS API PS SIS UniCed Community


Security Customization Classroom Blog
Data Access Page OneRoster Developer
Events Customization Provider Forums
Plugins and OneRoster (https://support.powerschool.com
Single Sign Database Provider API /forum/319)
On Extensions Release Video Library
Resources PowerTeacher Notes DevCon
Examples Pro
Release Customization
Notes PS-HTML
tags
Plugins
Student
Contacts
Customization

Privacy Policy (https://www.powerschool.com/privacy/) Terms of Use (/terms)

Copyright © 2000-2019, PowerSchool Group LLC. All rights reserved. 150 Parkshore Dr, Folsom, CA 95630

You might also like