News:

Support the VirtueMart project and become a member

Main Menu

Parent Category as Title in the categories view

Started by cat1910, May 30, 2017, 09:36:03 AM

Previous topic - Next topic

cat1910

Is it possible to show the parent category as the title (h1) of the page in the pages that display the different categories of a parent category ?
I can't find it.
Joomla 3.7.2 / Virtuemart 3.2.2

Thanks!
Catherine

jenkinhill

See http://demo.virtuemart.net/wear  - the parent category title is shown under the search/sort block using this code:
<h1><?php echo vmText::_($this->category->category_name); ?></h1>

If you want to move the locateion then edit and override components/com_virtuemart/views/category/tmpl/default.php - or if already using overrides then edit the relevant override file.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

cat1910


marvays

Quote from: jenkinhill on May 30, 2017, 12:55:20 PM
See http://demo.virtuemart.net/wear  - the parent category title is shown under the search/sort block using this code:
<h1><?php echo vmText::_($this->category->category_name); ?></h1>

If you want to move the locateion then edit and override components/com_virtuemart/views/category/tmpl/default.php - or if already using overrides then edit the relevant override file.

Holla. This solution dont work on J4 and VM4. Can you help me?
I oweride /templates/my_template/html/com_virtuemart/sublayouts/categories.php
<div class="category-view">
<?php if (!empty($this->category->category_name)) { ?>
<h1><?php echo vmText::_($this->category->category_name); ?></h1>
<?php ?>
......


error: Using $this when not in object context


GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

jenkinhill

Quote from: marvays on October 14, 2022, 07:32:09 AM

Holla. This solution dont work on J4 and VM4. Can you help me?


I'm not surprised. That "fix" was posted for versions over 5 years ago!
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum