Language selection

Search


Context-specific features - Canada.ca design pattern

Status
Stable
Type
Canada.ca design pattern
Last review
2021-07-21
Conforming to
Content and IA spec 2.1
Specification
Context-specific features - Canada.ca design pattern
Technical name
  • gc-features
Component version
Version 4.0

Working example

Context-specific features - v9.4.2

Features

[Feature hyperlink text]

Brief description of the feature being promoted.

[Feature hyperlink text]

Brief description of the feature being promoted.

[Feature hyperlink text]

Brief description of the feature being promoted.

GC activities and initiatives - v9.4.2

Government initiatives

[Feature hyperlink text]

Brief description of the feature being promoted.

[Feature hyperlink text]

Brief description of the feature being promoted.

Feature - Markup change - v9.4.2

One tile - Promotional feature

[Feature hyperlink text]

Brief description of the feature being promoted.

Previous design patterns

Actual visual rendering of previous design patterns may vary due to recent changes.

Context-specific features - Removal - 6.1

Features

[Feature hyperlink text]

Brief description of the feature being promoted.

[Feature hyperlink text]

Brief description of the feature being promoted.

[Feature hyperlink text]

Brief description of the feature being promoted.

GC activities and initiatives - Removal - v6.1

Government initiatives

[Feature hyperlink text]

Brief description of the feature being promoted.

[Feature hyperlink text]

Brief description of the feature being promoted.

Context-specific features - Removal - v4.0.28

Features

[Feature hyperlink text]

Brief description of the feature being promoted.

[Feature hyperlink text]

Brief description of the feature being promoted.

[Feature hyperlink text]

Brief description of the feature being promoted.

GC activities and initiatives - Removal - v4.0.28
Feature - Markup change - Removal - v4.0.28

One tile - Promotional feature

Evaluation and report

There is no evaluation and report available for this component.

API (Component version 4.0)

CSS Class Template Visual rendering Schema
Version 3.0 Version 4.0 Version 3.0 Version 1.0

CSS Class (v3.0)

gc-features
Component: Context-specific features
Version notes
Version 3.0 (v9.4)
  • Added: .well
  • Added: .well-sm
  • Removed: .img-responsive
  • Removed: .mrgn-bttm-md
  • Removed: .mrgn-bttm-sm
  • Removed: .brdr-rds-0
Version 2.1 (v6.1)
  • Added: .gc-features
  • Added: .stretched-link
Version 2.0 (v4.0.28)
  • Deprecated: .gc-nttvs and .gc-prtts
Version 1.0 (prior to v4.0.28)
  • Had: .gc-nttvs and .gc-prtts

Template (v3.1)

Note v3.1: The Cohabit design pattern for feature tile was introduced to support the theme/topic beta template.

gc-features component

One feature tile layout
<section class="gc-features">
	<h2>[[comp:Feature dct:title]]</h2>
	<div class="row">

		<!-- One column -->
		<div data-for="comp:FeatureItem in (comp:Feature comp:features )" class="col-md-8">
			<div class="row">
				<div class="col-sm-6">
					<img class="thumbnail" src="[[comp:FeatureItem html:img-src]]" alt="[[comp:FeatureItem html:img-alt]]"/>
				</div>
				<div class="col-sm-6">
					<h3><a class="stretched-link" data-bind="(href = comp:FeatureItem foaf:page)">[[comp:FeatureItem dct:title]]</a></h3>
					<p>[[comp:FeatureItem dct:description]]</p>
				</div>
			</div>
		</div>

	</div>
</section>
Two or three feature tiles layout
<section class="gc-features">
	<h2>[[comp:Feature dct:title]]</h2>
	<div class="row">

		<!-- Column one -->
		<div data-for="comp:FeatureItem in (comp:Feature comp:features )" class="col-lg-4 col-sm-6">
			<div class="well well-sm eqht-trgt">
				<img src="[[comp:FeatureItem html:img-src]]" alt="[[comp:FeatureItem html:img-alt]]"/>
				<h3><a class="stretched-link" data-bind="(href = comp:FeatureItem foaf:page)">[[comp:FeatureItem dct:title]]</a></h3>
				<p>[[comp:FeatureItem dct:description]]</p>
			</div>
		</div>

		<!-- Column two -->
		<div data-for="comp:FeatureItem in (comp:Feature comp:features )" class="col-lg-4 col-sm-6">
			<div class="well well-sm eqht-trgt">
				<img src="[[comp:FeatureItem html:img-src]]" alt="[[comp:FeatureItem html:img-alt]]"/>
				<h3><a class="stretched-link" data-bind="(href = comp:FeatureItem foaf:page)">[[comp:FeatureItem dct:title]]</a></h3>
				<p>[[comp:FeatureItem dct:description]]</p>
			</div>
		</div>

		<!-- Column three [default] -->
		<div data-for="comp:FeatureItem in (comp:Feature comp:features )" class="col-lg-4 col-sm-6">
			<div class="well well-sm eqht-trgt">
				<img src="[[comp:FeatureItem html:img-src]]" alt="[[comp:FeatureItem html:img-alt]]"/>
				<h3><a class="stretched-link" data-bind="(href = comp:FeatureItem foaf:page)">[[comp:FeatureItem dct:title]]</a></h3>
				<p>[[comp:FeatureItem dct:description]]</p>
			</div>
		</div>

	</div>
</section>
Cohabit design pattern

The GC Features component can be located on the right or on the left of the cohabit component by interchanging col-md-8 and col-md-4.

To be used in this context:

<div class="row mrgn-tp-xl">
	<div class="col-md-8">
		<section class="gc-features">
			<!-- gc-feature here -->
		</section>
	</div>
	<div class="col-md-4">
		<!-- Cohabit component here. For example the Follow us component -->
	</div>
</div>
One feature tile - Cohabit design pattern
<div class="row mrgn-tp-xl">
	<div class="col-md-8">

		<section class="gc-features">
			<h2 class="wb-inv">[[comp:Feature dct:title]]</h2>
			<div class="row" data-for="comp:FeatureItem in ( comp:Feature comp:features )">

				<!-- One column -->
				<div class="col-md-6">
					<img class="thumbnail" src="[[comp:FeatureItem html:img-src]]" alt="[[comp:FeatureItem html:img-alt]]"/>
				</div>
				<div class="col-md-6">
					<h3><a class="stretched-link" data-bind="(href = comp:FeatureItem foaf:page)">[[comp:FeatureItem dct:title]]</a></h3>
					<p>[[comp:FeatureItem dct:description]]</p>
				</div>
			</div>
		</section>

	</div>
	<div class="col-md-4">
		<!-- Cohabit component here. For example the Follow us component -->
	</div>
</div>
Two feature tiles - Cohabit design pattern
<div class="row mrgn-tp-xl">
	<div class="col-md-8">

		<section class="gc-features">
			<h2 class="wb-inv">[[comp:Feature dct:title]]</h2>
			<div class="row wb-eqht">

				<!-- Two column -->
				<div data-for="comp:FeatureItem in (comp:Feature comp:features )" class="col-md-6">
					<h3><a class="stretched-link" data-bind="(href = comp:FeatureItem foaf:page)">[[comp:FeatureItem dct:title]]</a></h3>
					<img src="[[comp:FeatureItem html:img-src]]" alt="[[comp:FeatureItem html:img-alt]]"/>
					<p>[[comp:FeatureItem dct:description]]</p>
				</div>
			</div>
		</section>

	</div>
	<div class="col-md-4">
		<!-- Cohabit component here. For example the Follow us component -->
	</div>
</div>

Features Variant: Government initiatives

Distinguishable by its .well containers inside .col-sm-6 columns. Image size of 520 x 200 and being on a two column layout only.

<section class="gc-features">
	<h2>[[comp:Feature dct:title]]</h2>
	<div class="row row-eqht">

		<!-- Column one  -->
		<div data-if="comp:Feature comp:featureType == 'gc-initiatives'" data-for="comp:FeatureItem in (comp:Feature comp:features )" class="col-sm-6">
			<div class="well well-sm eqht-trgt">
			<img src="[[comp:FeatureItem html:img-src]]" alt="[[comp:FeatureItem html:img-alt]]"/>
			<h3><a class="stretched-link" data-bind="(href = comp:FeatureItem foaf:page)">[[comp:FeatureItem dct:title]]</a></h3>
			<p>[[comp:FeatureItem dct:description]]</p>
		</div>

		<!-- Column two -->
		<div data-if="comp:Feature comp:featureType == 'gc-initiatives'" data-for="comp:FeatureItem in (comp:Feature comp:features )" class="col-sm-6">
			<div class="well well-sm eqht-trgt">
			<img src="[[comp:FeatureItem html:img-src]]" alt="[[comp:FeatureItem html:img-alt]]"/>
			<h3><a class="stretched-link" data-bind="(href = comp:FeatureItem foaf:page)">[[comp:FeatureItem dct:title]]</a></h3>
			<p>[[comp:FeatureItem dct:description]]</p>
		</div>

	</div>
