How to fetch categories of an article in joomla? - php

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.

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).

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'

Wordpress display category posts on different page

I have a posts category setup called Portfolio. Currently the URL is www.example.com/category/portfolio, how would I display the same page but the url be www.example.com/portfolio?
Maybe I can create a new Template for that page, but how would I display the same results? I was thinking about there might be a URL alias setting?
Creating a template for this is a solution, but I think it will only work efficiently if you have small number of categories.
Try using:
http://wordpress.org/plugins/wp-no-category-base/
http://wordpress.org/plugins/top-level-cats/
I think there are other available plugins to do this.

Joomla 2.5 - How to hide featured articles in blog category layout?

On the Homepage I have an article-slider module which displays the Featured articles from category "A".
On the same page, below the slider I want to display the non-featured articles from category "A", in Blog category layout. The problem is, that in the Joomla settings (menu type: Blog category) I didn't find any option to hide the featured articles.
I didn't find an external component either, so I wanted to do a joomla core hack. I just don't know, which php file should be modified...
I already looked into /templates/mytemplate/html/com_content, but those files are for the displaying of articles, not for the query itself.
I use mod_placehere module from Eike for this. It's very useful module and it works with the latest Joomla 2.5

Categories