?
avatar pnkr
pnkr
29 Dec 2014

Steps to reproduce the issue

In your template you create the below

mytemplatename\html\com_content\category

and inside the category folder i create my custom category blog layout. (in my case i just copy the blog.php and blog-item.php from the default com_content of my site and i renamed them as myblog.php and myblog-item.php and just did some minor changes in the layout inside (css stuff).

after that, from the administrator backend i go to Categories i choose the category i want to have a different layout and from the option tab i choose the alternative category layout i created (myblog).

Expected result

when i make a menu item as a category blog with the specific category, it should have the alternative layout from the category option.

index.php?option=com_content&view=category&layout=mytemplatename:myblog

Actual result

when i make a menu item as a category blog with the specific category, it still sets the category blog layout as blog (which is the default view).

index.php?option=com_content&view=category&layout=blog

System information (as much as possible)

Joomla! Version Joomla! 3.3.6 Stable [ Ember ] 01-October-2014 02:00 GMT

Additional comments

In my opinion in the menu option when you choose Category Blog, in the link creation it should check the category that you have chosen and if the category has an alternative layout selected it should have that one.

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar pnkr pnkr - open - 29 Dec 2014
avatar zero-24
zero-24 - comment - 29 Dec 2014

@pnkr

and inside the category folder i create my custom category blog layout. (in my case i just copy the blog.php and blog-item.php from the default com_content of my site and i renamed them as myblog.php and myblog-item.php and just did some minor changes in the layout inside (css stuff).

Please try with myblog_item.php as myblog-item.php is IIRC not accepted. (se the - and _

avatar smz
smz - comment - 29 Dec 2014

@pnkr I'm not getting if you're filing this as a "bug* or as a "request for enhancement"...

If it is the former, then I think there is a basic misunderstanding: what you're trying to do is not to create a different "Template Style", but a new "Menu Item Type" (based on a core "Menu Item Type").

To achieve that you must: copy all related files to the override directory, change their names accordingly and modify the .xml file:

  • in this case all means that you must also copy-rename blog_children.php, blog_links.php and, most important, blog.xml
  • then you have to edit the (renamed) .xml file and change the layout title to something different:
From:
<layout title="COM_CONTENT_CATEGORY_VIEW_BLOG_TITLE" option="COM_CONTENT_CATEGORY_VIEW_BLOG_OPTION">

To:
<layout title="My blog" option="COM_CONTENT_CATEGORY_VIEW_BLOG_OPTION">

Having done that, when you go to Menu Manager and create a new item, you will have (under "Articles") the choice of a new menu type named "My blog": this is what you'll want to use and not "Category Blog":
capture


If instead yours is a request for feature enhancement, to associate categories name to layout names, then I don't think this is a good idea because you could be willing to use the same modified layout for many different categories with different "names" (think of a multilingual site where in different languages you may have different names for the *same category...*), and when you'll want to make a modification to that layout you'll have to do it n times...

avatar pnkr
pnkr - comment - 29 Dec 2014

oh my bad. I did not "get the login" in the first place. Thanks for the info!!!!
your post was very helpful.

avatar smz
smz - comment - 29 Dec 2014

OK, no problem, but next time before "filing an issue", ask around... Usually http://forum.joomla.org/ is a good place to start.

Cheers!

Can someone please close the issue?

avatar zero-24 zero-24 - close - 29 Dec 2014
avatar rdeutz rdeutz - change - 29 Dec 2014
Status New Expected Behaviour
Closed_Date 0000-00-00 00:00:00 2014-12-29 16:37:21
Closed_By rdeutz
avatar rdeutz rdeutz - close - 29 Dec 2014
avatar rdeutz
rdeutz - comment - 29 Dec 2014

not a bug


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5549.
avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment