Hiding category description on new pages

Discuss Search Engine Optimization in relation to Joomla! 3.x. This forum will also have discussions on SEF/SEO Joomla! 3.x extensions.

Moderator: 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.
Post Reply
alex126
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Wed Aug 24, 2011 3:01 pm

Hiding category description on new pages

Post by alex126 » Wed Jul 25, 2018 11:21 am

Hi all,

In the newest version of Joomla I am looking for a way to hide the category description on subsequent pages: https://beleggen.info/aandelen/ and then for example https://beleggen.info/aandelen/pagina-2 to prevent duplicate content and to increase the usability of the website.

Is there a way to achieve this?

Thanks!

User avatar
enginetemplates
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Tue Apr 18, 2017 7:42 am
Location: US
Contact:

Re: Hiding category description on new pages

Post by enginetemplates » Sat Aug 04, 2018 3:34 pm

Hi,

You can try to find hide category desc option via details of menu item, or just add more CSS to hide it

body.isblog .description {
display: none;
}
Kelvin - just a big fan of Joomla! CMS.
https://enginetemplates.com/free-joomla-templates/ <= Free Joomla 3 templates.
http://demo.enginetemplates.com/ <= Joomla! templates Live Demo preview
^Working with Joomla! 3.x and Joomla! 4.x

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 24867
Joined: Mon Oct 27, 2008 9:27 pm
Location: Akershus, Norway

Re: Hiding category description on new pages

Post by Per Yngve Berg » Sat Aug 04, 2018 4:03 pm

With what Menu Item Type?

EugeneHill
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Aug 06, 2018 10:43 am

Re: Hiding category description on new pages

Post by EugeneHill » Mon Aug 06, 2018 11:03 am

Hey you can try with this one!
This code has been
.page-header-module .row .col-sm-6 p {
display: none;
}

alex126
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Wed Aug 24, 2011 3:01 pm

Re: Hiding category description on new pages

Post by alex126 » Sat Aug 18, 2018 8:18 pm

I am trying to only hide the description on page 2, page 3 etc. not on the first one. Will this work with this code?

Where should I add this code?

User avatar
digitalkube
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Sat Aug 11, 2018 6:32 pm
Location: India
Contact:

Re: Hiding category description on new pages

Post by digitalkube » Sun Aug 19, 2018 8:10 am

The simplest way to do so is by adding

Code: Select all

display: none;
to the CSS class of the element that you want to hide. Simple!

alex126
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Wed Aug 24, 2011 3:01 pm

Re: Hiding category description on new pages

Post by alex126 » Sun Aug 19, 2018 10:35 am

But where exactly should I add this display: none; when I want to hide it on subsequent category pages?

SharkyKZ
Joomla! Ace
Joomla! Ace
Posts: 1252
Joined: Fri Jul 05, 2013 10:35 am
Location: Unknown

Re: Hiding category description on new pages

Post by SharkyKZ » Sun Aug 19, 2018 11:10 am

You shouldn't use CSS for this. Create a category template override and check if it's the first page. If using com_content, change this:

Code: Select all

<?php if ($this->params->get('show_description') && $this->category->description) : ?>
	<?php echo JHtml::_('content.prepare', $this->category->description, '', 'com_content.category'); ?>
<?php endif; ?>
to this:

Code: Select all

<?php if (!JFactory::getApplication()->input->get('start') && $this->params->get('show_description') && $this->category->description) : ?>
	<?php echo JHtml::_('content.prepare', $this->category->description, '', 'com_content.category'); ?>
<?php endif; ?>

annahersh
Joomla! Explorer
Joomla! Explorer
Posts: 270
Joined: Wed Aug 15, 2018 8:23 pm

Re: Hiding category description on new pages

Post by annahersh » Sun Aug 19, 2018 5:24 pm

Since your concern is search penalties, the method provided by sharkykz will be best since it entirely removes the text from the subsequent pages.

Many SEM experts have stated that search engines read text in hidden elements so the css method with display:none property may fail.

alex126
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Wed Aug 24, 2011 3:01 pm

Re: Hiding category description on new pages

Post by alex126 » Mon Aug 20, 2018 6:15 pm

Thanks for the advice! In com_content for the category files I only see this in the php though:

<?php
/**
* @package yoo_sync
* @author YOOtheme http://www.yootheme.com
* @copyright Copyright (C) YOOtheme GmbH
* @license http://www.gnu.org/licenses/gpl.html GNU/GPL
*/

// include config and layout
$base = dirname(dirname(dirname(__FILE__)));
include($base.'/config.php');
include($warp['path']->path('layouts:'.preg_replace('/'.preg_quote($base, '/').'/', '', __FILE__, 1)));

Where exactly should I add this code?

