Time not displaying

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
dnmuxo
Posts: 2
Joined: Thu Nov 19, 2020 4:23 am

Time not displaying

Post by dnmuxo »

I am using the Coffee bar theme. When I select "Older..." under Archives in the sidebar I get the following list:

Topics from November 2020

Birth of a Blog Posted by Dave Muxo on
Suck It Up! Posted by Dave Muxo on
A Book - from The Crystal Prison Posted by Dave Muxo on
Is It a Song or a Poem? Posted by Dave Muxo on

The date that the entry was created is not shown. When I use inspect on the page I see that the entry giving the time is there:

<span class="serendipity_byline block_level">
<span class="single_user">Posted by <a href="https://dnmuxo.com/blog/index.php?
/authors/3-Dave-Muxo">Dave Muxo</a> on
</span>
<time datetime="2020-11-14T12:06:00+00:00"></time>
</span>

I have tried to find CSS for class "serendipity_byline_block_level" to make sure a text color is set, but I can't find it in any css. So I created an entry in blue.css as follows:

.serendipity_byline_block_level { color:black; }

I still see no time on the screen, so I have to think that the code is not working. But I can't find that code either.

Anyone know where that code is? Or how I can contact the theme developer?
onli
Regular
Posts: 2822
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Time not displaying

Post by onli »

Code: Select all

<time datetime="2020-11-14T12:06:00+00:00"></time>
This is actually invisible. See, you that the datetime attiribute, but that's just meta information. To make it visibile it would have to look like this:

Code: Select all

<time datetime="2020-11-14T12:06:00+00:00">14.11.2020</time>
Or in whichever way you want to format the timestamp. For that you would have to edit your themes template file. Do you know which one provides that time tag?
dnmuxo
Posts: 2
Joined: Thu Nov 19, 2020 4:23 am

Re: Time not displaying

Post by dnmuxo »

Thank you for your answer. No, I don't know where to find that.
onli
Regular
Posts: 2822
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Time not displaying

Post by onli »

That's actually taken from the 2k11 theme. So it is under themes/2k11/entries_summary.tpl.

But it's misleading, because I know realize we should fix this differently. The coffee-bar-theme is missing the right config option to format the date. You can add it. I'll break it down.

0. Make a backup of the file themes/coffee_bar/config.inc.php
1. Open the file themes/coffee_bar/config.inc.php with an editor
2. Line 3 has the content:

Code: Select all

$template_config = array(
replace it with:

Code: Select all

$template_config = array(
array(
        'var' => 'date_format',
        'name' => GENERAL_PLUGIN_DATEFORMAT . " (http://php.net/strftime)",
        'type' => 'select',
        'default' => DATE_FORMAT_ENTRY,
        'select_values' => array(DATE_FORMAT_ENTRY => DATE_FORMAT_ENTRY,
                                '%A, %e. %B %Y' => '%A, %e. %B %Y',
                                '%a, %e. %B %Y' => '%a, %e. %B %Y',
                                '%e. %B %Y' => '%e. %B %Y',
                                '%d.%m.%y' => '%d.%m.%y',
                                '%d.%m.%Y' => '%d.%m.%Y',
                                '%A, %m/%d/%Y' => '%A, %m/%d/%Y',
                                '%a, %m/%d/%y' => '%a, %m/%d/%y',
                                '%m/%d/%y' => '%m/%d/%y',
                                '%m/%d/%Y' => '%m/%d/%Y',
                                '%Y-%m-%d' => '%Y-%m-%d')
    ),
So you are adding that config option before the colorscheme option.
3. Save the file and exit.
4. In Serendipity, in your admin backend, go to the themes configuration.
5. Save the configuration.

Now the date should appear.
Post Reply