Joomla Custom Category Blog - php

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'

Related

Magento2 Multiple Category Layouts

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.

Adding a widget to all blog entries (using the blog module)

I am trying to add the same widgets to ALL of the blog entry pages. Perhaps add them to the blog holder page and inherit them on all blog entry pages. I want the widgets to be automatically assigned to all blog entry pages without having to manually add the widgets.
Is there a method to pull from parent, or is there a way built into the blog module to achieve this? Thanks in advance.
I don't know how widgets work since I do not use theme. If it's saved in a relation something like the following could help you out.
Silverstripe 3.1.x getting values from Parent
or as a Extension/Decorator
https://gist.github.com/lerni/1e046af2005494636707
I believe that is standard (default) behaviour.
As you say, add them to the Holder page, then set blog pages to inherit (default I believe).

How to fetch categories of an article in joomla?

I have a joomla theme and bringing latest recent 6 articles, now i want to print categories of those articles as well on my theme. I'm new in joomla any help please
You should check out any Joomla Module which displays latest articles. There you can see how they access category names. Maybe you can use the module directly.
Checkout the helper.php from \modules\mod_articles_latest.
You don't say what version you are using but it's a standard parameter option to display an article's category. Look in the long list of options for show/hide category and set it to show.

hide main content component for some menu items, joomla 1.7

I know how to hide the main component from the homepage, what I need is to do the same thing for all my menu items also. Basically, what I want is to create multiple homepages, so every category I choose has certain modules that display content.
How to show only modules, not the article when you click on a menu item (if it is linked to a single article)?
I know I can use some of the extensions that can embed modules to an article, but don't want to do it like that. I know that there are components that simulate homepages, don't want it like that either.
I hope my question is clear enough, I'm using Joomla 1.7.
I have found a simple solution!
Installed T3 framework, which allows the removal of main content component for the menu items you choose.

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