Magento2 Multiple Category Layouts - php

How do you have a completely different look for each category in magento 2 (custom category layouts), in magento 1.* I know you could change the template either checking for the page layout or changing the template in the custom layout update via xml however magento 2 doesn't let you change templates in here?
I tried following http://www.magestore.com/magento-2-tutorial/how-to-design-a-custom-magento-2-category-page-template/ but didn't really understand how it worked.
Magento 2 seems much more difficult to get my head around than the previous version so any help is greatly appreciated.

You need to create a xml file catalog_category_view_id_{{id}}.xml under your theme > Magento_Catalog > layout and change list file.
For detail :
http://sumankc.com/2016/12/10/different-template-for-different-categories-in-magento-2-category_id-layout-handle-in-m2/

GO To admin -> Manage Category and select particular category that you want different design and ther is one tab "custom design" . in this tab there is one drop down list with name "custom design". you can select custom design for perticular category.

Here are the steps that you will follow in this Magento 2: Change category page layout
On the Admin page, look for Product section. Then click on Categories section under Inventory.
You can see the category tree on the left, choose any category for which you want to change the page layout.
Then find the Custom design section, click on it.
Now you can change both category page layout and custom theme here.
In this section, you can use 2 fields to change the category page layout. The Page Layout and Custom Layout Update.
Page Layout field gives you 6 options to change the category layout.
The Custom Layout Update allows you to update the theme layout with XML code.
These are the options for changing category page layout.

Related

Can anyone explain why magento is doing this on reviews?

I have no idea why, but if you view this page:
http://www.awesomegti.com/review/product/list/id/50592/#customer-reviews
I feel like the page is trying to utilise either an old template, or multiple templates which is causing the design to get messed up. If you click 'Back to product' the correct template loads fine.
Can anyone guide me to the right place to check this configuration?
The link you have shared utilizes review modules list action, while when we click on "Back to Main Product Info" link, it takes us to catalog module >> product controller >> view action
Both are managed by different layout xml file so both have different layout.
You can do either of two strategies:
Make layout of product review page identical by doing some css work
Call review form and reviews list on product view page under product reviews tab (which is not working correctly right now)

Joomla Custom Category Blog

I'm working in my own template using Joomla 3.3
and I've created a custom category blog in my template
mytemplate\html\com_content\category
now I need to make another custom category template, like news.php or products.php.
what I need is to have multiple custom category blog in my template. and I can select from menu manger the type of category blog template.
How to accomplish this??
This is already a core feature of Joomla. Simply go to the Module Manager and select any instance of the category blog module and go to the Advanced Settings tab.
The very first field, Alternate Layouts, will be a list of all the template overrides available for that particular module.
Hope that helps.
I've solved this issue by a workaround.
In mytemplate\html\com_content\category/blog.php
I've added some conditional statements like;
if($this->pageclass_sufx=='x')
echo $this->loadTemplate('item');//which is acts as blog_item.php
elseif($this->pageclass_sufx=='y')
echo $this->loadTemplate('custom');//which is acts as blog_custom.php that I'vecreated
And in menu manager for the category item I add page class suffex 'x' or 'y'

How Set Child Category under Parent Category in Joomla Virtuemart

Here I have a problem, when I create a subcategory it goes to main menu and I need to show it in body where main category shows .. Simply I need my category setting like this, so how I can do this please.
Both sites use "Virtuemart". What do I need to do for this kind of result?
I need this http://www.empiremedia.biz/ Like this http://www.unitedbroadcast.com/
Anyone who well experienced in Virtuemart. or how i can solve my issue ,please guide or suggest me what need to do? Or where do I need to change core files?
Try checking "Show Children Category" in the Templates tab of the Config menu. (VM 2.0.10)
To do this:
Go to Virtuemart > Configuration
Click the Templates tabs
Select the "Show Children Category" check box
Save
Option 2:
Go to Virtuemart > Products > Product Categories
Click the product category you want to edit.
In the description box type in the name of your sub category then make it a link to that sub category... if you need the link navigate to it in your browser.
Again I can't stress this enough if you have having THIS MUCH trouble with VM I strongly suggest getting a book or hiring a developer. Please consider buying a VM book.
set your homepage or any of your pages 'menu item type' to virtue mart category layout.
on your admin page go to
menu > main menu
click 'home' or any other page
select virtuemart category layout on the menu item type*

How to colour wordpress menu lis based on category assigned to each page?

I would like to create a nav menu that displays all the pages of a wordpress site, its layout similar to what you would see in a footer sitemap layout, approx 5 columns with all the pages shown. Each page will be a project. I want to use wordpress category checkboxes (like you have for posts) to allow selection of one relevant category for each project page. Each page will then show a category caption below the project's description text, this I will style with CSS so each category has a different background colour.
Because Wordpress doesn't provide categories for pages, I have found a plugin to add this category feature to pages called ninja-page-categories-and-tags: http://wordpress.org/extend/plugins/ninja-page-categories-and-tags/
It's possible to edit the plugin php code under basic-functions.php to return a 'class' for the category displayed using get_slug and then applying css for each.
My problem is that on the menu, which will be a secondary menu in Thirty Ten displaying the pages, I want to be able to colour the background of each link to match the category that has previously been assigned to each page using the ninja plugin. Because the menu works with pages and the categories are not directly linked to the menu items (firebug will not show category details in the html of each link to reference with the css) I am wondering how I can colour each link based on category? Any ideas?
Ultimately what I would like to achieve is a grid of page links that are all coloured based on their category, a colour coded menu.
The plugin uses the standard wordpress category functionality but I just can't think how to connect these category details to the menu items to allow me to style them with css, any help would be really appreciated, even if just a point in the right direction.
Thanks
It's difficult to understand exactly what you're after, but essentially if you want to add extra classes to menu items (which will allow styling), you need to create a custom walker function.
Have a look at a tutorial like this: http://wp.tutsplus.com/tutorials/creative-coding/understanding-the-walker-class/

Custom URL rewrite in wordpress

I am trying to achieve a custom URL structure with Wordpress. Basically, my site functions as my blog and my portfolio. I want to have an "Articles" section and a "Portfolio" section. I want the articles to display on the Articles page, and the portfolio on the Portfolio page. Should be easy, except on top of that I want custom URLs...
I want the URLs setup like this:
Articles page:
http://mydomain.com/discusses
Specific article:
http://mydomain.com/discussed/%postname%
Portfolio page:
http://mydomain.com/does
Specific design:
http://mydomain.com/designed/%postname%
I can figure out how to do only one rewrite of this type, but WP doesn't have built in functionality to do both. I'm just wondering where I should start or what I should do...
The problem also becomes, I want to retain category functionality in both areas, so maybe it needs to be achieved with Custom Fields? and add a new rewrite rule based on the custom field of a post? I have idea where to start...
Thanks for any help you can give.
This actually isn't that hard to do. I'll go down, page by page, what you would need to do to achieve this.
Articles Page
Create a new template in your theme folder (/wp-content/themes/your-theme/) called discusses.php and just add the following content:
<?php
/*
Template Name: Discusses Template
*/
?>
You don't need any more content. Go into the Pages section of WordPress Admin and create a new page called Articles page and set the URL to be /discusses/. Set the template of this page to be Discusses Template. Now, go into the Settings → Reading section in Admin and set the Posts page to Articles page. Now all your blog posts will appear under the URL /discusses/
Specific Article
The easiest way to have all your articles appearing as /discussed/title is to rename the default category (in Posts → Categories) to discussed. Then set your permalinks to be:
/%category%/%postname%/
This will render the links you need for each post.
Portfolio Page & Specific Design Page
Assuming this will be some kind of custom design, the easiest thing to do would be to create a custom template and Page in the pages section, as you did for the articles page, and throw your custom HTML and CSS into that. I would then set each specific design page to be a child page of that in the pages section. You can use the WPdb classs to make custom queries to populate the Portfolio page.

Categories