source: trunk/themes/default/template/thumbnails.tpl @ 12954

Last change on this file since 12954 was 12954, checked in by rvelices, 12 years ago

feature 2548 multisize

  • added define_derivative template functiion for themes and plugins
  • code cleanup, new events ...
  • Property svn:eol-style set to LF
File size: 1.5 KB
Line 
1{if !empty($thumbnails)}{strip}
2{*define_derivative name='derivative_params' width=160 height=90 crop=true*}
3{html_style}
4{*Set some sizes according to maximum thumbnail width and height*}
5.thumbnails SPAN,
6.thumbnails .wrap2 A,
7.thumbnails LABEL{ldelim}
8        width: {$derivative_params->max_width()}px;
9}
10
11.thumbnails .wrap2{ldelim}
12        height: {$derivative_params->max_height()+2}px;
13}
14{if $derivative_params->max_width() > 600}
15.thumbLegend {ldelim}font-size: 130%}
16{else}
17{if $derivative_params->max_width() > 400}
18.thumbLegend {ldelim}font-size: 110%}
19{else}
20.thumbLegend {ldelim}font-size: 90%}
21{/if}
22{/if}
23{/html_style}
24{foreach from=$thumbnails item=thumbnail}
25        <li>
26        <span class="wrap1">
27                <span class="wrap2">
28                <a href="{$thumbnail.URL}">
29                        <img class="thumbnail" src="{$pwg->derivative_url($derivative_params, $thumbnail.src_image)}" alt="{$thumbnail.TN_ALT}" title="{$thumbnail.TN_TITLE}">
30                </a>
31                </span>
32                {if $SHOW_THUMBNAIL_CAPTION }
33                <span class="thumbLegend">
34                {$thumbnail.NAME}
35                {if !empty($thumbnail.icon_ts)}
36                <img title="{$thumbnail.icon_ts.TITLE}" src="{$ROOT_URL}{$themeconf.icon_dir}/recent.png" alt="(!)">
37                {/if}
38                {if isset($thumbnail.NB_COMMENTS)}
39                <span class="{if 0==$thumbnail.NB_COMMENTS}zero {/if}nb-comments">
40                <br>
41                {$pwg->l10n_dec('%d comment', '%d comments',$thumbnail.NB_COMMENTS)}
42                </span>
43                {/if}
44
45                {if isset($thumbnail.NB_HITS)}
46                <span class="{if 0==$thumbnail.NB_HITS}zero {/if}nb-hits">
47                <br>
48                {$pwg->l10n_dec('%d hit', '%d hits',$thumbnail.NB_HITS)}
49                </span>
50                {/if}
51                </span>
52                {/if}
53        </span>
54        </li>
55{/foreach}{/strip}
56{/if}
Note: See TracBrowser for help on using the repository browser.