VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: bestcons on March 12, 2021, 07:32:11 AM

Title: Change Header position
Post by: bestcons on March 12, 2021, 07:32:11 AM
Our Historical Society website presents large amounts of Photo's as Articles (amongst others). We have made a top-category Photo's, sub-categories such as Schools and sub-sub categories for named schools such as Medlerschool (See attachments of screen images).
Unfortunately the lay-out of the various categories differ and we have not been able in the VM Configuration to position the (sub)-category names as Headers on top and the Navigation as trailers.
We use Joomla 3.9.25 and VM 3.8.8.
Please advice.
Title: Re: Change Header position
Post by: pinochico on March 12, 2021, 08:15:54 AM
Quotewe have not been able in the VM Configuration to position the (sub)-category names as Headers

Yes, you can but not in admin -  in PHP file for category layout - move manually.
Title: Re: Change Header position
Post by: bestcons on March 12, 2021, 16:02:22 PM
I am able to change in php, but only if someone else is so kind to describe the recipe.
Title: Re: Change Header position
Post by: pinochico on March 12, 2021, 16:03:58 PM
then you have to send image with ecactly position :)
Title: Re: Change Header position
Post by: bestcons on March 12, 2021, 16:20:26 PM
You can see this in red on the 3 attachments. Thank you, don't hesitate if you need more information.
Title: Re: Change Header position
Post by: GJC Web Design on March 12, 2021, 16:26:33 PM
if your template is reasonably std. then the header is

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

so move the

// Show child categories
if ($this->showcategory and empty($this->keyword)) {
   if (!empty($this->category->haschildren)) {
      echo ShopFunctionsF::renderVmSubLayout('categories',array('categories'=>$this->category->children, 'categories_per_row'=>$this->categories_per_row));
   }
}

below that

same for the clearly commented search block

templates\YOURTEMPLATE\html\com_virtuemart\category\default.php
Title: Re: Change Header position
Post by: bestcons on March 12, 2021, 21:20:26 PM
Unfortunately
<?php if (!empty($this->category->category_name)) { ?>
<h1><?php echo vmText::_($this->category->category_name); ?></h1>
<?php } ?>
was not found in the default.php of the template. The file is attached.