Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

 


Documentation to do:

Tooltips

...

How to find the asset id of a page

Shared blocks

 


JSON structures

content-plain

...

An important distinction between "links" and "externalLinks" - Graphically, "links" will be displayed with a big blue button, while "externalLinks" will display a bullet list of links with an 'external link' symbol next to it -  

 


 

Code Block
{
   "contentType" : "content-plain-links",
   "heading"     : "",
   "content"     : "",
    "links"       : [
        {
            "linkText"  :"Text",
            "linkTitle" :"Text",
            "link"      :"%globals_asset_url:ASSETID^json_encode%"
        }
   ],
	"externalLinks": [{
		"linkText"   : "Text",
		"linkTitle"  : "Text",
		"link"       : "http://www.careers.govt.nz/"

	}]
}

...

 



 

content-facts

 

This is used exclusively on the degree-about pages. They supply the data for the "Level of study", "Length of full-time study", and "Useful secondary school subjects" contents.

...

Code Block
{
    "contentType" : "content-facts",
    "heading"     : "",
    "content"     : {
        "levelOfStudy": {
            "contentType" : "levelOfStudy",
            "heading"     : "%asset_metadata_ProgrammeId^as_asset:asset_metadata_postOrUndergradHeading^json_encode%",
            "content"     : "%asset_metadata_ProgrammeId^as_asset:asset_metadata_postOrUndergrad^json_encode%"
        },
        "studyLength": {
            "contentType" : "studyLength",
            "heading"     : "%asset_metadata_ProgrammeId^as_asset:asset_metadata_LengthOfFulltimeStudyHeading^json_encode%",
            "content"     : "%asset_metadata_ProgrammeId^as_asset:asset_metadata_LengthOfFulltimeStudy^json_encode%",
            "contentSub" : "%asset_metadata_ProgrammeId^as_asset:asset_metadata_LengthOfFulltimeStudySubHeading^json_encode%"
        },
        "fees": {
            "contentType" : "fees",
            "heading"     : "%asset_metadata_ProgrammeId^as_asset:asset_metadata_CourseFeesHeadingOverride^json_encode%",
            "content"     : "%asset_metadata_ProgrammeId^as_asset:asset_metadata_EstimatedYearlyCourseFees^json_encode%"
        },
        "usefulSubjects": {
            "contentType" : "usefulSubjects",
            "heading"     : "%asset_metadata_ProgrammeId^as_asset:asset_metadata_UsefulSecondarySchoolSubjectsHeading^json_encode%",
            "content"     : "%asset_metadata_ProgrammeId^as_asset:asset_metadata_UsefulSecondarySchoolSubjects^json_encode%"
        }
    }
}

 

 


entry-requirements

Used exclusively on the degree-requirement pages. Used for displaying the entry requirements for a degree/major.

...

Code Block
{
    "contentType": "fun-fact",
    "heading": "29%",
    "content": "Proportion of MBAs employed at or above the board level within six to ten years of graduating. Source: The Association of MBAs 2010 Career Survey"
}

...


important-info

Currently only used in undergraduate degrees pages. (For example in tourism-management)

...

 With the href for the "student adviser" replaced with the appropriate faculty for that degree. See

Jira Legacy
serverJIRA (victoriauniversity.atlassian.net)
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId27f93f26-1c92-33a3-8ce5-991824ed6542
keyWIP-1390
for the appropriate asset number and anchor link to use. 


Code Block
{
   "contentType" : "important-info",
   "heading"     : "Important information ",
   "content"     : [
            "If you are transferring from another university and applying for direct entry into the second year you'll need to supply a portfolio along with an official academic transcript. These must reach the <a href='http://www.victoria.ac.nz/fad/about/contact'> Faculty of Architecture and Design Office </a> by 10 December.",
            "<a href='Portfolio'>http://www.victoria.ac.nz/fad/pdf/portfolio-requirements-2012.pdf'>Portfolio requirements</a> (PDF 284 KB)",
            "The academic [Calendar] is the authoritative source of programme and course information.",
            "If you have questions talk to a <a href='%globals_asset_url:186845%'>Liaison Officer</a>. If you’re already a student here, contact a <a href='%globals_asset_url:59208%#student-advisers'>student adviser</a>."
        ]
}

...


intro-about

Used exclusively on the topic-about pages. Is basically the same as a content-plain container, but will also display a list of all the subjects next to it. Similar to the intro-degree container.

Code Block
{
	"contentType"    : "intro-about",
	"content"        : ""
}

...


intro-degree

Used at the start of each degree-about page. Is basically the same as a content-plain container, but will also display a list of all the majors next to it. Similar to the intro-about container.

...

Code Block
{
	"contentType"              : "intro-major",
	"heading"                  : "",
	"content"                  : ""
}

...


intro-subject

