Canada.ca / GCWeb template
GCWeb visual look at the top part of the template
Components from the top of the page controlled by the CDTS:
Search
Application title bar
Menu
Language
Breadcrumbs
Notes: GCWeb visual look at the top part of the template
Search
We control the search Canada.ca form field.
Application title bar
Place where you change the title of the application
Menu
We also control this element. When it changes, we update it.
Language toggle
As discussed above, if the markup changes, you don't have to worry about it. Later on we will discuss what elements of the language toggle you can change.
Breadcrumbs
Just like the other 4 components, the breadcrumbs are the same.
GCWeb visual look at the bottom half of the template
Components from the bottom of the page controlled by the CDTS:
Report a problem on this page
Share this page
Date modified
Footer
About this site list
Notes: GCWeb visual look at the bottom half of the template
Report a problem on this page
Can be set to link to your own feedback form
Share this page
Can be modified to only list specific sharing sites, as defined in the WET share plugin documentation
Date modified
Can set the date modified for the page
Footer
Can only change the link to the "Contact us" page to your own contact page
About this site list
We also control this element. When it changes, we update it.
GCWeb different template parts
Sections of the source code controlled by the CDTS JavaScript:
refTop
appTop
preFooter
appFooter
refFooter
Notes: GCWeb different template parts
On the screen now is a screen shot of a basic Canada.ca page using the CDTS.
Each section listed below is used to control different parts to the template.
refTop
Controls the information in the head
element, like the stylesheets and the Adobe Analytics code.
appTop
Controls the main main, search language toggle and the breadcrumbs
preFooter
Controls the Date modified, Feedback and Share buttons
appFooter
Controls the Contact us link if you want to use a different link than what's on Canada.ca
refFooter
Controls the code after the footer
element. Also used to define an exit script. Will demo that later in this presentation.
refTop
Used to control the components in the head
element.
<script>
document.write(wet.builder.refTop({
"cdnEnv": "prod",
"jqueryEnv" : "external",
"webAnalytics" : [{
"environment" : "production",
"version" : 2
}],
"isApplication" : true
}));
</script>
Notes: refTop
cdnEnv
Used to define which server the site is pulling the supporting files (img, js, fonts). CDTS uses absolute paths in the JS code. This variable comes up in other sections
jqueryEnv
Used to define if the jQuery is local to the source code or using the googleapis CDN.
webAnalytics
This object array is used to define the values that call the Adobe Analytics code.
isApplication
Used for application template. More information to come later in this presentation
appTop
Used to control the components in the header and before the main
.
<script>
var defTop = document.getElementById("def-top");
defTop.outerHTML = wet.builder.appTop({
"appName": [{
"text": "Application name",
"href": "./"
}],
"lngLinks" : [{
"lang" : "fr",
"href" : "content-fr.shtml",
"text" : "Français"
}],
"breadcrumbs": [{
"title": "Home",
"href": "https://www.canada.ca/en/index.html"
},{
"title": "CDTS",
"acronym": "Centrally Deployed Templates Solution",
"href": "https://www.canada.ca/en/index.html"
}],
"showPreContent": true
});
</script>
Notes
lngLinks
Used to define language toggle link. Array includes lang
, href
and text node values to use.
breadcrumbs
Used to define the breadcrumb links and text. Can also be used to define an acronym if it's used as a breadcrumb text.
showPreContent
preContent is reserved for content that the powers that be want to put in every site that uses the CDTS. This could be a national security message or to tell everyone how awesome Shawn Thompson is.
preFooter
Used to control the template content right above the footer
.
<script>
var defPreFooter = document.getElementById("def-preFooter");
defPreFooter.outerHTML = wet.builder.preFooter({
"cdnEnv": "prod",
"dateModified": "2019-07-31",
"showShare": [
"email",
"facebook",
"linkedin",
"twitter"
],
"showFeedback": "https://www.domain.gc.ca"
});
</script>
Notes: preFooter
showPostContent
Used by the Principal Publisher to insert content into the post content space of your page. By default this is ALWAYS shown on all pages.
showShare
Used to specify the share button of your page. Can either be false or use an array oject to define which share options you want to add.
showFeedback
Used to specify the “Report a problem on this page” button of your page. By default this button is shown with the default Canada.ca URL. You can customize the URL or simply hide the button.
dateModified
Used to specify the date modified of your page. Could also use screenIdentifier or versionIdentifier
pagedetails
Used to remove the <div class="pagedetails">
when using the server message page template.
appFooter
Used to control the template content in the footer
.
<script>
var defFooter = document.getElementById("def-footer");
defFooter.outerHTML = wet.builder.appFooter({
"cdnEnv": "prod",
"contactLinks": "https://www.department.gc.ca/en/contact.html"
});
</script>
Notes: footer
contactLinks
Used to customize the contact us link located in the footer of the page.
refFooter
Used to control the template content that is placed after the footer, such as scripts and elements hidden from the user.
<script>
document.write(wet.builder.refFooter({
"cdnEnv": "prod",
"webAnalytics" : true,
"exitScript": true,
"exitURL": "https://wwww.domain.gc.ca/out.html",
"exitMsg": "You are about to leave a secure site, do you wish to continue?",
"exitDomains": "https://wwwwdomain.gc.ca",
"displayModal": false,
"jqueryEnv": external
}));
</script>
Notes: refFooter
webAnalytics
Used to inject the Adobe Analytics code at the end of the page
exitScript
Used if you want to warn the users they are leaving a secured session.
exitURL
Specify the URL where the users will be redirected to leave their secured session.
exitMsg
Specify the message the users will get before being redirected and leaving their secured
exitDomains
Specify the additional domains that should not be checked for secure exit.
displayModal
Use this variable if you want to skip the modal dialog to confirm the exit notice. Keep in mind this will not display the exit notice to the user.
jqueryEnv
Used to specify which environment you want to pull the jQuery files from. By default they are loaded locally from the WET build. Otherwise use the following to load from Google CDN