forked from chapitreneuf/nova
-
Notifications
You must be signed in to change notification settings - Fork 0
/
macros_lien.html
124 lines (109 loc) · 3.16 KB
/
macros_lien.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<CONTENT VERSION="1.0" LANG="fr" CHARSET="utf-8"/>
/**
* Initialisation de la page.
*/
<DEFMACRO NAME="LIEN_INIT">
<LET VAR="titre_page" GLOBAL="1">
[#TITRE|removenotes|textebrut] – [#OPTIONS.METADONNEESSITE.TITRESITE]
</LET>
<IF COND="[#URLFIL] LIKE /^https?:\/\/twitter\.com\//">
<LET VAR="IS_TWITTER" GLOBAL="1">1</LET>
</IF>
<!--[ Fix de la boucle prev/next ]-->
<MACRO NAME="NAV_ENTITIES_FIX" />
</DEFMACRO>
/**
* Macro principale appelée par le template.
*/
<DEFMACRO NAME="LIEN_MAIN">
<MACRO NAME="LIEN_HEADER" />
<div class="lien clearfix">
<MACRO NAME="LIEN_CAPTURE" />
<MACRO NAME="LIEN_TEXTE" />
</div>
<IF COND="[%IS_TWITTER]">
<MACRO NAME="LIEN_TWEETS" />
<ELSE />
<MACRO NAME="LIEN_RSS" />
</IF>
</DEFMACRO>
/**
* Header du lien.
*/
<DEFMACRO NAME="LIEN_HEADER">
<header class="lien__header">
<FUNC NAME="NAV_ENTITIES" CLASSNAME="nav-entities--top" />
<h1 class="lien__title main-title">[#TITRE|cleanCallNotes]</h1>
<IF COND="[#URL]">
<p class="lien__url"><a href="[#URL]">[#URL]</a></p>
</IF>
<p class="lien__date">[@NOTICE_REVISEE_LE] [#MODIFICATIONDATE|formateddate("%d/%m/%Y")]<FUNC NAME="BASE_LISTER_PERSONNES" TYPE="auteur" PREPEND=" [@PAR] " /></p>
</header>
</DEFMACRO>
/**
* Capture d'écran.
*/
<DEFMACRO NAME="LIEN_CAPTURE">
<IF COND="[#CAPTUREDECRAN]">
<section class="lien__capture">
<a href="[#URL|htmlspecialchars(ENT_COMPAT, 'UTF-8')]">
<img class="publi-cover" src="[#CAPTUREDECRAN|vignette([%SIZE_CAPTURE])]" alt="[@CAPTUREDECRAN_DU_SITE] [#TITRE|cleanCallNotes|textebrut]" />
</a>
</section>
</IF>
</DEFMACRO>
/**
* Texte du lien.
*/
<DEFMACRO NAME="LIEN_TEXTE">
<section class="lien__text">
[#TEXTE|cleanCallNotes]
</section>
</DEFMACRO>
/**
* Affichage des éléments du flux RSS.
*/
<DEFMACRO NAME="LIEN_RSS">
<IF COND="[#URLFIL]">
<section class="lien-rss">
<FUNC NAME="BASE_SECTION_HEADER" TITLE="[@DERNIERS_ARTICLES]" />
<BLOCK ID="1" REFRESH="1800">
<ul class="lien-rss__list">
<LOOP NAME="rss" URL="[#URLFIL]">
<IF COND="![#NOMBREMAXITEMS]">
<LET VAR="nombremaxitems">5</LET>
</IF>
<LOOP NAME="rssitem" LIMIT="0,[#NOMBREMAXITEMS]">
<IF COND="[#TITLE]">
<li>
<h3 class="link-rss__title">
<a href="[#LINK|htmlspecialchars(ENT_COMPAT, 'UTF-8')]">
[#TITLE|cleanBadChars]
</a>
</h3>
<IF COND="[#DESCRIPTION] NE [#TITLE]">
<p class="link-rss__description">
[#DESCRIPTION|cleanBadChars|strip_tags('<p><span><br><em><strong><sup><i><b>')|cuttext(300, true)|replace('[...]', '')]
</p>
</IF>
</li>
</IF>
</LOOP>
</LOOP>
</ul>
</BLOCK>
<a rel="external" class="lien-rss__button button arrow-external" href="[#URLFIL|htmlspecialchars(ENT_COMPAT, 'UTF-8')]" aria-label="[@LIEN_RSS] : [#TITRE|textebrut]">[@LIEN_RSS]</a>
</section>
</IF>
</DEFMACRO>
/**
* Affichage des tweets.
*/
<DEFMACRO NAME="LIEN_TWEETS">
<IF COND="[#URLFIL]">
<section class="lien-tweets">
<FUNC NAME="BASE_SECTION_HEADER" TITLE="[@TWEETS]" />
<FUNC NAME="BASE_TWITTER_CONTAINER" TITLE="[#TITRE]" />
</section>
</IF>
</DEFMACRO>