3

Is it possible to display details information (author, create date, ...) in the articles but hide it in the blog page (with multiple articles)?

I noticed that if I create a Home menu with the Category Blog type and hide all the details in the blog then these detailes are hidden in the articles too when I open them. If I move the Home menu say to the second position the details are shown/hidden correctly (hidden in the blog, shown in the single articles).

Is it a bug?

2 Answers 2

2

Probably not, you don't really give all the necessary information, though.

The article links in the blog view are just that: links to the articles. If your blog view menu item is the first menu item that shows the correct category, that is used with its hide details settings. If before that you have another menu item that can show the article its settings are used instead.

Normally this is done with a separate menu that isn't assigned to any module and doesn't do anything except provide overrides to how articles are shown. In addition to content component settings these hidden menus can also be assigned modules, template styles, and plug-ins, so you can fully configure how the articles are shown.

0
1

I achieve this by editing template's PHP code. I'm using Joomla 4 with default Cassiopeia template. I will use 'category` as an example. i.e., I want 'category' to be shown in a single article, but not shown in blog category. You can apply this method to other details (like 'Published date', 'Hits', etc) as well.

  1. Login administration page, click System at the left side-bar.
  2. Click Site templates.
  3. Click Cassiopeia Details and Files.
  4. Click Create overrides.
  5. Click joomla at the Layouts column. This will expand that directory. Then click content. You can see a successful hint.
  6. Click Editor, navigate to the directory you just created, namely templates/cassiopeia/html/layouts/joomla/content.
  7. Click info_block.php under this directory to edit it.
  8. In the first PHP code block, add one line of code: $isCategoryView = JFactory::getApplication()->input->get('view') == 'category';. The variable $isCategoryView represents whether current view is 'category'.
  9. Find this line with a if-sentence <?php if ($displayData['params']->get('show_category')) : ?>. Add an additional condition to this 'if', makes it <?php if ($displayData['params']->get('show_category') && !$isCategoryView) : ?>.

Thanks to this answer at the Stack Overflow.

Your Answer

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

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