article header date and author image

GK User
Fri Feb 24, 2017 4:30 pm
Can you explain how to edit the article header info.
Right now it's like this
Screen Shot 2017-02-24 at 16.27.22.png

(without the year).
I would like to change to your header style...
Screen-Shot-2017-02-24-at-16.19.44.jpg

Where can this be done.

Thanks,
Pas
User avatar
Gold Boarder

teitbite
Mon Feb 27, 2017 2:54 pm
Hi

Depending from what article system You are using it can be done by modyfying a line /html/com_content/article/default.php or /html/com_k2/templates/default/item.php Both in template's folder.
User avatar
Moderator

GK User
Mon Feb 27, 2017 5:32 pm
Thank you,
I'm using regular joomla articles.
So in this I will see the date layout as used in University?

Thanks,
Pascal
User avatar
Gold Boarder

teitbite
Wed Mar 01, 2017 11:52 am
Hi

Yes, a code for date is between line 102 and 112 in file /html/com_content/article/default.php:

Code: Select all
                    <?php if($params->get('show_publish_date')) : ?>
                    <time datetime="<?php echo JHtml::_('date', $this->item->publish_up, JText::_(DATE_W3C)); ?>">
                       <?php echo JHTML::_('date', $this->item->publish_up, JText::_('D')); ?>
                       <small><?php echo JHTML::_('date', $this->item->publish_up, JText::_('M j')); ?></small>
                    </time>
                    <?php elseif($params->get('show_create_date')) : ?>
                    <time datetime="<?php echo JHtml::_('date', $this->item->created, DATE_W3C); ?>" itemprop="dateCreated">
                       <?php echo JHTML::_('date', $this->item->created, JText::_('D')); ?>
                       <small><?php echo JHTML::_('date', $this->item->created, JText::_('M j')); ?></small>
                    </time>
                    <?php endif; ?>


two pieces of the code depending from selection if You wish to see creation or published date.
User avatar
Moderator

GK User
Wed Mar 01, 2017 11:56 am
Hi Teitbite,
Thank you, but i guess it's not possible to show 'author image' with regular joomla...it's only K2?
Want same gavick style as you use.

Thanks,

Pascal
User avatar
Gold Boarder

teitbite
Thu Mar 02, 2017 2:01 pm
Hi

Oh yes, You are right. Regular joomla articles does not support user avatars, so it would need to be conversed to K2.

But what is the status of Your site. If authors will be static than maybe we can use some other solution like posting author's image from Gravatar website based on author's email?
User avatar
Moderator

GK User
Thu Mar 02, 2017 3:17 pm
There are 3 people writing articles, right now they add their image, name and function at the end of every article.
Would be nice to do this based on author. All (small photo + name + date dd-mm-yyyy: hh:mm) at the top of an article.
It's at the same site as the other topic. I send you login via email.

Regards,
Pascal
User avatar
Gold Boarder

teitbite
Mon Mar 06, 2017 10:35 am
Hi

Ok. I got the idea how this can be done. I'll load an image based on user ID. All You will have to do is to put images in joomla images folder /images/authors/ and name them for example 123.jpg

For that I definitely need FTP access, same as I asked in Your other thread, so waiting for that.
User avatar
Moderator

GK User
Mon Mar 06, 2017 10:59 am
Hi Just send you the ftp info by email.
Hope this can be solved soon.
Regards,
Pascal
User avatar
Gold Boarder

teitbite
Thu Mar 09, 2017 12:48 pm
Hi

After logging in to ftp I see no files at all. I think my ftp user privileges are not heigh enough. Can You please fix that ?
User avatar
Moderator

GK User
Thu Mar 09, 2017 2:02 pm
Just send you a new login, tested and is ok.
Thanks.
Pascal
User avatar
Gold Boarder

teitbite
Tue Mar 14, 2017 6:55 pm
Hi

So sorry for delay. It was considered as custom job, so I had to wait with it till I'll have some free time.

I've added this code to /html/com_content/article/default.php

Code: Select all
<div class="author_avatar"><img src="images/authors/<?php print $this->item->created_by; ?>.jpg" title="<?php print $this->item->author; ?>" alt="<?php print $this->item->author; ?>" /></div>


And this code to /css/override.css

Code: Select all
.author_avatar {
    float: left;
    margin: 0 20px 10px 0;
    width: 75px;
}


Now You need to check authors ID and add images named as example "548.jpg" to /images/authors/ (from root joomla).
User avatar
Moderator

GK User
Wed Mar 15, 2017 4:20 pm
Hello Teitbite,
Thank you, works perfect. Guess it can also be added to category and blog view?
Should this also work after updates?

Thanks,

Pascal
User avatar
Gold Boarder

teitbite
Sat Mar 18, 2017 1:42 pm
Hi

I do not think this will get updated, but it's better to keep this separated because this file will be overwritten.

Yes it will work with category view, but I'm not sure about blog view. Is it still using regular joomla articles ?
User avatar
Moderator

GK User
Mon Mar 20, 2017 12:38 pm
Hi,
I'll save this as a copy.
Yes, using regular category and blog view for all content.
Also noticed I can't disable author image at separate pages if I want? is it possible?

Regards,
Pascal
User avatar
Gold Boarder

GK User
Wed Mar 22, 2017 12:30 am
Hi Teitbite,
I added the code to /html/com_content/category/blog_item.php (line31)
I shows on blog pages also, but how can I configure this to be set 'on' or 'off' in page- or catagory settings.
Should I add some php code like ....if 'show_author' = 'no'.. then 'blank' (in correct php language)

Thanks,
Pascal
User avatar
Gold Boarder

teitbite
Fri Mar 24, 2017 2:01 pm
Hi

It's not a standard option, so it's hardcodded at the moment. I guess You can use "show_author" attribute to enable/disable it. You should have mention it earlier :)

Code: Select all
<?php if ($this->params->get('show_author') == 1) :?>
<div class="author_avatar"><img src="images/authors/<?php print $this->item->created_by; ?>.jpg" title="<?php print $this->item->author; ?>" alt="<?php print $this->item->author; ?>" /></div>
<?php endif; ?>
User avatar
Moderator

GK User
Thu Mar 30, 2017 8:36 am
Hi Teitbite,
Many thanks for the support. All works fine now.

Regards,
Pascal
User avatar
Gold Boarder

teitbite
Mon Apr 03, 2017 10:04 am
Hi
Glad I could help.
---
If You were satisfied with our support please let other users know on Twitter: http://twitter.com/gavickpro or Facebook: http://www.facebook.com/gavickpro
User avatar
Moderator


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.