-
Notifications
You must be signed in to change notification settings - Fork 4
/
macros_image.html
112 lines (101 loc) · 2.78 KB
/
macros_image.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
<CONTENT VERSION="1.0" LANG="fr" CHARSET="utf-8"/>
/**
* Initialisation de la page.
*/
<DEFMACRO NAME="IMAGE_INIT">
<LET VAR="titre_page" GLOBAL="1">
[#TITRE|removenotes|textebrut] – [#OPTIONS.METADONNEESSITE.TITRESITE]
</LET>
<!--[ Fix de la boucle prev/next ]-->
<MACRO NAME="NAV_ENTITIES_FIX" />
<!--[ Trouver la bonne image ]-->
<IF COND="[#TYPE|strpos('image')] SNE false AND [#DOCUMENT]" />
<LET VAR="image">[#DOCUMENT]</LET>
<LET VAR="image_url">[#ID|makeurlwithfile]</LET>
<ELSEIF COND="[#VIGNETTE]" />
<LET VAR="image">[#VIGNETTE]</LET>
<LET VAR="image_url">[#VIGNETTE]</LET>
</IF>
</DEFMACRO>
/**
* Macro principale appelée par le template.
*/
<DEFMACRO NAME="IMAGE_MAIN">
<FUNC NAME="NAV_ENTITIES" CLASSNAME="nav-entities--top" />
<MACRO NAME="IMAGE_TITLE" />
<MACRO NAME="IMAGE_THUMBNAIL" />
<MACRO NAME="IMAGE_CAPTION" />
<MACRO NAME="IMAGE_DESCRIPTION" />
<MACRO NAME="IMAGE_AUTHORS" />
<MACRO NAME="IMAGE_CREDITS" />
<MACRO NAME="IMAGE_FILE" />
</DEFMACRO>
/**
* Affichage de l'image.
*/
<DEFMACRO NAME="IMAGE_THUMBNAIL">
<IF COND="[#IMAGE]">
<a href="[#IMAGE_URL]"><img class="image__thumbnail" alt="[#TITRE|textebrut|htmlspecialchars(ENT_COMPAT, 'UTF-8')]" src="[#IMAGE|trim|vignette([%SIZE_IMAGE])]" /></a>
</IF>
</DEFMACRO>
/**
* Titre h1 de l'image.
*/
<DEFMACRO NAME="IMAGE_TITLE">
<h1 class="main-title image__title">[#TITRE]</h1>
</DEFMACRO>
/**
* Légende de l'image.
*/
<DEFMACRO NAME="IMAGE_CAPTION">
<IF COND="[#LEGENDE]">
<div class="image__caption">[#LEGENDE]</div>
</IF>
</DEFMACRO>
/**
* Description de l'image.
*/
<DEFMACRO NAME="IMAGE_DESCRIPTION">
<IF COND="[#DESCRIPTION]">
<FUNC NAME="BASE_SECTION_HEADER" TITLE="[@DESCRIPTION]" />
<div class="image__description">[#DESCRIPTION]</div>
</IF>
</DEFMACRO>
/**
* Auteurs de l'image.
*/
<DEFMACRO NAME="IMAGE_AUTHORS">
<LOOP NAME="image_authors" SELECT="prenom, nomfamille" TABLE="auteurs" WHERE="type = 'auteur' AND iddocument = '[#ID]'" ORDER="rank">
<BEFORE>
<LET VAR="section_title"><IF COND="[#NBRESULTS] GT 1">[@AUTEURS]<ELSE/>[@AUTEUR]</IF></LET>
<FUNC NAME="BASE_SECTION_HEADER" TITLE="[#SECTION_TITLE]" />
<p class="image__author">
</BEFORE>
<DO>
[#PRENOM] <span class="family-name">[#NOMFAMILLE]</span>
</DO>
<AFTER>
</p>
</AFTER>
</LOOP>
</DEFMACRO>
/**
* Crédits de l'image.
*/
<DEFMACRO NAME="IMAGE_CREDITS">
<IF COND="[#CREDITS]">
<FUNC NAME="BASE_SECTION_HEADER" TITLE="[@CREDITS]" />
<p class="image__credits">[#CREDITS]</p>
</IF>
</DEFMACRO>
/**
* Chemin de l'image.
*/
<DEFMACRO NAME="IMAGE_FILE">
<IF COND="[#IMAGE]">
<FUNC NAME="BASE_SECTION_HEADER" TITLE="[@FICHIER_ORIGINAL]" />
<p class="image__file">
<a href="[#IMAGE_URL]">[#IMAGE|basename]</a> ([#IMAGE|getFileMime] – [#IMAGE|nicefilesize])
</p>
</IF>
</DEFMACRO>