CGBlog Admin article list usability improvements

  Previous article Next article  

CGBlog Admin article list usability improvements

  Article optimized for CMSMS 2.x

  Author:
  Last tested in: CMSMS 2.2.2
  Last updated: 15-08-2017
  Comments: 0

As a frequent user of the CGBlog module for CMS Made Simple™, I sometimes miss the overview of planned blog articles. When planning several articles ahead you can't see which articles are actually published and which are not. Note all are marked published and so have the green check, but for some the start time is not reached. When having lots of articles that can be difficult...

I made some changes to the article list template so the date text is bold when an article is visible at the front end of the website. Ohw, and I added the time stamp to the list!

  How to use

Changing module template isn't that difficult. Just find the template file in the module folder and change the Smarty code like you want! And tadah, you fixed the problem! BUT after upgrading the module, the changes are overwritten... ugh...

CMS Made Simple module_custom to the rescue! :)

This is a core feature for changing templates (and language strings) without being afraid of losing the changes after upgrading. It is a valid way of changing the code and is not considered hacking.

Read more about customizing Admin templates at the CMSMS documentation website

1. Copy the file /modules/CGBlog/templates/articlelist.tpl to a new folder (assets)/module_custom/CGBlog/templates/articlelist.tpl

2. Around line 143 of the file you will find:

<td>{$entry->u_postdate|date_format:'%Y/%m/%d'}</td>
<td>{if !empty($entry->u_enddate)}{$entry->u_startdate|date_format:'%Y/%m/%d'}{/if}</td>
<td>
  {if $entry->expired == 1}
    <div class="important">{$entry->u_enddate|date_format:'%Y/%m/%d'}</div>
  {else}
    {$entry->u_enddate|date_format:'%Y/%m/%d'}
  {/if}
</td>

3. Change it to:

<td>
  {if ($entry->u_postdate|date_format:'%Y/%m/%d %H:%M' > $smarty.now|date_format:'%Y/%m/%d %H:%M') OR ($entry->o_status != 'published')}
    {$entry->u_postdate|date_format:'%Y/%m/%d %H:%M'}
  {else}
    <b>{$entry->u_postdate|date_format:'%Y/%m/%d %H:%M'}</b>
  {/if}
</td>
<td>{if !empty($entry->u_enddate)}{$entry->u_startdate|date_format:'%Y/%m/%d %H:%M'}{/if}</td>
<td>
  {if $entry->expired == 1}
    <div class="important">{$entry->u_enddate|date_format:'%Y/%m/%d %H:%M'}</div>
  {else}
    {$entry->u_enddate|date_format:'%Y/%m/%d %H:%M'}
  {/if}
</td>

Save the file and open the CGBlog Admin page and you are ready to go!


A2 Webhosting CMS Made Simple


A2 Webhosting CMS Made Simple

  Comments

  Click here to leave a comment






This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)
  « Enter the CAPTCHA code (lower case)

Your IP address will be stored on submit. I reserve the right to change or delete your response without notice!
In case of abuse your IP address will be blocked!


Can I have your attention for a moment?

Did this tutorial help you solving a problem at your (clients) website and it saved you many hours of work? Great!!
Consider buying Rolf a cup of coffee in return! [ Click here ]


  0 Comments

No comments yet...

CMS Made Simple 2.2.2 - Tutorials, tips and tricks - CMSMS 2.2.2

CGBlog Admin article list usability improvements

  Article optimized for CMSMS 2.x

  Author:
  Last tested in: CMSMS 2.2.2
  Last updated: 15-08-2017
  Comments: 0

A2 Webhosting CMS Made Simple