VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: confectionery on May 08, 2020, 16:05:29 PM

Title: How To hide category TITLE in virtuemart 3.6.10 JOOMLA
Post by: confectionery on May 08, 2020, 16:05:29 PM
Hi
can anybody shed some light on how to hide the category title.  I am currently using joomla v.9.1 an virtuemart 3.6.10. My website is not live yet. For the life of me I cannot find where to hide the title.
can anybody help? Just in case I have confused myself, i have attached an image of what I would like to remove.
much appreciated
Title: Re: How To hide category TITLE in virtuemart 3.6.10 JOOMLA
Post by: pinochico on May 08, 2020, 16:16:27 PM
It looks like the h1 caption from the menu and not the category caption.

I adjust it by setting the menu item or using the override in the template:

templates / OUR_TEMPLATE / html / com_virtuemart / category / default.php
Title: Re: How To hide category TITLE in virtuemart 3.6.10 JOOMLA
Post by: GJC Web Design on May 08, 2020, 16:18:51 PM
either remove it in an over ridden template file or hide it by css

over ride then remove

components\com_virtuemart\views\category\tmpl\default.php

<?php if (!empty($this->category->category_name)) { ?>
<h1><?php echo vmText::_($this->category->category_name); ?></h1>
<?php } ?>

or hide

.browse-view h1 {
display:none;
}
Title: Re: How To hide category TITLE in virtuemart 3.6.10 JOOMLA
Post by: confectionery on May 08, 2020, 16:23:25 PM
Thank you for the quick response. Trust me to get it wrong :)
will give both bash
tks
Title: Re: How To hide category TITLE in virtuemart 3.6.10 JOOMLA
Post by: confectionery on May 08, 2020, 16:32:16 PM
 :(sadly the easy menu option did not work
Title: Re: How To hide category TITLE in virtuemart 3.6.10 JOOMLA
Post by: pinochico on May 08, 2020, 16:40:37 PM
I'm sorry, but I don't have enough information from you to continue.

It will definitely help
- attach a code listing using the Inspect Element
- attach the settings of the Preventions Pack menu item
- list files in your template / html / com_virtuemart / category folder if any
Title: Re: How To hide category TITLE in virtuemart 3.6.10 JOOMLA
Post by: confectionery on May 08, 2020, 16:58:21 PM
Thank you for spending time on this. You kinda lost me on the last request... :) but attached is what I understood
Title: Re: How To hide category TITLE in virtuemart 3.6.10 JOOMLA
Post by: pinochico on May 08, 2020, 17:52:53 PM
Im not lost :)

You didn't do what I or GJC wrote.


In addition, I see on pdf hidden important information - you are using the HELIX framework and as you can see on the menu item it uses its own TAB to set the Helix Page Title

1. Create an override according to the rules of creating a Joomla override view:
https://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core

and create it for the file
components \ com_virtuemart \ views \ category \ tmpl \ default.php

-> place in a folder

templates / OUR_TEMPLATE / html / com_virtuemart / category / default.php

NOT IMPLEMENTED

2. Edit the line in the code and comment out the H1 view in the category view default template
(as I sent in the attachment)

NOT IMPLEMENTED

avoid displaying H1 title, but you will have bad SEO (every page must have H1) But that was not your request.

3. Check the menu item and TAB Helix Page Title settings (I don't know setup for this TAB).
Title: Re: How To hide category TITLE in virtuemart 3.6.10 JOOMLA
Post by: pinochico on May 08, 2020, 18:11:23 PM
Quoteattach a code listing using the Inspect Element

The H1 is calling from category template Default.
There is nothing for setup from VM admin configuration.

Only



if (!empty($this->products)) { // if exist any products in this category
?>
<div class="orderby-displaynumber">
<div class="pull-left vm-order-list">
<?php echo $this->orderByList['orderby']; ?>
<?php //echo $this->orderByList['manufacturer']; ?>
</div>

<div class="pull-right display-number"><span class="hidden-sm hidden-xs"><?php echo $this->vmPagination->getResultsCounter ();?></span><?php // echo $this->vmPagination->getLimitBox ($this->category->limit_list_step); ?></div>


<div class="clearfix"></div>
</div> <!-- end of orderby-displaynumber -->

<?php // Then show Category name as H1 ?>
<h1><?php echo vmText::_($this->category->category_name); ?></h1>
<?php ?>


You must comment this line as I wrote or send in attachment
Title: Re: How To hide category TITLE in virtuemart 3.6.10 JOOMLA
Post by: Studio 42 on May 08, 2020, 22:29:42 PM
confety, you should not remove the H1 if you have not another one in this page because SEO.
Better add some css if it's too big.
Title: Re: How To hide category TITLE in virtuemart 3.6.10 JOOMLA
Post by: pinochico on May 08, 2020, 22:54:34 PM
patrick:
Quoteconfety, you should not remove the H1 if you have not another one in this page because SEO.

Thank you Patrick, you're right, just as I wrote before.


If you remove H1, you will create bad SEO for this site. For proper SEO, you can use several ways.

Ffor example, instead of the name of the category, which you can hide with php or css, you can make the name of the menu item visible.
Or you can use a module to display your own name (for example, from Joomlart - MassHead Module or from MiniJoomla - VM Category Title Module.)

I think there would be other options, depending on why you want to hide the category name.
Title: Re: How To hide category TITLE in virtuemart 3.6.10 JOOMLA
Post by: confectionery on May 10, 2020, 07:26:16 AM
Hi Guys, thank you both for the detailed help and steps.

I did do some if them and then undid.it when I thought it did not work. But I clearly did not.read it properly. Sorry about that.

So if I understand correctly. If I hide the h1, it will affect my so. Perhaps then I should just make it a lot smaller an I did not like the position, it would have been better if it was above the description

Once again a big thank you
Title: Re: How To hide category TITLE in virtuemart 3.6.10 JOOMLA
Post by: AH on May 10, 2020, 09:48:34 AM
So yes - just move it above description and change size using CSS

<h1><?php echo vmText::_($this->category->category_name); ?></h1>


You should be able to target specifically the category description <h1> in css so that all other pages are unchanged