Changeset 574:6430df826043 for themes
- Timestamp:
- 07/11/11 18:29:40 (14 years ago)
- Branch:
- themes
- Location:
- themes/ductile
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
themes/ductile/_public.php
r563 r574 19 19 # Templates 20 20 $core->tpl->addValue('ductileEntriesList',array('tplDuctileTheme','ductileEntriesList')); 21 $core->tpl->addBlock('EntryIfContentIsCut',array('tplDuctileTheme','EntryIfContentIsCut')); 21 22 22 23 class tplDuctileTheme 23 24 { 25 public static function EntryIfContentIsCut($attr,$content) 26 { 27 global $core; 28 29 if (empty($attr['cut_string']) || empty($attr['cut_string'])) { 30 return ''; 31 } 32 33 $urls = '0'; 34 if (!empty($attr['absolute_urls'])) { 35 $urls = '1'; 36 } 37 38 $short = $core->tpl->getFilters($attr); 39 $attr['cut_string'] = 0; 40 $full = $core->tpl->getFilters($attr); 41 42 return '<?php if (strlen('.sprintf($full,'$_ctx->posts->getContent('.$urls.')').') > '. 43 'strlen('.sprintf($short,'$_ctx->posts->getContent('.$urls.')').')) : ?>'. 44 $content. 45 '<?php endif; ?>'; 46 } 47 24 48 public static function ductileEntriesList($attr) 25 49 { -
themes/ductile/tpl/_entry-short.html
r535 r574 39 39 <tpl:EntryIf extended="0"> 40 40 <div class="post-content">{{tpl:EntryContent encode_html="1" remove_html="1" cut_string="300"}}</div> 41 <p class="read-it"><a href="{{tpl:EntryURL}}" 42 title="{{tpl:lang Continue reading}} {{tpl:EntryTitle encode_html="1"}}">{{tpl:lang Continue 43 reading}}</a></p> 41 <tpl:EntryIfContentIsCut encode_html="1" remove_html="1" cut_string="300"> 42 <p class="read-it"><a href="{{tpl:EntryURL}}" 43 title="{{tpl:lang Continue reading}} {{tpl:EntryTitle encode_html="1"}}">{{tpl:lang Continue reading}}</a></p> 44 </tpl:EntryIfContentIsCut> 44 45 </tpl:EntryIf> 45 46
Note: See TracChangeset
for help on using the changeset viewer.