Author block on article page

For Joomla! 5.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
kalixo
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sat Jan 24, 2015 4:19 pm

Author block on article page

Post by kalixo » Tue Feb 20, 2024 8:25 am

Hi,
I would like to change the position of Author block on my article page, but I can't find it in default.php. I realised that this is generated by content plugin event "onContentAfterDisplay" but I cant find any php file related to this.
Can you please guide me, where can I find php code for Author module generated by "onContentAfterDisplay"?
thank you!

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17411
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Author block on article page

Post by toivo » Tue Feb 20, 2024 8:47 am

Do you mean the block starting with the heading Details, followed by the author's name, the category, the date and the number of hits?

Go to the first tab in Articles - Options and locate 'Position of Article Info'. The selections in the dropdown are Above, Below and Split.
Toivo Talikka, Global Moderator

kalixo
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sat Jan 24, 2015 4:19 pm

Re: Author block on article page

Post by kalixo » Tue Feb 20, 2024 9:44 am

hi Toivo, thank you, but not exaclty.

at the end of the article there's a part with extra fields and author info.
in the default.php (\com_content\tmpl\article\) there is no code responsible for generating extra fields and author info. I realised that the last lines of this file are refering to it:

<?php // Content is generated by content plugin event "onContentAfterDisplay" ?>
<?php echo $this->item->event->afterDisplayContent; ?>

so, I was looking for a "plugin event "onContentAfterDisplay"" , but I couldn't. As I understand, in this plugin event I will find a code responsible for extra fields and author info.

best

kalixo
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sat Jan 24, 2015 4:19 pm

Content is generated by content plugin event onContentAfterDisplay

Post by kalixo » Wed Feb 21, 2024 7:45 pm

Hi,
I wanted to modify some of php code related to "fields " and "author" but I realized that in the article and category page it is not placed in the php file. It is generated by a plugins:

<?php // Content is generated by content plugin event "onContentAfterTitle"
?>
<?php echo $this->item->event->afterDisplayTitle; ?>
<?php endif; ?>

<?php // Content is generated by content plugin event "onContentBeforeDisplay"
?>
<?php echo $this->item->event->beforeDisplayContent; ?>

Can you please guide me where to find these plugins?

thank you in advance!
best
Last edited by toivo on Thu Feb 22, 2024 3:45 am, edited 2 times in total.
Reason: mod note: moved from 5.x General Questions, merged with the current topic

User avatar
Pavel-ww
Joomla! Ace
Joomla! Ace
Posts: 1607
Joined: Tue Jun 30, 2020 12:17 pm

Re: Content is generated by content plugin event onContentAfterDisplay

Post by Pavel-ww » Thu Feb 22, 2024 7:33 am

kalixo wrote:
Wed Feb 21, 2024 7:45 pm
I wanted to modify some of php code related to "fields " and "author" but I realized that in the article and category page it is not placed in the php file. It is generated by a plugins:
Hi. In 90% of cases, it is enough to use only CSS to change the appearance or layout. Describe what you want to change, provide a screenshot and link to the page

kalixo
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sat Jan 24, 2015 4:19 pm

Re: Author block on article page

Post by kalixo » Sat Feb 24, 2024 9:01 pm

hi, thank you but not in this case.

In my fronted, in an article page I have:
<div class=card text-white bg-success mb-3">...
<div class="card-header">..
<div class="card-body">..
<div class="author-block author-block-post-detail pos-after-content">... <--- THIS IS AUTHOR BLOCK
...
<ul class="fields-container">... <--- THIS IS ARTICLE FIELD
...
everything above is generated by <?php echo $this->item->event->afterDisplayContent; ?> in article/default.php.

What I want to do, is to move "author-block" (<div class="author-block author-block-post-detail pos-after-content">) from the "card text-white bg-success mb-3". I can't do it iny CSS and I cant find any code with "ul class="fields-container". 🙁

best regards

User avatar
Pavel-ww
Joomla! Ace
Joomla! Ace
Posts: 1607
Joined: Tue Jun 30, 2020 12:17 pm

Re: Author block on article page

Post by Pavel-ww » Sun Feb 25, 2024 6:58 am

kalixo wrote:
Sat Feb 24, 2024 9:01 pm
<div class=card text-white bg-success mb-3">...
<div class="card-header">..
<div class="card-body">..
<div class="author-block author-block-post-detail pos-after-content">... <--- THIS IS AUTHOR BLOCK
...
<ul class="fields-container">... <--- THIS IS ARTICLE FIELD
...
Hi. This code is not typical for the article. Are you sure you are talking about the article?

---

kalixo wrote:
Sat Feb 24, 2024 9:01 pm
What I want to do, is to move "author-block" (<div class="author-block author-block-post-detail pos-after-content">) from the "card text-white bg-success mb-3". I can't do it iny CSS and I cant find any code with "ul class="fields-container". 🙁
And from the "card text-white bg-success mb-3" ... to where?

Just provide a link to the page

kalixo
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sat Jan 24, 2015 4:19 pm

Re: Author block on article page

Post by kalixo » Sun Feb 25, 2024 5:22 pm

hi,
thank you for your help! let me answer your questions:
"i. This code is not typical for the article. Are you sure you are talking about the article?" - yes it is. Purity VI template: https://www.joomlart.com/documentation/ ... -purity-iv

"And from the "card text-white bg-success mb-3" ... to where?"
to the bottom of the whole page, under under the fields, before the tags.

webstie is still under the development.
link to an article:
https:// darmolandia.pl /test-finish-za-darmo-zwrot-pieniedzy

best

User avatar
Pavel-ww
Joomla! Ace
Joomla! Ace
Posts: 1607
Joined: Tue Jun 30, 2020 12:17 pm

Re: Author block on article page

Post by Pavel-ww » Mon Feb 26, 2024 7:05 am

kalixo wrote:
Sun Feb 25, 2024 5:22 pm
Purity VI template
Hi. You should mention this from the very beginning. If you use this template, then you should look at its documentation or contact its support with your questions. Since this template has its own overrides from the box differing from standard layouts supplied with Joomla.

Or wait for someone who knows this template.

As for the onContentAfterDisplay event, read the documentation on plugin events in Joomla https://docs.joomla.org/Plugin/Events. I suppose you do not understand this correctly.

kalixo
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sat Jan 24, 2015 4:19 pm

Re: Author block on article page

Post by kalixo » Sat Mar 02, 2024 8:52 pm

hi,
ok, will do. What about fields? Fields are also overwritten by the template?

Right now, I see in my default.php (com_content/article):
<div class="card-body"><?php echo $this->item->event->afterDisplayContent; ?></div>
and in code of generated page:

<div class="card-body">
<div class="author-block author-block-post-detail pos-after-content">
[...] </div>
<ul class="fields-container">
[...]</ul></div>

I would like to add extra div before <ul class="fields-container"> and move it before <div class="author-block author-block-post-detail pos-after-content">
how can I do it?

best


Post Reply

Return to “Joomla! 5.x Coding”