Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

[SOLVED] link one view to another 11 Oct 2011 19:05 #197

hi, in my component i have created a categories table. In this table i have several category.
in another table events i have some events linked to single category.


in the front end i have a events list and a categories list.
is possible to make a link on the category title to the events list view?

english is not my language, I hope that I explained

Please Log in or Create an account to join the conversation.

Last edit: by admin.

Re: link one view to another 12 Oct 2011 04:25 #203

Hello,

If I understood right... you are looking for to connect your item to a category...

If this is the question.. it is pretty simple...

1 - On your 'Item' table, you have to create a foreign key field, than drag the 'Category' table inside to the foreign key element you created, by this way, you connected both tables

2 - Once the tables are connected, you have to go to 'Table' section of cook, select the Item table and than go to 'Pages' section and create a front end 'Item'.

3 - After you create your Item page, you will have to drag all the fields to Form Brick.. by this way you are actually creating the fields to be filed on the frontend

- 4 You will notice that the foreign key element you created before, has a plus (+) sign... click on the sign, and the options will open as a tree menu. Just grab the option you want and drag it to the form brick...

Let's say you got the 'Category Title' field from the option available... what this will do... this will create a select box with all categories, but on the frontend you will see the Category Title, but what will actually be saved on the database is the ID of the category.

Follow all this steps and you will be fine...
Paulo Griiettner

Please Log in or Create an account to join the conversation.

Last edit: by griiettner.

Re: link one view to another 12 Oct 2011 06:53 #210

everything you've described I did and it works
But my problem is this:

When I view the categories, I should do so by clicking on the category name that makes me see the list of items associated with that particular category, but are located in items table.

when I try to put a link to the category name the only option I'm given is the link to edit the category.

Please Log in or Create an account to join the conversation.

Re: link one view to another 12 Oct 2011 06:56 #211

table structure are

events
-- FK catid (category ID on the categories table)
...

categories
--id
...


category view

ID | category name |....

where category name will be linked to a 'category' view that contains all events from table events with catid equal to category id in categories.

Please Log in or Create an account to join the conversation.

Re: link one view to another 12 Oct 2011 06:58 #212

Ok...

In order to do what you want now, you have to create a filter... So... On the Pages section you have to add a filter brick, than add a filter field...

Once the filter field is added, you go to the fields slide menu and click on plus sign to open the tree, grab the 'Category Title' field and drop inside the filter field you created previously.. that's it.. now you have the Filter by category
Paulo Griiettner

Please Log in or Create an account to join the conversation.

Re: link one view to another 12 Oct 2011 07:17 #213

ok this help me for filtering
but missed a little brick

see the screenshot

backend: when i want to create a link on category name to category view (list of all events) i see only the option 'Add category' (i need something like 'events' view that exist but from here is not reachable)



frontend:
Categories view (list of all categories) each category should be linked to its list of events (next image)




from categories view when i click on category name, i want to go to this page

Please Log in or Create an account to join the conversation.

Re: link one view to another 14 Oct 2011 16:31 #240

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
griiettner is right, you have to use the filters.

for now, this automatic functionality is not available. Lots of users are asking for this, but it is not possible.


How to do :

Once you created a 'category' filter on your 'events' table, you can filter directly in the url :
for exemple :
...view=events&layout=default&filter_category=32


So, in your categories list, just create a link on the item to a filtered url of the events table.

That's all. (Maximum 2 lines in your component)
Coding is now a piece of cake
The following user(s) said Thank You: twev

Please Log in or Create an account to join the conversation.

Re: link one view to another 15 Oct 2011 09:46 #251

ok tnx
i try your solution.

Please Log in or Create an account to join the conversation.

Re: link one view to another 04 Jan 2012 21:26 #819

Is there any news about this feature?

Please Log in or Create an account to join the conversation.

Re: link one view to another 16 Aug 2012 02:32 #3172

We are also looking for the ability to create a category pages on our site.

Basically we want to make a blog type component that lets us create menu items that link to a category page where the only items shown on the page are items assigned to a given category.

Is this something that can be done now without creating filters and manipulating our urls manually to add the filter in the url?
If it can't be done now with cook, will this feature be in the upcoming release?

It would be nice if there was some way cook to create a page layout that lets us put a Menu parameter that shows a drop down list from a combo box filter we created in cook with a foreign key like a "Categories" table.

When we create a new Menu Item in Joomla, then we would be able to select the category we want for the page and only items from that category would show on that page.

Please Log in or Create an account to join the conversation.

Re: link one view to another 16 Sep 2012 16:30 #3686

+1 for that feature... would be very useful

Please Log in or Create an account to join the conversation.

Re: link one view to another 09 Nov 2012 13:54 #5163

I have a list of rental properties with 3 main categories. The categories are in a table with a FK link to listings table.

I need to be able to have four pages. One for each category and a "All listings" page. Fine with the all listings page. It's how do i display only Cat1, Cat2, Cat3 items on separate pages? I don't want the user to have to select the category from the filter drop down. The user will have the ability to click a link for Cat1 and they should see all of Cat1 listings.

It sounds like creating a custom URL is the way to go. I was trying to play with the URL that Admin was speaking of, but no luck.

../my-component-name/layout-alias-name/default&layout=default&rental=CynthiaPlace

What am I missing.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.084 seconds

Freakin' Awesome!!! J-Cook is simply awesome - whether you're a highly experienced developer or complete novice whether you're building a small inventory component or a complete community solution! The beauty comes from a fast slick and reliable platform that readily provides developers with everything they'll need to build the backbone of a solid and secure component with wizards for authoring access publishing aliasing created/modified by dates... you name it COOK provides it! J-Cook really surpasses all of the 'competition' as far as MVC tools are concerned! Try love it and get cooking!
learnthrusong (JED)
          

Get Started