Revision 46415
Added by Argiro Kokogiannaki about 7 years ago
searchPage.component.ts | ||
---|---|---|
7 | 7 |
import {SearchUtilsClass} from './searchUtils.class'; |
8 | 8 |
import {DOI, StringUtils} from '../../utils/string-utils.class'; |
9 | 9 |
import {ModalLoading} from '../../utils/modal/loading.component'; |
10 |
import { Meta} from '../../../angular2-meta'; |
|
10 | 11 |
|
11 | 12 |
@Component({ |
12 | 13 |
selector: 'search-page', |
... | ... | |
93 | 94 |
public urlParam: string; |
94 | 95 |
public parameterNames:string[] =[]; |
95 | 96 |
public parameterValues:string[] =[]; |
96 |
constructor (private location: Location ) { |
|
97 |
|
|
97 |
constructor (private location: Location , private _meta: Meta) { |
|
98 | 98 |
} |
99 | 99 |
|
100 | 100 |
ngOnInit() { |
101 | 101 |
this.updateBaseUrlWithParameters(this.filters); |
102 | 102 |
this.defineUrlParam(); |
103 |
//console.info(this.entityType + " " + this.urlParam); |
|
103 |
this.updateTitle(this.pageTitle); |
|
104 |
this.updateDescription("Openaire, search, repositories, open access, type, data provider, funder, project, " + this.type + "," +this.pageTitle); |
|
105 |
// console.info(this.entityType + " " + this.urlParam + this.type); |
|
104 | 106 |
} |
105 | 107 |
ngAfterViewChecked(){ |
106 | 108 |
|
107 | 109 |
} |
108 |
|
|
110 |
updateDescription(description:string){ |
|
111 |
this._meta.updateMeta("description", description); |
|
112 |
this._meta.updateMeta("og:description", description); |
|
113 |
} |
|
114 |
updateTitle(title:string){ |
|
115 |
var _suffix ="| OpenAIRE"; |
|
116 |
var _title = ((title.length> 50 ) ?title.substring(0,50):title) + _suffix; |
|
117 |
this._meta.setTitle(_title ); |
|
118 |
this._meta.updateMeta("og:title",_title); |
|
119 |
} |
|
109 | 120 |
private defineUrlParam() { |
110 | 121 |
if(this.entityType == "publication") { |
111 | 122 |
this.urlParam = "articleId"; |
Also available in: Unified diff
SEO meta tags & title for each page | footer menu | cookies law message | entity auto complete | change deposit & claims urls to look alike production (participate/*)