add piwik & SEO services for SDGs and FOS pages
This commit is contained in:
parent
429ad98246
commit
dc898d673d
|
@ -10,6 +10,8 @@ import {ActivatedRoute, Router} from "@angular/router";
|
||||||
import {Meta, Title} from "@angular/platform-browser";
|
import {Meta, Title} from "@angular/platform-browser";
|
||||||
import {Location} from "@angular/common";
|
import {Location} from "@angular/common";
|
||||||
import {StringUtils} from "../openaireLibrary/utils/string-utils.class";
|
import {StringUtils} from "../openaireLibrary/utils/string-utils.class";
|
||||||
|
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
|
||||||
|
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'fos',
|
selector: 'fos',
|
||||||
|
@ -44,11 +46,17 @@ export class FosComponent implements OnInit, OnDestroy {
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private _router: Router,
|
private _router: Router,
|
||||||
private _meta: Meta,
|
private _meta: Meta,
|
||||||
private _title: Title
|
private _title: Title,
|
||||||
|
private seoService: SEOService,
|
||||||
|
private _piwikService: PiwikService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
|
||||||
|
this.subscriptions.push(this._piwikService.trackView(this.properties, this.pageTitle, this.properties.piwikSiteId).subscribe());
|
||||||
|
}
|
||||||
this.url = this.properties.domain + this.properties.baseLink + this._router.url;
|
this.url = this.properties.domain + this.properties.baseLink + this._router.url;
|
||||||
|
this.seoService.createLinkForCanonicalURL(this.url);
|
||||||
this.updateUrl(this.url);
|
this.updateUrl(this.url);
|
||||||
this.updateTitle(this.pageTitle);
|
this.updateTitle(this.pageTitle);
|
||||||
this.updateDescription(this.pageDescription);
|
this.updateDescription(this.pageDescription);
|
||||||
|
|
|
@ -10,6 +10,8 @@ import {OpenaireEntities} from "../openaireLibrary/utils/properties/searchFields
|
||||||
import {StringUtils} from "../openaireLibrary/utils/string-utils.class";
|
import {StringUtils} from "../openaireLibrary/utils/string-utils.class";
|
||||||
import {Router} from '@angular/router';
|
import {Router} from '@angular/router';
|
||||||
import {Meta, Title} from "@angular/platform-browser";
|
import {Meta, Title} from "@angular/platform-browser";
|
||||||
|
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
|
||||||
|
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'sdg',
|
selector: 'sdg',
|
||||||
|
@ -36,12 +38,18 @@ export class SdgComponent implements OnInit, OnDestroy {
|
||||||
private httpClient: HttpClient, private refineFieldResultsService: RefineFieldResultsService,
|
private httpClient: HttpClient, private refineFieldResultsService: RefineFieldResultsService,
|
||||||
private _router: Router,
|
private _router: Router,
|
||||||
private _meta: Meta,
|
private _meta: Meta,
|
||||||
private _title: Title
|
private _title: Title,
|
||||||
|
private seoService: SEOService,
|
||||||
|
private _piwikService: PiwikService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
|
||||||
|
this.subscriptions.push(this._piwikService.trackView(this.properties, this.pageTitle, this.properties.piwikSiteId).subscribe());
|
||||||
|
}
|
||||||
this.url = this.properties.domain + this.properties.baseLink + this._router.url;
|
this.url = this.properties.domain + this.properties.baseLink + this._router.url;
|
||||||
|
this.seoService.createLinkForCanonicalURL(this.url);
|
||||||
this.updateUrl(this.url);
|
this.updateUrl(this.url);
|
||||||
this.updateTitle(this.pageTitle);
|
this.updateTitle(this.pageTitle);
|
||||||
this.updateDescription(this.pageDescription);
|
this.updateDescription(this.pageDescription);
|
||||||
|
|
Loading…
Reference in New Issue