header.tpl 13.9 KB
Newer Older
1
{* $Id$ *}
2
{if $base_uri and ($dir_level gt 0 or $prefs.feature_html_head_base_tag eq 'y')}
3
	<base href="{$base_uri|escape}">
4
{/if}
5
<!--Latest IE Compatibility-->
6 7
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8
<meta name="generator" content="Tiki Wiki CMS Groupware - https://tiki.org">
9 10
{* --- SocialNetwork:Domain ---*}
<meta content="{$base_url_canonical}" name="twitter:domain"> {* may be obsolete when using twitter:card *}
11
{* --- Canonical URL --- *}
12
{include file="canonical.tpl"}
13

14
{if !empty($forum_info.name) & $prefs.metatag_threadtitle eq 'y'}
15
	<meta name="keywords" content="{tr}Forum{/tr} {$forum_info.name|escape} {$thread_info.title|escape} {if $prefs.feature_freetags eq 'y'}{foreach from=$freetags.data item=taginfo}{$taginfo.tag|escape} {/foreach}{/if}">
16
{elseif isset($galleryId) && $galleryId neq '' && $prefs.metatag_imagetitle neq 'n'}
17
	<meta name="keywords" content="{tr}Images Galleries{/tr} {$title|escape} {if $prefs.feature_freetags eq 'y'}{foreach from=$freetags.data item=taginfo}{$taginfo.tag|escape} {/foreach}{/if}">
18
{elseif $prefs.metatag_keywords neq '' or !empty($metatag_local_keywords)}
19
	<meta name="keywords" content="{$prefs.metatag_keywords|escape} {if $prefs.feature_freetags eq 'y'}{foreach from=$freetags.data item="taginfo"}{$taginfo.tag|escape} {/foreach}{/if} {$metatag_local_keywords|escape}">
20
{/if}
21
{if $prefs.metatag_author neq ''}
22
	<meta name="author" content="{$prefs.metatag_author|escape}">
23
{/if}
24
{* --- Blog description --- *}
lindonb's avatar
lindonb committed
25
{if isset($section) and $section eq "blogs"}
26
	{if not empty($post_info.parsed_excerpt)}
27
		{$metatag_description = $post_info.parsed_excerpt|strip_tags:false|truncate:200|escape}
28
	{elseif not empty($post_info.parsed_data|strip_tags)}
29
		{$metatag_description = $post_info.parsed_data|strip_tags:false|truncate:200|escape}
30
	{else}
31
		{$metatag_description = $post_info.title|cat:' - '|cat:$blog_data.title|escape}
32
	{/if}
33
{* --- Article description --- *}
34 35
{elseif isset($section) and $section eq "cms"}
	{if not empty($heading)}
36
		{$metatag_description = $parsed_heading|strip_tags:false|truncate:200|escape}
37
	{elseif not empty ($body)}
38
		{$metatag_description = $parsed_body|strip_tags:false|truncate:200|escape}
39
	{/if}
40 41 42 43 44 45
{* --- File Gallery description --- *}
{elseif isset($section) and $section eq "file_galleries"}
	{if not empty($gal_info.description)}
		{$metatag_description = $gal_info.description|strip_tags:false|truncate:200|escape}
	{/if}
{* --- Page description --- *}
46 47
{elseif $prefs.metatag_pagedesc eq 'y' and not empty($description)}
	{$metatag_description = $description|escape}
48
{elseif not empty($prefs.metatag_description)}
49
	{$metatag_description = $prefs.metatag_description|escape}
50
{/if}
lindonb's avatar
lindonb committed
51
{if not empty($metatag_description) and not empty($metatag_description|trim)}
52 53
	<meta name="description" content="{$metatag_description}" property="og:description">
	<meta name="twitter:description" content="{$metatag_description}">
54
{else}
55 56
	<meta name="description" content="{$prefs.browsertitle|tr_if|escape}{if isset($title)} {$prefs.site_nav_seper} {$title}{/if}" property="og:description">
	<meta name="twitter:description" content="{$prefs.browsertitle|tr_if|escape}{if isset($title)} {$prefs.site_nav_seper} {$title}{/if}">
57
{/if}
58
{if $prefs.metatag_geoposition neq ''}
59
	<meta name="geo.position" content="{$prefs.metatag_geoposition|escape}">
60
{/if}
61
{if $prefs.metatag_georegion neq ''}
62
	<meta name="geo.region" content="{$prefs.metatag_georegion|escape}">
63
{/if}
64
{if $prefs.metatag_geoplacename neq ''}
65
	<meta name="geo.placename" content="{$prefs.metatag_geoplacename|escape}">
66
{/if}
67
{if (isset($prefs.metatag_robots) and $prefs.metatag_robots neq '') and (!isset($metatag_robots) or $metatag_robots eq '')}
68
	<meta name="robots" content="{$prefs.metatag_robots|escape}">
69
{/if}
70
{if (!isset($prefs.metatag_robots) or $prefs.metatag_robots eq '') and (isset($metatag_robots) and $metatag_robots neq '')}
71
	<meta name="robots" content="{$metatag_robots|escape}">
72
{/if}
73
{if (isset($prefs.metatag_robots) and $prefs.metatag_robots neq '') and (isset($metatag_robots) and $metatag_robots neq '')}
74
	<meta name="robots" content="{$prefs.metatag_robots|escape}, {$metatag_robots|escape}">
75
{/if}
76
{if $prefs.metatag_revisitafter neq ''}
77
	<meta name="revisit-after" content="{$prefs.metatag_revisitafter|escape}">
78
{/if}
79
{* --- SocialNetwork:site_name --- *}
80 81
<meta content="{if not empty($prefs.socialnetworks_facebook_site_name)}{$prefs.socialnetworks_facebook_site_name}{else}{$prefs.browsertitle|tr_if|escape}{/if}" property="og:site_name">
<meta content="{if not empty($prefs.socialnetworks_twitter_site)}{$prefs.socialnetworks_twitter_site}{else}{$prefs.browsertitle|tr_if|escape}{/if}" name="twitter:site">
82 83
{* --- SocialNetwork: fb:app_id ---*}
{if not empty($prefs.socialnetworks_facebook_application_id)}<meta content="{$prefs.socialnetworks_facebook_application_id}" property="fb:app_id">{/if}
84 85

{capture assign='header_title'}{strip}
86 87 88 89 90 91 92
{if !empty($sswindowtitle)}
	{if $sswindowtitle eq 'none'}
		&nbsp;
	{else}
		{$sswindowtitle|escape}
	{/if}
{else}
93
	{if $prefs.site_title_location eq 'before'}{$prefs.browsertitle|tr_if|escape} {$prefs.site_nav_seper} {/if}
94
	{capture assign="page_description_title"}
95 96 97
		{if ($prefs.feature_breadcrumbs eq 'y' or $prefs.site_title_breadcrumb eq "desc") && isset($trail)}
			{breadcrumbs type=$prefs.site_title_breadcrumb loc="head" crumbs=$trail}
		{/if}
98
	{/capture}
sept_7's avatar
sept_7 committed
99
	{if isset($structure) and $structure eq 'y'} {* get the alias name if item is a wiki page and it is in a structure *}
100 101
		{section loop=$structure_path name=ix}
		{assign var="aliasname" value={$structure_path[ix].page_alias}}
102 103
		{/section}
	{/if}
104 105
	{if $prefs.site_title_location eq 'only'}
		{$prefs.browsertitle|tr_if|escape}
106
	{else}
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
		{if !empty($page_description_title)}
			{$page_description_title}
		{else}
			{if !empty($tracker_item_main_value)}
				{$tracker_item_main_value|truncate:255|escape}
			{elseif !empty($title) and !is_array($title)}
				{$title|escape}
			{elseif !empty($aliasname)}
				{$aliasname|escape}
			{elseif !empty($page)}
				{$page|escape}
			{elseif !empty($arttitle)}
				{$arttitle|escape}
			{elseif !empty($thread_info.title)}
				{$thread_info.title|escape}
			{elseif !empty($forum_info.name)}
				{$forum_info.name|escape}
			{elseif !empty($categ_info.name)}
				{$categ_info.name|escape}
			{elseif !empty($userinfo.login)}
				{$userinfo.login|username}
128 129
			{elseif !empty($tracker_info.pagetitle)}
				{$tracker_info.pagetitle|escape}
130 131 132 133 134 135 136 137
			{elseif !empty($tracker_info.name)}
				{$tracker_info.name|escape}
			{elseif !empty($headtitle)}
				{$headtitle|stringfix:"&nbsp;"|escape}{* use $headtitle last if feature specific title not found *}
			{elseif !empty($description)}
				{$description|escape}{* use description if nothing else is found but this is likely to contain tiki markup *}
				{* add $description|escape if you want to put the description + update breadcrumb_build replace return $crumbs->title; with return empty($crumbs->description)? $crumbs->title: $crumbs->description; *}
			{/if}
138
		{/if}
139
	{/if}
140
	{if $prefs.site_title_location eq 'after'} {$prefs.site_nav_seper} {$prefs.browsertitle|tr_if|escape}{/if}
