WeStandWithUkraine

178 Posts
Jeka
7 years ago
Topic

Hi.

I am trying to make quite typical catalog structure.

Untitled-3.jpg

The first way to do that is to use separete modules for every categories and in this way it works great.

But i need to use only list and search functionality of seblod.

So there is my workflow:

1. I have two content types: 'Category' - ( com_category) and 'Article'

2. I create list and search type for categories. This list will show items that are yellow on image.

3. I create list and search type for articles. This one will show brown items on image. In this list we need "cat_id" field for seblod get know from which category show articles. So i put it in.

4. In content type for categories i create new field "List Field" and set it to use second list type for articles.

5. Problem is here. I can not catch live value of category id value. So in every list of articles i will have articles from all categories.

Is it any way to do that? How can i get live value of cat_id field in second list type from first list type?

Get a VIP membership
178 Posts
Jeka
7 years ago
0
Level 1

Devs, community.. any solutions? 

449 Posts
gebeer
7 years ago
1
Level 1

I would also like to know how to do this in Seblod.

1 Post
w2713
7 years ago
0
Level 2

And I am two!

19 Posts
greenmar
7 years ago
0
Level 1

+1

21 Posts
casino83
7 years ago
0
Level 1

+2 :)

7 years ago
0
Level 1

Hello everybody. 

Let imagine what we have to do. A list&search is a single query, as I understand. So, I suppose to start from generate mySQL query which takes us such result. 

449 Posts
gebeer
7 years ago
0
Level 1

@Comeon

sounds like a way that could work. Any idea of how that query would look like?

I think we could also solve this with a custom list template where we add PHP logic to the index.php of that list template.

The PHP logic would loop through all items and produce one array for each category. We can than loop through these arrays one after another to show the category title and all articles in that category.

178 Posts
Jeka
7 years ago
0
Level 1

Hi. Ofcourse we can use custom template, queries and etc. But the main idea of my question is to implement this by using list and search functionality of seblod. Because in this way we get all power of seblod ordering, listing and all other feature wich you can use in lists.

But for now i have found one more problem:

Create list and search named 'A'

This one lists categories like

A A A

Create list and search named 'B'

This one list articles like

B

B

If i put second list 'B' in seach list 'A' by using List field http://www.seblod.com/products/8538 in theory i have to get list like

-B 

-B 

B

But i got just

-B

It looks like criteria from second search merged with criteria from first seach. So there is no way to use list in list. Because result will be merged.

May be developers can say some words about is it posible to load list in other list?

4229 Posts
Kadministrator
7 years ago
0
Level 1

You could try using http://www.seblod.com/products/2239 on category field to get articles from this category - or put HTML typography on the category field and use some php/mysql in there to do the same thing, you can use *value* and  $cck->getValue to get other field value in here (or other functions usable in template overrides)

233 Posts
pepperstreet
7 years ago
4
Level 1

Since you want 1 list with all available Seblod list features like search and ordering… I guess, we need to alter the Seblod query. Some quick and dirty thoughts about the different ways and locations:

  1. extending the list query like the product "Search Join" does. Not sure about LEFT or RIGHT approach in regards of the final list output and article search. I assume the articles should have the priority ;) Would still need a new "GROUP BY" parameter?! 

    ( sorry, I don't have that product, yet. Just a conclusion from the given description, screenshots and tutorial )


  2. Regular query, but alter the list results via PHP. Most likely in custom list template or product "Code Pack". 

    Maybe array functions can re-order and sort the new results list before rendering the output? 
     

  3. extending the list query. New Grouping option in backend, just like the existing "Ordering"! So, we get a final query + GROUP BY (my_custom_field). 

    @Seblod: The latter point 3. would be my favorite. Technically possible? )

All nonsense? Have mercy ;)

572 Posts
_jrmo
7 years ago
3
Level 2

Hi all,

This functionality is now possible. However, it doesn't use a module, it uses this plugin: http://www.seblod.com/products/8538

A tutorial walk through is available here.

154 Posts
WebOne
7 years ago
2
Level 3

Thank you for the tutorial. I've got this working. However: 

For the list items (displayed underneath the categories) when I use the Masonry template - the first set of articles (just images) underneath the first category seems to display fine. But the next set of items (just images) are displaying underneath each other.

This is what is happening with the CSS (using Masonry template for article list)

First set (category) :

First item:

<div class="item" style="position: absolute; left: 0px; top: 0px;">

Second item:

<div class="item" style="position: absolute; left: 220px; top: 0px;">

Third item:

<div class="item" style="position: absolute; left: 440px; top: 0px;">

Second set (category) :

First item:

<div class="item" style="position: absolute; left: 0px; top: 0px;">

Second item:

<div class="item" style="position: absolute; left: 0px; top: 250px;">

Third item:

<div class="item" style="position: absolute; left: 0px; top: 500px;">

As you can see the first set is displaying in one line and the second set underneath each other - even though the same list is being is used?

If I setup a menu item to the List Search type of the articles then they display fine - it's only when used with the Form/List field as above that the display issue is happening.

4229 Posts
Kadministrator
7 years ago
1
Level 4

Hi,

masonry is a bit tricky as it renders its items by javascript, try setting fixed heiht and width on items or use another list template.

154 Posts
WebOne
7 years ago
0
Level 5

I managed to fix it by setting the main template settings - it was set to blog and displaying 1 column then 2 columns in middle view so the second set was displaying underneath each other. (I changed the middle view to 1 column only and it works now).   :-)

However what I picked up - when I switched the list items (displaying underneath categories) from masonry to seb_blog - then only the first item in the list is being displayed - when I switched back to masonry (after fixing above) all the items are displayed underneath each category OK.

Get a VIP membership