I found the solution here for joomla native articles:
https://www.gavick.com/forums/boutique/ ... 14609.htmldevplus wrote:Hi guys,
I don't think the css override technique is the best option since it will hide the date for all articles...
To be able to control whether to show the article creation date or not, open file templates\gk_boutique\html\com_content\article\default.php
and change:
<div class="itemDate">
<span class="itemDateDay">
<?php echo JHTML::_('date',$this->item->created, 'd'); ?>
</span>
<span class="itemDateMonth">
<?php echo JHTML::_('date',$this->item->created, 'M'); ?>
</span>
</div>
to:
<?php if ($params->get('show_create_date')) : ?>
<div class="itemDate">
<span class="itemDateDay">
<?php echo JHTML::_('date',$this->item->created, 'd'); ?>
</span>
<span class="itemDateMonth">
<?php echo JHTML::_('date',$this->item->created, 'M'); ?>
</span>
</div>
<?php endif; ?>
And this is what I've done with k2 items:
open file templates/gk_boutique/html/com_k2/templates/yourtemplate/item.php
You'll see this in line 51-59:
- Code: Select all
<?php if($this->item->params->get('itemTitle')): ?>
<!-- Item title -->
<!-- Date created -->
<div class="itemDate">
<span class="itemDateDay"><?php echo JHTML::_('date', $this->item->created , JText::_('d')); ?></span>
<span class="itemDateMonth"><?php echo JHTML::_('date', $this->item->created , JText::_('M')); ?></span>
</div>
<h2 class="itemTitle">
<?php echo $this->item->title; ?>
That causes the date "linked" to the title display.
Modify the codes to saperate them like this:
- Code: Select all
<!-- Date created -->
<?php if($this->item->params->get('itemDateCreated')): ?>
<div class="itemDate">
<span class="itemDateDay"><?php echo JHTML::_('date', $this->item->created , JText::_('d')); ?></span>
<span class="itemDateMonth"><?php echo JHTML::_('date', $this->item->created , JText::_('M')); ?></span>
</div>
<?php endif; ?>
<!-- Item title -->
<?php if($this->item->params->get('itemTitle')): ?>
<h2 class="itemTitle">
<?php echo $this->item->title; ?>
Cheers!