File

app/dxa/dxa-entity/views/footer/footer.component.ts

Implements

OnInit

Metadata

selector footer[footer]
styleUrls ./footer.component.scss
templateUrl ./footer.component.html

Index

Properties
Methods

Constructor

constructor(rowResolver: RowResolverService, dataResolver: DataResolverService, publication: PublicationService)
Parameters :
Name Type Optional
rowResolver RowResolverService No
dataResolver DataResolverService No
publication PublicationService No

Methods

ngOnInit
ngOnInit()
Returns : void
setupRegions
setupRegions()
Returns : any

Properties

footerRegion
footerSideRegion
footerSoleRegion
page
import { Component, OnInit, Input } from '@angular/core';
import { RowResolverService } from 'src/app/core/services/row-resolver.service';
import { DataResolverService } from 'src/app/core/services/data-resolver/data-resolver.service';
import { PublicationService } from 'src/app/core/services/publication-service/publication.service';

@Component({
	selector: 'footer[footer]',
	templateUrl: './footer.component.html',
	styleUrls: ['./footer.component.scss']
})
export class FooterComponent implements OnInit {

	page;
	footerRegion;
	footerSideRegion;
	footerSoleRegion;

	constructor(
		private rowResolver: RowResolverService,
		private dataResolver: DataResolverService,
		private publication: PublicationService
	) { }

	ngOnInit() {
		this.setupRegions();
	}

	setupRegions(): any {

		const pubPath = this.publication.getPublicationPath();
		const url = `${pubPath}/system-pages/footer`;

		this.dataResolver.getPageData(url).then(page => {
			this.page = page;

			const regions = this.page.Regions;

			const footerReg = regions.find(region => region.Name === 'footer');
			this.footerRegion = footerReg ? footerReg.Entities : [];

			const footerSideReg = regions.find(region => region.Name === 'footerSide');
			this.footerSideRegion = footerSideReg ? footerSideReg.Entities : [];

			const footerSoleReg = regions.find(region => region.Name === 'footerSole');
			this.footerSoleRegion = footerSoleReg ? footerSoleReg.Entities : [];

			this.footerRegion = this.rowResolver.transform(this.footerRegion, 'FOOTER');
			this.footerSideRegion = this.rowResolver.transform(this.footerSideRegion, 'FOOTER');
			this.footerSoleRegion = this.rowResolver.transform(this.footerSoleRegion, 'FOOTER');

		});
	}
}

<ng-container *ngIf="page">
	<div class="container">
		<div class="row">
			<div footer-region class="col-sm-12 col-md-7" [region]="footerRegion"></div>
			<div footer-region class="col-sm-12 col-md-5" [region]="footerSideRegion"></div>
		</div>
	</div>

	<div footer-region class="footer-sole-region" [region]="footerSoleRegion"></div>
</ng-container>

./footer.component.scss

@import 'src/app/styles/helpers';

:host {
	background-color: $off-white;
	margin-top: auto;
	border-top: 5px solid white;
}

.row {
	padding: 0;
    // Increase spacing 1.5x in desktop
    @include media-breakpoint-up(md) {
        padding-top: calc-rem(24);
        padding-bottom: calc-rem(24);
    }
}

.no-space {
	@include media-breakpoint-down(sm) {
		padding-left: 0;
		padding-right: 0;
	}
}
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""