0% found this document useful (0 votes)
571 views30 pages

PSUG-Page Fragments Insertion Points

The document discusses page fragments and insertion points in PowerSchool. Page fragments allow inserting snippets of HTML content into existing pages. They must be named correctly to match insertion points on pages. Standard insertion points exist on most pages, like content.header and content.footer. Specific insertion points can also be added. jQuery can be used to precisely insert fragments at desired locations.

Uploaded by

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

PSUG-Page Fragments Insertion Points

The document discusses page fragments and insertion points in PowerSchool. Page fragments allow inserting snippets of HTML content into existing pages. They must be named correctly to match insertion points on pages. Standard insertion points exist on most pages, like content.header and content.footer. Specific insertion points can also be added. jQuery can be used to precisely insert fragments at desired locations.

Uploaded by

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

PSUG National Information Exchange

Users Helping Users


Page Fragments and Insertion
Points

KEVIN HARRISON
AMHERST COUNTY PUBLIC
SCHOOLS
SUPERVISOR STUDENT DATA AND
ASSESSMENT
Agenda
• Page Fragments
• Insertion Points
• Questions
About the trainer. . .

Experience:
– 12 Years as
PowerSchool
Administrator
– Division with over 4,000
students
Personal:
– Married 14 years
– Enjoy Concerts and
Racing
Page Fragments
Page Fragment
A Page Fragment is a snippet of html content that can be
inserted into an existing page in PowerSchool. It can be
as simple as:

<p>School is closed because we are tired of all of this snow!</p>

Notice, it does not contain any of the html page format tags:
<!DOCTYPE html>
<html>
<head>
Page Fragment Names
Your page fragment must be named correctly to work. There are four
parts to a page fragment name. The format is:
• some_page - prefix must be the same as the name of the source page,
without the extension (i.e. html).
• .Fragment_Name - any arbitrary name to help identify the page fragment
and keep its name unique. PowerSchool allows multiple fragments to be
inserted in to the same page without impacting each other.
• .Insertion_Point_Name - must match the name of the insertion point to be
used in the page to be customized (i.e. "content.footer").
• .txt - suffix is .txt for all Page Fragments.

some_page.Frament_Name.Insertion_Point_Name.txt
Page Fragment Names
home .ParentNote .content.footer .txt

home.html Name of Insertion Point

Descriptive Name
All fragments end in .txt

home.ParentNote.content.footer.txt

in the Guardian folder


Steps to creating and inserting a page fragment

• Find the page you want to customize


• home.html (in the guardians folder)

• Create and Name Page Fragment in same folder


• home.ParentNote.content.footer.txt

• Add customizations to Page Fragment


• <p>School is closed because we are tired of all of this snow!</p>
Example
District administrators have requested that a table with
emergency phone numbers be placed just below the What's
New box on the Start Page. Examining the HTML source code
for /admin/home.html shows you:
73 <!-- end of search menu -->
74 </form>
75 </div>
76 ~[wc:admin_startpage_whats_new]
77 ~[wc:admin_footer_css]
Example
Line 76 inserts the wildcard
/wildcards/admin_startpage_whats_new.txt

Line 77 inserts the wildcard /wildcards/admin_footer_css.txt,


which begins with a content.footer insertion point.

If you create a page fragment and use the content.footer


insertion point on the Start Page, the table of emergency
numbers would be displayed just below the What's New box as
requested.
Name of Example Fragment

home.Emergency_Numbers .content.footer .txt

home.html
Name of Insertion Point

Descriptive Name
home.EmergencyNumbers.content.footer.txt
All fragments end in .txt

in the admin/students folder


Example of /admin/home.Emergency_Numbers.content.footer.txt page
fragment:
<div class="box-round">
<h2 class="toggle expanded">Emergency Numbers</h2>
<ul class="text">
<li>Police/Fire/Ambulance: 911</li>
<li>Poison Control: 1-800-222-1222</li>
<li>Superintendent's Office: 555-555-1000</li>
<li>General Hospital: 555-555-0911</li>
<li>Children's Hospital: 555-555-2300</li>
<li>Gas Leak: 888-555-6000</li>
<li>Mechanical Issues: 555-555-1043</li>
<li>District Emergency Notification System: 877-555-9911</li>
</ul>
</div>
Update more2.html

1. Create the page fragment


