Differences

This shows you the differences between two versions of the page.

Link to this comparison view

dev:changes_in_2.8 [2016/02/24 18:26]
plg search.tpl
dev:changes_in_2.8 [2016/02/25 10:35] (current)
plg [conf_get_param]
Line 112: Line 112:
  
 <code php>$ext = conf_get_param('pdf_representative_ext', 'jpg');</code> <code php>$ext = conf_get_param('pdf_representative_ext', 'jpg');</code>
 +
 +Second parameter, the default value, is optional.
  
 ===== search.tpl ===== ===== search.tpl =====
Line 120: Line 122:
    <label><input type="checkbox" name="search_in_tags" value="tags"> {'Tags'|translate}</label>    <label><input type="checkbox" name="search_in_tags" value="tags"> {'Tags'|translate}</label>
 {/if}</code> {/if}</code>
 +
 +===== picture.tpl and formats =====
 +
 +Piwigo 2.8 introduces multiple formats, ie the ability to have several formats (or versions) of the same photo. Like a JPEG + RAW + TIFF + PDF... On picture.php, the download button is tranformed into a switchbox, which shows the list of available formats.
 +
 +First the download link must be an <code>id="downloadSwitchLink"</code>
 +
 +Then, insert:
 +
 +<code html>{if !empty($current.formats)}
 +{footer_script require='jquery'}{literal}
 +jQuery().ready(function() {
 +  jQuery("#downloadSwitchLink").removeAttr("href");
 +
 +  (window.SwitchBox=window.SwitchBox||[]).push("#downloadSwitchLink", "#downloadSwitchBox");
 +});
 +{/literal}{/footer_script}
 +
 +<div id="downloadSwitchBox" class="switchBox">
 +  <div class="switchBoxTitle">{'Download'|translate} - {'Formats'|translate}</div>
 +  <ul>
 +  {foreach from=$current.formats item=format}
 +    <li><a href="{$format.download_url}" rel="nofollow">{$format.label}<span class="downloadformatDetails"> ({$format.filesize})</span></a></li>
 +  {/foreach}
 +  </ul>
 +</div>
 +{/if} {* has formats *}</code>
 
Back to top
dev/changes_in_2.8.1456334797.txt.gz · Last modified: 2016/02/24 18:26 by plg
 
 
github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact