David Unwin

Display Date other than Creation Date

4 posts in this topic

The default date display in the module is to display the creation date.

Is it possible to display the Finish Publish date ?

I realise this may need code change.

I would also like to do it for just one version of the module and not a change to all versions.

Is this feasible without causing big problems.

Thanks for any help?

David

Share this post


Link to post
Share on other sites

Hi David.

Here is solution for you and everyone.

First, to make this feature can be configurable for each module instance (you use "version" word, but i think it should be "instance")

We need new parameter

Please open file mod_bt_contentslider.xml then add this field


<field name="displayed_date" type="list" default="created"
label="Displayed Date" description="Choose a type of date that will be displayed">
<option value="created">Created Date</option>
<option value="publish_up">Publish Up</option>
</field>

Right below field (recommened)

<field name="show_date" type="radio" default="0" class="btn-group"
label="SHOW_DATE" description="SHOW_DATE_DESC">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

You can see new parameter after that, you can set it up.

Next, open file /classes/{your chosen source}.php, example k2.php

Find this line (or same)

$item->date = JHtml::_('date', $item->created, JText::_($dateFormat));

Change it to

$displayedDate = $params->get('displayed_date', 'created');
$item->date = JHtml::_('date', $item->$displayedDate, JText::_($dateFormat));

Now, enjoy it.

David Unwin likes this

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now