2

I would like to display the tags at the top of the article but the author at the bottom. One way to do that would be to tweak the split option for Position of Article Info in Article Manager Options, because it displays the tags below and the author above (I would just have to find the .php doing this and exchange the code for tags and author).

● If you think this is the best way to do it, where is this php?

● If you think there is a better way to do what I want, how could I do it?

I looked into templates\proto\html\com_content\article\default.php (or to be accurate, an override of this file) but I could find a code setting up the position of article info.

1 Answer 1

3

Set position of info above to keep tags in that position and make an override of com_content/views/article/tmpl/default.php with this changes:

Line 76 - remove or comment this statement:

echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'above'));

in this way the view will not load author and other info in this position

Add statement to print author where you want to display it with this code:

echo JLayoutHelper::render('joomla.content.info_block.author', array('item' => $this->item, 'params' => $params, 'position' => 'below'));

JLayoutHelper refers to the file path of the first parameter, in this case refers to /layouts/joomla/content/info_block/author.php

Anyway it's better to use an override instead of editing core files.

3
  • Thanks for this! Yes it worked!However, I use a plugin (Disqus by JW) which is loaded just below <div itemprop="articleBody"><?php echo $this->item->text; ?>. Even if I move your statement just below this piece of code (around line 118), I still get my author name below the plugin. How can I modify my default.php override to get my article, then my author and then my plugin? Thanks a lot!
    – MagTun
    Mar 29, 2016 at 18:11
  • 1
    Make an override of /plugins/content/jw_disqus/jw_disqus/tmpl/article.php in your template folder /html/jw_disqus/article.php. In this file echo $row->text actually prints the article content, so just add the statement to show the article's author where you need (replacing $this->item with $row): echo JLayoutHelper::render('joomla.content.info_block.author', array('item' => $row, 'params' => $params, 'position' => 'below'));
    – Kitase88
    Mar 30, 2016 at 7:22
  • 1
    Thanks you so much! I have ask the same question here: joomla.stackexchange.com/questions/15915/… so you can share your answer.
    – MagTun
    Mar 30, 2016 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.