Welcome, Guest
Username: Password: Remember me

TOPIC: choose category when creating menu link

choose category when creating menu link 02 Jun 2013 14:42 #7277

Hello

Is it possible for me, when adding a menu link to a layout from my component, to choose only to show records within a certain category?

I have created two tables, one with recipes and one with categories linked to the recipes and would like to show in frontend different sites with a overview of recipes from different categories. But when adding link to my layout i am missing the possibility to chose category, it just shows all records.

Hope you understand my question, tried to explain best possible
The administrator has disabled public write access.

Re: choose category when creating menu link 03 Jun 2013 14:06 #7297

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
I understand.

This is nice feature I have forgotten.

Being able to apply filters from the menu item parameters.
Very nice. I take note.

For the moment, you must do it manually.
Add parameters in the layout XML file.
Catch those parameters for filtering the datas and constructing the url. (never did that, in deeds)
Once you have instancied filter for category, just add &filter_mycategory=XX in the url.
Coding is now a piece of cake
The administrator has disabled public write access.

Re: choose category when creating menu link 03 Jun 2013 15:34 #7302

Ok i am a bit lost now :)

You wrote:

"Add parameters in the layout XML file."

Can you give me an example on how to do so? What would i write and where in the layout XML file?
The administrator has disabled public write access.

Re: choose category when creating menu link 04 Jun 2013 06:23 #7313

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
I am searching for you.

But you can also try by yourself if I do not answer you later.
The XML is located in the front, in the view/xxx/tmpl/default.xml (or xxx.xml)

You can add Params in the request, or layout options.

I am tring to understand from com_content.

Should not be difficult.
Coding is now a piece of cake
The administrator has disabled public write access.

Re: choose category when creating menu link 04 Jun 2013 15:27 #7323

I was just about to reply: HEEELP but it was easier than expected. I added "&filter_[Categoryname]=1" and it was working perfectly.

So thank you.
The administrator has disabled public write access.

Re: choose category when creating menu link 05 Jun 2013 08:46 #7333

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
This feature is almost done. (Easy and really important)
I have lot of stuff do do more urgent, so I do not promise when to be released, but it can be soon.
The thing is :

For every instancied filter will come an automatic filter available in the menu item. With a modal to pick the item (you category in your case)

I had to dig in because the modals are still buggy there, so anyway important I put my nose there.
When I do not need to extend the javascript builder interface, such features are really easy to implement.

Nice that you got it by yourself.
Is your SEF mode working correctly ? You shouldn't see your param in the URL.
Guess yes ...
Coding is now a piece of cake
The administrator has disabled public write access.

Re: choose category when creating menu link 05 Jun 2013 13:09 #7341

My SEF is actually not working i see now. I have to use "external link" when creating the menu to show my sites with sorting. And they are showing the parameters ?

Very nice to hear, that the feature is being implemented at some point :)
The administrator has disabled public write access.

Re: choose category when creating menu link 09 Jun 2013 20:25 #7405

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Coding is now a piece of cake
The administrator has disabled public write access.

Re: choose category when creating menu link 09 Oct 2013 19:33 #11356

  • bobr666
  • bobr666's Avatar
  • Offline
  • New Member
  • Posts: 3
  • Karma: 0
Hi! Im a beginner to Cooking. I can't make this feature work.

1. Does it work in the front end?
2. Where can I set the filter value in Joomla 3?

I have added filters to my collection layout and these appear correctly in the layout, but I cannot see where to set the value to filter
The administrator has disabled public write access.

Re: choose category when creating menu link 09 Oct 2013 20:19 #11357

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
1. It works only for Front end layouts because menus applies for the front.
2. Create a new menu item. Choose your component layout. Some extra parameters appears with a select button to open the modal pop up.

Prerequirements :
You must have defined filters in the concerned front-end layout
It is working only for FK filters for the moment. Enums, dates, range, searches... are not handled yet.

To add request params, you can change in :
FRONT/views/xxxxxx/tmpl/xxxx.xml
<fieldset name="request" addfieldpath="/administrator/components/com_demo120/models/fields">

	<field name="filter_categorie"
			type="modal_categorie"
			label="DEMO120_JSEARCH_FILTER_CATEGORIE"
			required="false"
			default=""
			description="DEMO120_JSEARCH_SELECT_CATEGORIE"/>

	<field name="filter_created_by"
			type="modal_thirduser"
			label="DEMO120_JSEARCH_FILTER_CREATED_BY"
			required="false"
			default=""
			description="DEMO120_JSEARCH_SELECT_USER"/>

//HERE YOU CAN ADD FIELDS THE SAME WAY THAN YOUR FORMS OR FILTERS


</fieldset>
Coding is now a piece of cake
The administrator has disabled public write access.

Re: choose category when creating menu link 10 Oct 2013 07:56 #11363

  • bobr666
  • bobr666's Avatar
  • Offline
  • New Member
  • Posts: 3
  • Karma: 0
1. Doh!

2. Thanks - I hadn't spotted the limit to only Foreign keys - I was trying to use Enums.
The administrator has disabled public write access.
Time to create page: 0.138 seconds

Get Started