Split/Break after each Category in Categories view

More
11 years 2 weeks ago #51960 by Espi87
Hi Friends,

i think this is not a templating Problem but.

I just Need a break between each Category in categories view...

Following Situation:

Articles in Categories
- Contact
- - Offices
Articles: A1, A2, A3, A4, A5
- - Factories
Articles: B1, B2, B3
- - etc.
Articles: C1, C2, C3, C4

Target:
If you Enter Page you are only able so see 2 Filter Fields
"Filter by: Country, Category"
... nothing should be shown, but the Filter - DONE

When you Filtered it should be shown in 3 columns with a break after each Category... like this:

A1 A2 A3
A4 A5
B1 B2 B3
C1 C2 C3
C4

But i dont know how to handle it... it will always Show like this:

A1 A2 A3
A4 A5 B1
B2 B3 C1
C2 C3 C4

:oops:
Please Help... and sorry for maybe bad english.

Best regards
EsPi

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

More
11 years 2 weeks ago #51961 by micker
maybe you can use second level of ordering ?

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
11 years 2 weeks ago #51962 by Espi87
This will Order by categories, but they are still in a row without a break between them.

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

More
11 years 2 weeks ago #51967 by ggppdk
Hello

if you only assign items to main category without secondary categories you can do this:



in you custom template "myblog"
edit file:
components/com_flexicontent/templates/myblog/
category_items(_html5).php


replace:
Code:
$fc_item_classes = 'fc_bloglist_item';
with:
Code:
$fc_item_classes = 'fc_bloglist_item'. ($i==0 || ($items[$i-1]->catid != $items[$i]->catid) ? ' next_cat_start' : '')



then add this CSS rule to your template CSS:
Code:
.fc_bloglist_item.next_cat_start { padding-top: 48px !important; margin-top: 48px !important; border-top: 2px dashed black !important; /* example */ }



or you can use the logic:

Code:
$new_cat_start = ($i==0 || ($items[$i-1]->catid != $items[$i]->catid)); ... if ($new_cat_start) { // do something }


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

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

More
11 years 2 weeks ago #51985 by Espi87
Thank you for this possible solution,
but we rely on categories...
so, is there any possibility to "ask for current category and clear after last post" if i have articles structured like i've written in my first post?

QUESTION:
If i don't create subcategories and assign items only to main category, how do i split them into these subcategories? ^^ did i misunderstood smth?^^

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

More
11 years 2 weeks ago #51987 by Espi87
IT WORKS!
Thank you so much. sorry i tried it now and everything is good.

+Class to new cat. and added empty div between categories with logic.
For Everybody who needs multiple category view incl. "Filterbility" .. this is the perfect solution!
Mobile optimization because first filter, then loading Content. ADVISABLE!

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

More
11 years 2 weeks ago #51992 by ggppdk
Hello

i think we can add parameters in blog template for a "category block"

now we only have item blocks ?

adding an <li>...</li> with category data,
between the <li>...</li> containing items,
should not be a problem ?

if we add support for this in the CORE it will work regardless of item belonging to multiple categories


in your case you just added the CSS or you did something like:

if ($new_cat_start) {
echo "<li>New category starts here</li>";
}


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

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

More
11 years 2 weeks ago #52007 by Espi87
This would be great to integrate.
I have added class to first <li> of new category - so i can clear it for safety suggestions ;)
and as you've written like with logic added
<div class="new_cat_title">CATEGORY HEADLINE</div> between.
so i can Display it as full line (breaker) with Headline.
Can you even tell me how to get current category title?! ^^ i'm just a designer

should be something like
echo '<div>'.$items[$i]->catid.'</div>';
but title instead of id =)

I'm using flexicontent as favorite Content plugin + Easy Language as Content Translation + Falang as module/menu Translation System. This combination is the best solution without having any Performance Problems with small and huge Websites! (acutual my Website has many categories and around 200 articles (+ will be much more) in 11 languages.

11/10 Points for Flexicontent Support ;)

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

More
11 years 2 weeks ago #52010 by Espi87
So for others:
Break category at the end and insert category title
(works fine with filtering):

Create new blog layout ("myblog") Template and edit file
components/com_flexicontent/templates/myblog/

choose style (standard, html5 or xhtml) and edit file
"category_items" or "category_items_html5"

Go to specific Position (for me position is "introblock") and find
Code:
$fc_item_classes = 'fc_bloglist_item';
replace with
Code:
$fc_item_classes = 'fc_bloglist_item'. ($i==0 || ($items[$i-1]->catid != $items[$i]->catid) ? ' next_cat_start' : ''); $new_cat_start = ($i==0 || ($items[$i-1]->catid != $items[$i]->catid)); global $globalcats; if ($new_cat_start) { echo '<div class="cat_title cat_titleid_'.$items[$i]->catid.'">'.$globalcats[$item->catid]->title.'</div>'; };

create classes in your css file:
.next_cat_start // This is for the first <li> of each category
.cat_title // for every title

and if you Need
.cat_titleid_123 //replace 123 with your title id!
I Need it because of some color Relations in each category.
Maybe there is a better solution for showing the title. but this works great for me.

Regards and big thanks to development
EsPi

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

More
11 years 2 weeks ago #52013 by ggppdk
Hello

will commit 2 parameters for blog template

1. showing a sub-category header block when next category starts
2. showing category title


with a warning in tooltip to order items by "Category", this will work regardless of multi-category assignment


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

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

Moderators: vistamediajoomlacornerggppdk
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save