Used at the start of each subject on the topic-study options page. Is basically the same as a content-plain container, but historically used to have other formatting as well. May be deprecated in future releases, but for now is still used at the start of each subject. Similar to the intro-about container.

Code Block
{
	"contentType" : "intro-subject",
	"heading"     : "",
	"content"     : ""
}

...


intro

Used at the start of each degree>requirements and topic>people & stories page. Is basically the same as a content-plain container, but historically used to have other formatting as well. Will hopefully soon be replaced by a content-plain block as it is confusing for it to be allocated to those specific areas. Similar to the intro-about container.

Code Block
{
	"contentType" : "intro",
	"heading"     : "",
	"content"     : ""
}

...


postgrad-apply

Used for the application/starting content block on postgraduate apply pages.

...

Using the globals_asset keywords ensures that these values will return the correct results. At some point these lists will be automatically sorted by the angular app so that the closest date appears first, but for now they should be manually specified. (e.g. after the applyBy date for the second trimester has finished, make sure that the third trimester is the first one in the list). for the second trimester has finished, make sure that the third trimester is the first one in the list).


For graduate qualifications, you need to specifically include a reference to the internationalApiCode in the content block. For example Graduate Diploma in Science, ID# 373377.

It looks like this:

Code Block
{
    "contentType" : "postgrad-apply",
    "heading"     : "International fees",
    "region"      : "international",
    "content"     : {
        "startStudying" : {
            "type"    : "studyLengthTrimester",
            "heading" : "Start Studying",
            "content" : [
                {
                    "startDate"      :"%globals_asset_attribute_start_date_short:355524%",
                    "startTrimester" :"%globals_asset_metadata_trimesterNumber:355524%",
                    "applyBy"        :"%globals_asset_attribute_start_date_short:365079%"
                },
                {
                    "startDate"      :"%globals_asset_attribute_start_date_short:355515%",
                    "startTrimester" :"%globals_asset_metadata_trimesterNumber:355515%",
                    "applyBy"        :"%globals_asset_attribute_start_date_short:365077%"
                },
                {
                    "startDate"      :"%globals_asset_attribute_start_date_short:355523%",
                    "startTrimester" :"%globals_asset_metadata_trimesterNumber:355523%",
                    "applyBy"        :"%globals_asset_attribute_start_date_short:365078%"
                }
            ]
        },
        "fees" : {
            "contentType" : "fees",
            "heading"     : "",
            "content"     : ""
        },
        "internationalApiCode" : "%globals_asset_metadata_ProgrammeId^as_asset:asset_metadata_internationalApiCode^json_encode%"
    }
}


Used exclusively on subject pages. Is how the subject links to the degree pages.

...

This is a bit confusing, so see Architecture>Interior Architecture for a good example of how it is used. (Asset id 309042)

The content element is used to provide extra information about the related degree where necessary. This is just a plain text field. See Economics and Finance>Actuarial Science for a good example of this (asset number 309568).

...

Code Block
{
    "contentType": "related-degrees",
    "content": {
        "undergrad": [{
			"asset_assetid"                        : "%globals_asset_assetid:339832^json_encode%",
			"asset_metadata_ProgrammeCode"         : "%globals_asset_metadata_ProgrammeCode:339832^json_encode%",
			"asset_metadata_LengthOfFulltimeStudy" : "%globals_asset_metadata_LengthOfFulltimeStudy:339832^json_encode%",
			"asset_metadata_WebPath"               : "%globals_asset_metadata_WebPath:339832^json_encode%",
			"asset_name"                           : "%globals_asset_name:339832^json_encode%",
            "content"                              : "",
			"leadsIntoLink"                        : "%globals_asset_url:62170^json_encode%",
			"leadsIntoText"                        : "Master of Architecture (Professional)",
            "leadsIntoExtraPreText"                : "and other",
            "leadsIntoExtraLink"                   : "%globals_asset_url:62166^json_encode%",
            "leadsIntoExtraLinkText"               : "postgraduate programmes"
        }],
        "postgrad": [{
			"asset_assetid"                        : "%globals_asset_assetid:296680^json_encode%",
			"asset_metadata_ProgrammeCode"         : "MClinIm",
			"asset_metadata_LengthOfFulltimeStudy" : "1-2 years (180 points)",
			"asset_metadata_WebPath"               : "%globals_asset_url:296680^json_encode%",
			"asset_name"                           : "Master of Clinical Immunology"
        }]
    }
}

...


Used exclusively on subject pages for non-major subjects. (e.g. Linguistics>Text Technologies). Allows the subject to link to the victoria search page with the appropriate subject selected. 


Code Block
{
    "contentType": "related-nonmajor-courses",
    "content": {
        "undergrad": [{
            "subjectCode":"127",
            "content":"Learn more about the undergraduate courses available in Science in Society"
        }],
        "postgrad": [{
            "subjectCode":"139",
            "content":"Learn more about the postgraduate courses available in Science in Society"
        }]
    }
}