</section>
Previous version
Version 3.1 (GCWeb v9.1)
  • Added: Cohabit design pattern, usable in a specific context
Version 3.0 (GCWeb v6.1)
  • Deprecated: <figure> and <figcaption>
  • Deprecated: <a> as a wrapper
Version 2.0 (GCWeb v4.0.28)
  • Added: <figure> and <figcaption>
Version 1.0 (prior to GCWeb v4.0.28)
  • Had: <section> tags

Visual rendering (v3.0)

Version notes
Version 3.0 (v9.4.2)
  • Simplified template and make features match goverment initiatives.
  • Text layout match the Service and Information component
Version 2.0 (v6.1)
  • Removed: Drop shadow effect on mouse over
  • Removed: Thumbnail image not clickable on one-column layout
Version 1.0 (prior to v6.1)
  • Original rendering

Schema (v1.0)

#
# Schema of the Context-specific features component
#

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix wms: <http://vocab.canada.ca/wms> .
@prefix comp: <http://vocab.canada.ca/wms/component> .


comp:Feature
	dct:issued "2017-01-01"^^xsd:date ;
	a rdfs:Class, wms:Component ;
	wms:componentName "gc-features" ;
	rdfs:label "Context-specific features"@en ;
	rdfs:label "Promotions contextuelles"@fr ;
	rdfs:isDefinedBy <https://design.canada.ca/common-design-patterns/feature-tiles.html>@en ;
	rdfs:isDefinedBy <https://conception.canada.ca/configurations-conception-communes/vignettes-promotionnelles.html>@fr ;

comp:FeatureItem
	dct:issued "2017-01-01"^^xsd:date ;
	a rdfs:Class, wms:Component ;
	rdfs:label "Features link"@en ;
	rdfs:label "Lien en vedette"@fr ;

comp:features
	dct:issued "2017-01-01"^^xsd:date ;
	a rdf:Property ;
	rdfs:domains comp:Feature ;
	rdfs:range comp:FeatureItem .

comp:FeatureType
	a rdfs:Class ;
	rdfs:label "Allows variants"@en .

Shapes graphs

#
# Shape graph of the Context-specific features component
#

@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix comp: <http://vocab.canada.ca/wms/component> .
@prefix html: <http://vocab.canada.ca/wms/html/img#> .

comp:FeatureShape
	a sh:NodeShape ;
	sh:targetClass comp:Feature ;
	sh:and (
		[
			sh:path dct:title ;
			sh:uniqueLang true ;
			sh:severity sh:Violation ;
		]
		[
			sh:path comp:features ;
			sh:minExclusive 0 ;
			sh:maxInclusive 3 ;
			sh:severity sh:Warning ;
		]
	)
	sh:property [
		sh:path comp:featureType ;
		sh:targetClass comp:FeatureType ;
	] .

comp:FeatureItemShape
	a sh:NodeShape ;
	sh:targetClass comp:FeatureItem ;
	sh:and (
		[
			sh:path dct:title ;
			sh:uniqueLang true ;
			sh:severity sh:Violation ;
		]
		[
			sh:path dct:description ;
			sh:uniqueLang true ;
			sh:severity sh:Violation ;
		]
		[
			sh:path foaf:page ;
			sh:uniqueLang true ;
			sh:severity sh:Violation ;
		]
		[
			sh:path html:img-src ;
			sh:uniqueLang true ;
			sh:severity sh:Violation ;
		]
		[
			sh:path html:img-alt ;
			sh:uniqueLang true ;
			sh:severity sh:Warning ;
		]
	) .

JSON-LD sample

{
	"@context": {
		"foaf": "http://xmlns.com/foaf/0.1/",
		"dct": "http://purl.org/dc/terms/",
		"comp": "http://vocab.canada.ca/wms/component"
		"html": "http://vocab.canada.ca/wms/html/img"
	},
	"dct:title": "Government initiatives",
	"comp:featureType": "gc-initiatives",
	"comp:features": [
		{
			"foaf:page": "https://www.canada.ca/feature/link",
			"dct:title": "[Feature item hyperlink text]",
			"dct:description": "[Feature item description]",
			"html:img-src": "[Feature item image URL]",
			"html:img-alt": "[Feature item image alternative text]"
		},
		{
			"foaf:page": "https://www.canada.ca/feature/link/2",
			"dct:title": "[Feature item hyperlink text 2]",
			"dct:description": "[Feature item description 2]",
			"html:img-src": "[Feature item image URL 2]",
			"html:img-alt": "[Feature item image alternative text 2]"
		}
	]
}

Reference

Page details

Date modified: