Keyword

[Resolved] Templating Date

  • Stéphane Herby
  • Stéphane Herby's Avatar Topic Author
  • Offline
  • New Member
More
13 years 9 months ago #91070 by Stéphane Herby
[Resolved] Templating Date was created by Stéphane Herby
Hi I would like the Date Created of an item to be print diffrently (second file joined) as original (first file joined).So I Have added this lignes in my CSS of K2 :.k2_datewrapper {float: left;width: 40px;position: relative;padding-right: 12px;border-right-color: #cccccc;border-right-width: 1px;border-right-style: solid;margin-right: 10px;}.k2_daydate {line-height: 25px;font-size: 28px;}.k2_month {line-height: 12px;color: #999999;font-size: 14px;font-weight: normal;padding-left: 2px;text-transform: uppercase;}.k2_yeardate {font-size: 14px;display:block; margin-left: 26px;margin-top: -30px;position: absolute;-webkit-transform: rotate(-90deg); -moz-transform: rotate(-90deg);            }Then look for this lign in "item.php" of your template :        <?php if($this->item->params->get('itemDateCreated')): ?>        <!-- Date created -->        <span class="itemDateCreated">            <?php echo JHTML::_('date', $this->item->created , JText::_('DATE_FORMAT_LC2')); ?>        </span>        <?php endif; ?>And change it for this :        <?php if($this->item->params->get('itemDateCreated')): ?>        <!-- Date created -->        <div class="k2_datewrapper">            <div class="k2_month"><?php echo JHTML::_('date', $this->item->created, JText::_('%b')); ?></div><div class="k2_daydate"><?php echo JHTML::_('date', $this->item->created, JText::_('%d')); ?></div><div class="k2_yeardate"><?php echo JHTML::_('date', $this->item->created, JText::_('%Y')); ?></div>        </div>        <?php endif; ?>And here you are ! WWell, it work for me, if anybody has something to suggest, you're welcome, i'm a real newbie in coding ;)
Attachments:

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum