Page Template Description - SCIPS CMS

Every web page in the SCIPS website is made up from various page templates. A templates in a segment of a web page which can be reused across many pages. This allows for site wide changes governing the website's appearance to be made in a single place. For example the SCIPS logo HTML is only found in one file, global_logo.

Core Template Sections

main_template

All full page templates include the main_template macro to create the common Plone page look, e.g. header, quick links etc. The exception being learning_information_view, which uses pop_up_template as a scaled down look is required for pop out documents. See the excerpt below:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
      lang="en"
      metal:use-macro="here/main_template/macros/master"
>
<body>
<div metal:fill-slot="main"  
…
>

document_actions

The document_actions macro is used to create documents actions such as the add to favourites and send page to a friend buttons.

<div metal:use-macro="here/document_actions/macros/document_actions
…

document_byline

The document_byline template is used to create the byline section of each page, e.g. Author information, by including the below after the body of the document being displayed.

<div metal:use-macro="here/document_byline/macros/byline">

Specific Templates

Custom page templates created to display SCIPS specific document types.

challenge_and_subject_view

The description and case_study attributes are on;y displayed when these attributes contain some data python:len(case_study). The required title tal:content="here/title_or_id and body attributes are always displayed.

challenge_view

The description, characteristics, strategies, resources and body are displayed, only when these attributes contain some data python:len(case_study).

A list is generated the from the entries in the subjects attribute. Where a Subject and Challenge document is found with the matching subject attribute and challenge attribute a link is created to this object, otherwise the subject name is displayed without an anchor.

<tal:block tal:repeat="s here/subjects" tal:define="challenge python:str(here.challenge)">
	< ul tal:define="url python:here.getSubjectAndChallenge(s, challenge)" >
		<li>
			<p>
			<a tal:condition="python:url != None" tal:attributes="href url" tal:content="s">
			Subject
			</a>
			<span tal:condition="not:url" tal:replace="s"></span>
			</p>
		</li>
	</ul>
</tal:block>

disability_and_subject_view

The description is displayed, only when this attribute contains data. The required title and body attributes are always displayed.

A list is generated the from the entries in the challenges attribute. Where a Subject and Challenge document is found with the matching subject attribute and challenge attribute a link is created to this object, otherwise the challenge name is displayed without an anchor.


<tal:block tal:repeat="c challenges" tal:define="study_subject python:str(here.study_subject)">

	<ul tal:define="url python:here.getSubjectAndChallenge(study_subject, c)" >
		<li>
		<p>
			<a tal:condition="python:url != None" tal:attributes="href url" tal:content="c">
			CHALLENGE
			</a>
			<span tal:condition="not:url" tal:replace="c"></span>
		</p>
		</li>
	</ul>
</tal:block>

disability_view

The description, resources are displayed, only when these attributes contain some data. The required title and body attributes are always displayed.

A list is generated the from the entries in the challenges attribute. Where a Challenge document is found with the matching challenge attribute a link is created to this object, otherwise the challenge name is displayed without an anchor.

<ul tal:repeat="c here/challenges">
	<li class="row" tal:define="url python:here.getChallenge(c)" >
		<p>
		<a tal:condition="python:url != None" tal:attributes="href url" tal:content="c">
		Challenge
		</a>
		<span tal:condition="not:url" tal:replace="c"></span>
		</p>
	</li>
</ul>

A list is generated the from the entries in the subjects attribute. Where a Subject and Disability document is found with the matching subject and disability attributes a link is created to this object, otherwise the subject name is displayed without an anchor.

<ul  tal:repeat="s here/subjects">
	<tal:block tal:define="disability python:str(here.disability)">
		<li class="row" tal:define="url python:here.getSubjectAndDisability(s, disability)" >
			<p>
			<a tal:condition="python:url != None" tal:attributes="href url" tal:content="s">
			Subject
			</a>
			<span tal:condition="not:url" tal:replace="s"></span>
			</p>
		</li>
	</tal:block>
</ul>

key_skill_view

The description, resources are displayed, only when these attributes contain some data. The required title and body attributes are always displayed.

A list is generated the from the entries in the challenges attribute. Where a Challenge document is found with the matching challenge attribute a link is created to this object, otherwise the challenge name is displayed without an anchor.

<ul tal:condition="here/challenges" tal:repeat="c here/challenges">
	<li tal:define="url python:here.getChallenge(c)" >
		<p>
			<a tal:condition="python:url != None" tal:attributes="href url" tal:content="c">
				CHALLENGE
			</a>
			<span tal:condition="not:url" tal:replace="c"></span>
		</p>
	</li>
</ul>

learning_information_view

The description is displayed, only when this attribute contains data. The required title and body attributes are always displayed.

subject_view

The description, benchmark, resources are displayed, only when these attributes contain some data. The required title and body attributes are always displayed.

A list is generated from the learning_activity_groups attributes which provide hyper links to individual group tables detailing challenges against the group's learning activities. An overall table is also generated.

List code


<ul tal:repeat="group_name here/learning_activity_groups">
	<li>
		<a tal:content="group_name" tal:attributes="href string:#group_${repeat/group_name/index}; title string:$group_name and potential challenges"></a>
	</li>
</ul>

Group table code

<tal:block tal:repeat="group_name here/learning_activity_groups">
	<tal:block tal:define="group_challenges python:here.getGroupChallenges(study_subject, str(group_name))">
		<a href="#" tal:attributes="name string:group_${repeat/group_name/index}; title string:Table of $group_name learning activities against potential challenges;"> </a>
		<table tal:define="group_chal_len python:len(group_challenges)" tal:condition="group_challenges" cellspacing="0" cellpadding="5" border="1" class="scips_matrix" tal:attributes="summary string:Matrix of $group_name learning activities against potential challenges">
		<caption tal:content="group_name"></caption>
		<colgroup span="1" align="left"></colgroup>
		<colgroup tal:attributes="span group_chal_len" align="center"></colgroup>
	
		<thead>
		<tr>
			<th rowspan="2">
				Learning Activities	
			</th>
			<th tal:attributes="colspan group_chal_len">
				Potential Challenges to the Achievement of Learning
			</th>
		</tr>
		<tr>
			<th tal:repeat="c group_challenges">
				<tal:block tal:define="url python:here.getSubjectAndChallenge(str(study_subject), str(c))">
					<a tal:condition="url" tal:attributes="href url;title string:Go to the $study_subject and $c document" tal:content="c">Challenges ...	</a>
					<tal:block tal:condition="not:url" tal:content="c">Challenges ...	</tal:block>
				</tal:block>
			</th>
		</tr>
		</thead>
			<tbody>					
				<tal:block tal:define="group_activites python:here.getGroupActivities(str(study_subject), str(group_name))">
					<tr tal:repeat="name group_activites">
						<td tal:content="name">
								ACTIVITY NAME
						</td>
						<tal:block tal:repeat="ch group_challenges">
							<td tal:define="item python:here.getActivity(str(study_subject), str(group_name), str(name), str(ch))">
							<a class="scips_box" target="_blank" tal:condition="item" tal:attributes="href item;title string:$name and $ch information, (opens in a new window)">X</a>
							<tal:block tal:condition="not:item"> </tal:block>
							</td>
						
						</tal:block>
					</tr>
				</tal:block>
			</tbody>
		</table>
		<p tal:condition="not:group_challenges">
			No associated information for <strong tal:content="group_name"></strong>, at present.
		</p>
		<br />
		<p>
			Back to the <a href="#top_of_list" title="Return to group headings list">top of the list.</a>
		</p>
	</tal:block>
</tal:block>

All groups table code

<tal:block>
	<a href="#" name="all_groups" title="Table of learning activities against potential challenges"> </a>
	<table cellspacing="0" cellpadding="5" border="1" class="scips_matrix" tal:attributes="summary string:Matrix of learning activities against potential challenges">
	<caption>All Learning Activity Groups</caption>
	<colgroup span="2" align="left"></colgroup>
	<colgroup tal:attributes="span chal_length" align="center"></colgroup>

	<thead>
	<tr>
		<th colspan="2" rowspan="2">
			Learning Activities	
		</th>
		<th tal:condition="chal_length" tal:attributes="colspan chal_length">
			Potential Challenges to the Achievement of Learning
		</th>
	</tr>
	<tr>
		<tal:block tal:condition="chal_length" >
		<th tal:repeat="c here/challenges">
			<tal:block tal:define="url python:here.getSubjectAndChallenge(str(study_subject), str(c))">
				<a tal:condition="url" tal:attributes="href url;title string:Go to the $study_subject and $c document" tal:content="c">Challenges ...	</a>
				<tal:block tal:condition="not:url" tal:content="c">Challenges ...	</tal:block>
			</tal:block>
		</th>
		</tal:block>
		<tal:block tal:condition="not:chal_length">
		<th>
			No current challenges are associated with this subject
		</th>
		</tal:block>
	</tr>
	</thead>
		<tal:block tal:repeat="group here/learning_activity_groups">
							
			<tal:block tal:define="group_activites python:here.getGroupActivities(str(study_subject), str(group))">
				<tal:block tal:condition="python:len(group_activites)">  <!--tal:repeat="name group_activites">-->
				<tbody>
				<tr tal:repeat="name group_activites">
					<td tal:condition="not:repeat/name/index" tal:content="group" tal:attributes="rowspan python:len(group_activites)">
						NAME
					</td>
					<td tal:content="name">
							ACTIVITY NAME
					</td>
					<tal:block tal:repeat="ch here/challenges">
						<td tal:define="item python:here.getActivity(str(study_subject), str(group), str(name), str(ch))">
						<a class="scips_box" target="_blank" tal:condition="item" tal:attributes="href item;title string:$name and $ch information, (opens in a new window)">X</a>
						<tal:block tal:condition="not:item"> </tal:block>
						</td>
					
					</tal:block>
				</tr>
				</tbody>
				</tal:block>
				<tal:block tal:condition="python:not len(group_activites)">
					<tbody>
						<tr>
							<td tal:content="group">
								NAME
							</td>
							<td>
							 
							</td>
							<tal:block tal:repeat="i python:range(chal_length)">
							<td>
								 
							</td>
							</tal:block>
						</tr>
					</tbody>
				</tal:block>
			</tal:block>
		</tal:block>
	</table>
	<br />
	<p>
		Back to the <a href="#top_of_list" title="Return to group headings list">top of the list.</a>
	</p>
</tal:block>		


 

Related Documents

Page Template Design, version 1.3