...


slide-show

(architecture has a good example of a slideshow)

...

Code Block
{
	"heading"     : "Designing ideas",
	"contentType" : "slide-show",
	"caption"     : "",
	"images"      : [
		{
			"heading"       : "",
			"caption"       : "%globals_asset_attribute_caption:340296^json_encode%",
			"altText"       : "%globals_asset_attribute_alt:340296^json_encode%",
			"buttonText"    : "",
			"buttonLink"    : "",
			"buttonTitle"   : "",
			"imageUrl"      : "%globals_asset_url:340296^json_encode%",
			"imageAssetId"  : "340296"
	    },
	    {
			"heading"       : "",
			"caption"       : "%globals_asset_attribute_caption:340276^json_encode%",
			"altText"       : "%globals_asset_attribute_alt:340276^json_encode%",
			"buttonText"    : "",
			"buttonLink"    : "",
			"buttonTitle"   : "",
			"imageUrl"      : "%globals_asset_url:340276^json_encode%",
			"imageAssetId"  : "340276"
	    }
    ]
}

...


video

Embeds a video. Currently only supports youtube videos. Make sure that the videoLink value is only the 'key' part of the video url. For example, https://www.youtube.com/watch?v=NYP5hSRiqBw becomes NYP5hSRiqBw.

...

Code Block
{
    "contentType": "video",
    "videoType": "youtube",
    "heading1": "Developing managers and leaders",
    "heading2": "",
    "content": "",
    "videoLink": "NYP5hSRiqBw",
    "videoImage": "%globals_asset_url:ASSETID^json_encode%"
}

 


wellington-promo

Also known as the 'Why Wellington" block. Used to provide a short promotion on why Wellington is such a great place to study. Normally the only thing changing is the content in "content" and sometimes the "heading". If the heading is not supplied, it should be left as "Why Wellington".

...

Code Block
{
	"heading"     : "Why Wellington",
	"contentType" : "wellington-promo",
	"content"     : "",
    "imageLink"   : "%globals_asset_url:327370^json_encode%",
    "imageId"     : "327370",
	"links"       : [
    	{
			"linkText"  :"Why Wellington",
			"linkTitle" :"Why Wellington",
			"link"      :"%globals_asset_url:248382^json_encode%"
    	}
    ]
}

 


Missing content blocks

Please list below any content types that are not covered above, and get Andrew Bredenkamp to write up appropriate documentation on them.

 


Squiz keywords. When and how to use them:

...

please ensure ^json_encode is used on every keyword that is used. Not doing so may end up causing very hard to find issues further down the line. 


./?a=ASSETID

This is a sort of short hand way of doing %globals_asset_url:10% that only works in href values. (ie <a href='./?a=10'>link text</a>). However, it does not play nicely with the json objects so we don't use it. It is mentioned here solely in case it is encountered in other areas of the site.

 


%globals_asset_attribute_BLAH:ASSETID^json_encode%

...

%globals_asset_attribute_alt:340296^json_encode% returns the alt-text of the image. 

 


%globals_asset_metadata_BLAH:ASSETID^json_encode%

This is used to get metadata values of the specified asset. These are edited via the metadata page of that asset. 


%globals_asset_file_size_readable:ASSETID^json_encode% and %globals_asset_type_icon:ASSETID^json_encode%

...

For example <a href='%globals_asset_url:54655^json_encode%#advisers'>link text</a> will link to http://www.victoria.ac.nz/vbs/about/staff#advisers. 


New lines in text

If you are getting corrupt json values, there is a good chance it is because there is a newline in it somewhere. These are not allowed as they break json objects. When importing content, make sure that all newlines are replaced with:

...

Code Block
{
	"contentType"    : "content-plain",
	"heading"        : "",
    "content"        : "Any building you enter has a complex history—from concept, to design, to construction.\nStudy Building Science and gain a solid understanding of what it takes to develop a building that's efficient and sustainable and safe. Learn how to organise teams, plan the construction process and manage contractors and construction sites.\nGet the basics alongside Architecture students in the first year, then specialise in Sustainable Engineering Systems, Project Management or both.\nAt the end of your Bachelor’s degree you can stay on and study for a Master of Building Science. You’ll graduate skilled and work ready. "
}

...


This is then turned into <p> tags via the angular app where necessary, but this should not cause an issue. 


JSON specifics in formatting and common pitfalls

...

The commas are a particularly nasty issue, because nearly every json parser will allow there to be a comma after the last element without issue. The json interpreter within squiz though does not, and so some values that the angular app needs might be missing - such as the contentType and the region. Use the online validator here if you are unsure whether your commas are correct or not. 


Debugging json objects

If you try to load a page and you get the following error:

...