141
{/if}
142 143 144
{/strip}{/capture}
{* --- tiki block --- *}
<title>{$header_title}</title>
145
{* --- SocialNetwork:title --- *}
146
{* Facebook *}
147
<meta property="og:title" content="{$header_title}">
148
{* Twitter *}
149
<meta name="twitter:title" content="{$header_title}">
150 151
{* --- SocialNetwork:type --- *}
{if $prefs.feature_canonical_url eq 'y' and isset($mid)}
152
	{if $mid eq 'tiki-view_blog.tpl' or $mid eq 'tiki-view_blog_post.tpl' or $mid eq 'tiki-read_article.tpl'}
153
		<meta content="article" property="og:type">
154 155
	{else}
		<meta content="website" property="og:type">
156 157 158 159
	{/if}
{/if}
{* To be added someday when using cart feature: product, product.group, product.item *}
{* May be usefull too : profile *}
160
<meta name="twitter:card" content="summary">
161
{* --- SocialNetwork:image --- *}
162 163 164 165 166 167
{if not empty($header_featured_images)}
	{foreach $header_featured_images as $header_featured_image}
		<meta property="og:image" content="{$header_featured_image|escape}">
		<meta name="twitter:image" content="{$header_featured_image|escape}">
	{/foreach}
{/if}
168 169 170 171 172
{if $prefs.feature_canonical_url eq 'y' and isset($mid)}
	{if $mid eq 'tiki-view_blog.tpl'}
	{elseif $mid eq 'tiki-view_blog_post.tpl'}
{* --- Article --- *}
	{elseif $mid eq 'tiki-read_article.tpl'}
173 174
		<meta content="{$base_url_canonical}{if $hasImage eq 'y'}article_image.php?image_type=article&id={$articleId}{else}article_image.php?image_type=topic&id={$topicId}{/if}" property="og:image">
		<meta content="{$base_url_canonical}{if $hasImage eq 'y'}article_image.php?image_type=article&id={$articleId}{else}article_image.php?image_type=topic&id={$topicId}{/if}" name="twitter:image">
175
	{elseif empty($header_featured_images)}
176 177
		{if $prefs.socialnetworks_facebook_site_image}<meta property="og:image" content="{$prefs.socialnetworks_facebook_site_image}">{/if}
		{if $prefs.socialnetworks_twitter_site_image}<meta name="twitter:image" content="{$prefs.socialnetworks_twitter_site_image}">{/if}
178 179
	{/if}
{/if}
180
{* --- universaleditbutton.org --- *}
lphuberdeau's avatar
lphuberdeau committed
181
{if (isset($editable) and $editable) and ($tiki_p_edit eq 'y' or $page|lower eq 'sandbox' or $tiki_p_admin_wiki eq 'y')}
182
	<link rel="alternate" type="application/x-wiki" title="{tr}Edit this page!{/tr}" href="tiki-editpage.php?page={$page|escape:url}">
183
{/if}
184
{* --- Firefox RSS icons --- *}
185
{if $prefs.feature_wiki eq 'y' and $prefs.feed_wiki eq 'y' and $tiki_p_view eq 'y'}
186
	<link rel="alternate" type="application/rss+xml" title='{$prefs.feed_wiki_title|escape|default:"{tr}RSS Wiki{/tr}"}' href="tiki-wiki_rss.php?ver={$prefs.feed_default_version|escape:'url'}">
187
{/if}
188
{if $prefs.feature_blogs eq 'y' and $prefs.feed_blogs eq 'y' and $tiki_p_read_blog eq 'y'}
189
	<link rel="alternate" type="application/rss+xml" title='{$prefs.feed_blogs_title|escape|default:"{tr}RSS Blogs{/tr}"}' href="tiki-blogs_rss.php?ver={$prefs.feed_default_version|escape:'url'}">
190
{/if}
191
{if $prefs.feature_articles eq 'y' and $prefs.feed_articles eq 'y' and $tiki_p_read_article eq 'y'}
192
	<link rel="alternate" type="application/rss+xml" title='{$prefs.feed_articles_title|escape|default:"{tr}RSS Articles{/tr}"}' href="tiki-articles_rss.php?ver={$prefs.feed_default_version|escape:'url'}">
193
{/if}
194
{if $prefs.feature_galleries eq 'y' and $prefs.feed_image_galleries eq 'y' and $tiki_p_view_image_gallery eq 'y'}
195
	<link rel="alternate" type="application/rss+xml" title='{$prefs.feed_image_galleries_title|escape|default:"{tr}RSS Image Galleries{/tr}"}' href="tiki-image_galleries_rss.php?ver={$prefs.feed_default_version}">