annahersh
Joomla! Explorer
Joomla! Explorer
Posts: 270
Joined: Wed Aug 15, 2018 8:23 pm

Re: Hiding category description on new pages

Post by annahersh » Wed Aug 22, 2018 1:57 am

Don't edit the core com_content files. Use the Joomla template override creator. It is in your default template's manager view.
Extensions > Templates > Templates
Click the name of your default template
Click the tab labeled Create Overrides
Click com_content to open
Click category to create the override files

Once the files are created, in the left column click HTML > com_content > category
Click blog.php to open the editor then look for the lines indicated by sharkykz

alex126
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Wed Aug 24, 2011 3:01 pm

Re: Hiding category description on new pages

Post by alex126 » Wed Aug 22, 2018 3:37 pm

I followed these steps, however, I could only see these lines in this specific file:

<?php
/**
* @package yoo_sync
* @author YOOtheme http://www.yootheme.com
* @copyright Copyright (C) YOOtheme GmbH
* @license http://www.gnu.org/licenses/gpl.html GNU/GPL
*/

// include config and layout
$base = dirname(dirname(dirname(__FILE__)));
include($base.'/config.php');
include($warp['path']->path('layouts:'.preg_replace('/'.preg_quote($base, '/').'/', '', __FILE__, 1)));

alex126
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Wed Aug 24, 2011 3:01 pm

Re: Hiding category description on new pages

Post by alex126 » Tue Sep 18, 2018 2:28 pm

Does anyone know what goes wrong :)

SharkyKZ
Joomla! Ace
Joomla! Ace
Posts: 1252
Joined: Fri Jul 05, 2013 10:35 am
Location: Unknown

Re: Hiding category description on new pages

Post by SharkyKZ » Tue Sep 18, 2018 3:25 pm

Which file is that?

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 24867
Joined: Mon Oct 27, 2008 9:27 pm
Location: Akershus, Norway

Re: Hiding category description on new pages

Post by Per Yngve Berg » Tue Sep 18, 2018 3:31 pm

You have a template from YOOtheme that already contains overrides.

alex126
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Wed Aug 24, 2011 3:01 pm

Re: Hiding category description on new pages

Post by alex126 » Wed Sep 19, 2018 12:05 am

Yes, I did change some css files. But how does this relate to changing the category text on the first page?

marinkaas
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Thu Jul 19, 2018 6:56 pm

Re: Hiding category description on new pages

Post by marinkaas » Wed Sep 19, 2018 9:36 am

alex126 wrote:
Wed Jul 25, 2018 11:21 am
Hi all,

In the newest version of Joomla I am looking for a way to hide the category description on subsequent pages: https://beleggen.info/aandelen/ and then for example https://beleggen.info/aandelen/pagina-2 to prevent duplicate content and to increase the usability of the website.
https://mobi-prawnik.pl/2017/12/14/obow ... -chodnika/
Is there a way to achieve this?

Thanks!

Remember to turn these categories off in robots.txt

Disallow: / category

alex126
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Wed Aug 24, 2011 3:01 pm

Re: Hiding category description on new pages

Post by alex126 » Wed Sep 19, 2018 11:40 am

I am looking for a way to only display the intro text on the first page of a category. So on https://beleggen.info/aandelen/ but not on https://beleggen.info/aandelen/pagina-2 and so on.

alex126
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Wed Aug 24, 2011 3:01 pm

Re: Hiding category description on new pages

Post by alex126 » Wed Sep 19, 2018 12:28 pm

I am aware an override should be best, but how can I apply this?

User avatar
Jaydot
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 204
Joined: Sun Jun 04, 2017 12:11 pm
Location: The Netherlands
Contact:

Re: Hiding category description on new pages

Post by Jaydot » Wed Sep 19, 2018 12:40 pm

Why not use a "sticky" article instead of the category description?
(I believe the simplest way to do this is give it a creation date in the far future, and order the articles by creation date).
The fact that an opinion is widely held is no evidence whatsoever that it is not utterly absurd.
Personal website: https://jaydot.nl

alex126
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Wed Aug 24, 2011 3:01 pm

Re: Hiding category description on new pages

Post by alex126 » Wed Sep 19, 2018 12:45 pm

Hmm that might be an interesting solution! Is it possible however to only display the first article in full and then not do this on subsequent pages. Otherwise the problem would not be solved.

User avatar
Jaydot
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 204
Joined: Sun Jun 04, 2017 12:11 pm
Location: The Netherlands
Contact:

Re: Hiding category description on new pages

Post by Jaydot » Wed Sep 19, 2018 12:50 pm

Don't put a "read more" in the article :) (If I understand your question correctly)
The fact that an opinion is widely held is no evidence whatsoever that it is not utterly absurd.
Personal website: https://jaydot.nl


Post Reply

Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 3.x”