go to admin/students and create file called:
more2.additional_links.leftnav.footer.txt
2. Add html to page fragment
<a href=“somepage.html?frn=~(studentfrn)”>New Page</a><br>

3. Publish
How do I put things where I want it?
Now I want to use a script to find a spot and then insert
my html relative to that spot.

This is a jQuery script - that doesn’t do anything

<script>

$j();

</script>
How do I put the link where I want it?
Now I want to use a script to find a spot and then insert my html
relative to that spot.

FIND A SPOT. WHERE FROM THAT SPOT. WHAT TO INSERT.

<script>

$j("ul#std_information li:eq(2)").after('<li><a
href=”somepage.html?frn=~(studentfrn)">New Page</a></li>')

</script>
Add credits and comments
<!-- create new links and insert in more2 menu, use jQuery to place the
inserted rows in target row. Created by Kevin Harrison with many thanks to
Roger Sprik, Matt Freund, Jason Treadwell, and Jason Springel. -->

<script>

/* places the new link on the row BELOW the numbered line */

$j("ul#std_information li:eq(2)").after('<li><a href=”somepage.html?


frn=~(studentfrn)">New Page</a></li>')

</script>
Bonus jQuery (WooHoo!)
<!-- create new links and insert in more2 menu, use jQuery to place the inserted rows in target row. Sort insert
created by Adam Larsen https://auroraedtech.com/ -->

<script>
$j(document).ready(function()
{

$j("ul#std_information").append("<li><a href=‘somepage.html?
frn=~(studentfrn)’>New Page</a></li>");

$j("ul#std_information li").sort(function(a,b)
{
if($j(a).text() < $j(b).text()) return -1;
if($j(a).text() > $j(b).text()) return 1;
return 0;
}
).appendTo("ul#std_information");
}
);</script>
Bonus BONUS jQuery (WooHoo!)
<script>

$j("ul#std_academics li").sort( function(a,
b) { return($j(a).text()).localeCompare($j(b
).text()) } ).appendTo("ul#std_academics");
</script>
Fragments on Wildcards
When creating fragments for wildcard files, you
may have to wait 5 min before the “fragment”
takes affect.
OR
You can force the issue!!
Fragments on Wildcards
https://{yourserver}/admin/tech/executecommand.html

**SETUPHTMLWCS
Insertion Points
Insertion Point
An Insertion Point is the spot on a standard
PowerSchool page where the Page Fragment gets
inserted.

PowerSchool has added standard insertion points


that can be found on most pages.
Standard Insertion Points
PowerSchool includes a set of standard insertion points available
on every page.
This means that, typically, you never need to think about
insertion points: the common ones will be available to you.
This also has a benefit in allowing standardized naming: you will
not have one page where the footer insertion point is called
content.footer and another where it is called content_footer.
Standard Insertion Points
The following insertion points should be available on every page
in PowerSchool:
• content.header - top of the page above the blue bar
• content.footer - near the bottom of the page, above the
copyright bar within the content area
• leftnav.footer - right below the left navigation but above any
PowerSource and/or Mobile App
content
• page.header – located within the commonscripts wildcard
(should rarely be used)
Standard Insertion Points
Here is an example of an insertion point found in the
admin_footer_css wildcard:

<div id="cust-content-footer">~[cust.insertion_point:content.footer]</div>
<div id="legend" style="display:none;">
<h3>~[text:psx.txt.wildcards.admin_footer_css.legend]</h3>
</div>
</div><!--end content-main-->

The first line defines the name of the insertion point as content.footer
Specific Insertion Points
You can add your own insertion points.

Note that the standard insertion points use this same naming
scheme, just in standard header and footer files.
To define an insertion point within the HTML of a PowerSchool
page, use the following tag:

~[cust.insertion_point:POINTNAME;DEFAULT_CONTENT]
Specific Insertion Points
• The POINTNAME is required and is the name of the insertion
point: it should be in dot-separated form, such as
"page.header", "leftnav.footer", or "content.footer". When
adding your own insertion points to a page, be sure to use
new unique names.
• The DEFAULT_CONTENT is an optional block of content that
will be inserted in the page if no insertions are found for this
insertion point. This should be used rarely. If there is no
associated content with an insertion point on a page, the
point should be invisible.
This is all described in PowerSource
Database Extensions Advanced User Guide for PowerSchool
Search on 83171 or go to:

https://support.powerschool.com/article/83171?from=search

You must be logged in to PowerSource

You might also like