196
{/if}
197
{if $prefs.feature_file_galleries eq 'y' and $prefs.feed_file_galleries eq 'y' and $tiki_p_view_file_gallery eq 'y'}
198
	<link rel="alternate" type="application/rss+xml" title='{$prefs.feed_file_galleries_title|escape|default:"{tr}RSS File Galleries{/tr}"}' href="tiki-file_galleries_rss.php?ver={$prefs.feed_default_version|escape:'url'}">
199
{/if}
200
{if $prefs.feature_forums eq 'y' and $prefs.feed_forums eq 'y' and $tiki_p_forum_read eq 'y'}
201
	<link rel="alternate" type="application/rss+xml" title='{$prefs.feed_forums_title|escape|default:"{tr}RSS Forums{/tr}"}' href="tiki-forums_rss.php?ver={$prefs.feed_default_version|escape:'url'}">
202
{/if}
203
{if $prefs.feature_directory eq 'y' and $prefs.feed_directories eq 'y' and $tiki_p_view_directory eq 'y'}
204
	<link rel="alternate" type="application/rss+xml" title='{$prefs.feed_directories_title|escape|default:"{tr}RSS Directories{/tr}"}' href="tiki-directories_rss.php?ver={$prefs.feed_default_version|escape:'url'}">
205
{/if}
206
{if $prefs.feature_calendar eq 'y' and $prefs.feed_calendar eq 'y' and $tiki_p_view_calendar eq 'y'}
207
	<link rel="alternate" type="application/rss+xml" title='{$prefs.feed_calendar_title|escape|default:"{tr}RSS Calendars{/tr}"}' href="tiki-calendars_rss.php?ver={$prefs.feed_default_version|escape:'url'}">
208
{/if}
209 210 211
{if $prefs.feature_trackers eq 'y' and $prefs.feed_tracker eq 'y'}
	{foreach from=$rsslist_trackers item="tracker"}
		<link rel="alternate" type="application/rss+xml"
212 213
			title='{$prefs.feed_tracker_title|cat:" - "|cat:$tracker.name|escape|default:"{tr}RSS Tracker{/tr}"}'
			href="tiki-tracker_rss.php?ver={$prefs.feed_default_version|escape:'url'}&trackerId={$tracker.trackerId}">
214 215
	{/foreach}
{/if}
216
{if ($prefs.feature_blogs eq 'y' and $prefs.feature_blog_sharethis eq 'y') or ($prefs.feature_articles eq 'y' and $prefs.feature_cms_sharethis eq 'y') or ($prefs.feature_wiki eq 'y' and $prefs.feature_wiki_sharethis eq 'y')}
217
	{if $prefs.blog_sharethis_publisher neq "" and $prefs.article_sharethis_publisher neq ""}
218
		<script type="text/javascript" src="https://ws.sharethis.com/button/sharethis.js#publisher={$prefs.blog_sharethis_publisher}&amp;type=website&amp;buttonText=&amp;onmouseover=false&amp;send_services=aim"></script>
219
	{elseif $prefs.blog_sharethis_publisher neq "" and $prefs.article_sharethis_publisher eq ""}
220
		<script type="text/javascript" src="https://ws.sharethis.com/button/sharethis.js#publisher={$prefs.blog_sharethis_publisher}&amp;type=website&amp;buttonText=&amp;onmouseover=false&amp;send_services=aim"></script>
221
	{elseif $prefs.blog_sharethis_publisher eq "" and $prefs.article_sharethis_publisher neq ""}
222
		<script type="text/javascript" src="https://ws.sharethis.com/button/sharethis.js#publisher={$prefs.article_sharethis_publisher}&amp;type=website&amp;buttonText=&amp;onmouseover=false&amp;send_services=aim"></script>
223
	{elseif $prefs.blog_sharethis_publisher eq "" and $prefs.article_sharethis_publisher eq ""}
224
		<script type="text/javascript" src="https://ws.sharethis.com/button/sharethis.js#type=website&amp;buttonText=&amp;onmouseover=false&amp;send_services=aim"></script>
225 226
	{/if}
{/if}
227
<!--[if lt IE 9]>{* according to http://remysharp.com/2009/01/07/html5-enabling-script/ *}
228
	<script src="vendor_bundled/vendor/afarkas/html5shiv/dist/html5shiv.min.js" type="text/javascript"></script>
229
<![endif]-->
230
{if $headerlib}		{$headerlib->output_headers()}{/if}
231 232 233
{if $prefs.feature_custom_html_head_content}
	{eval var=$prefs.feature_custom_html_head_content}
{/if}
234
{* END of html head content *}