Skip to Content Skip to Menu

[SOLVED] Updating GroupJive Category Layout to 2 Column

  • 6DS
  • 6DS
  • OFFLINE
  • Posts: 10
  • Thanks: 4
  • Karma: 2
10 years 4 months ago - 10 years 4 months ago #246318 by 6DS
Hello,

I would like to update the GroupJive groups in category display to show groups as 2 column per row.

I am having trouble wrapping the foreach $rows as row in category_groups.php line 26 to accomplish this. I have tried chunking the array into 2 but couldn't get it to work. Can you please advise?

I need to wrap each set of two at the beginning with:

<div class="span10">
<div class="row-fluid">

And of course at the end close with:
</div>
</div>
Last edit: 10 years 4 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 4 months ago #246339 by krileon
You'd need to completely modify the template for category groups. This is done by editing the below file.

components/com_comprofiler/plugin/user/plug_cbgroupjive/templates/default/category_groups.php

We do not assist with such code changes, sorry. You'll need to make them your self or find a designer to make the changes for you.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

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

  • 6DS
  • 6DS
  • OFFLINE
  • Posts: 10
  • Thanks: 4
  • Karma: 2
10 years 4 months ago - 10 years 4 months ago #246410 by 6DS
Thanks Kyle, I appreciate the response.

I was able to figure it out with only a few simple changes. If anybody else is interested in this here are the changes:

Line 26 (or therabouts) find:
Code:
if ( $rows ) foreach ( $rows as $row ) {
And replace with:
Code:
if ( $rows ) { $chunkrows = array_chunk($rows,2); foreach ($chunkrows as $chunkcol ) { $return .= '<div class="gjcontent span10"> <div class="row-fluid">'; foreach ( $chunkcol as $row ) {
On Line 43 (or therabouts) find:
Code:
$return .= '<div class="gjContent row-fluid">'
And add this just inside the opening ' right next to the div statement:
Code:
<div class="gjContent span6">
I had made this change a few days ago so I don't recall if I just had to change the class or add the whole div, but ultimately line 43 should now read:
Code:
$return .= '<div class="gjContent span6"> <div class="gjContent row-fluid">'

Now we need to close all of our tags.

On line 86, inside of the foreach $row closing brace, add a closing div. This will be right before the else statement:
Code:
. '</div></div>';

Now, we need to close our added foreach statement and close out the relocated if, just before the else statement:
Code:
$return .= '</div> </div>'; } //closes foreach ($chunkrows as $chunkcol ) } //closes if ($rows)

With this in place you should have a two column layout for your groups. If you want three columns just change the chunk size to 3 and change the span10 and span6 classes on divs as appropriate according to bootstrap scaffolding . I am using span10 and span6 because that is what fits well inside of my template. With any luck it should look like the attached screenshot:
Attachments:
Last edit: 10 years 4 months ago by 6DS.
The following user(s) said Thank You: nant, krileon

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

Moderators: beatnantkrileon
Powered by Kunena Forum