Blog Category with 3 or 4 Columns...?

More
14 years 11 months ago #2931 by ThatComputerDude
So I edited the Category.xml file to include the 2 extra choices in the drop down when editing a category layout (see attachment).


Now - I'm guessing I need to edit the category_items.php file and I see the code but not sure exactly what to edit because I'm not a php developer - I know what it does to read but that's about it... I started to edit it but don't want to screw it up, so any advice would be great!

from line 280 to 293 in the category_items.php file
Code:
<ul class="introblock <?php echo ($this->params->get('intro_cols', 4) == 1) ? 'one' : 'two' : 'three' : 'four'; ?>"> <?php for ($i=($this->limitstart == 0 ? $leadnum : 0 ); $i<$count; $i++) : ?> <li class="<?php echo (($this->limitstart == 0) ? ($i+$leadnum)%2 : $i%2) ? 'even' : 'odd'; ?>"> <div style="overflow: hidden;"> <?php if ($this->params->get('show_title', 1)) : ?> <h2 class="contentheading"> <?php if ($this->params->get('link_titles', 0)) : ?> [url=<?php echo JRoute::_(FlexicontentHelperRoute::getItemRoute($items[$i]->slug, $this->category->slug)); ?>]<?php echo $this->escape($items[$i]->title); ?>[/url] <?php else : echo $this->escape($items[$i]->title); endif; ?> </h2>
Attachments:

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

More
14 years 10 months ago #3067 by ThatComputerDude
Has anyone done this yet?

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

More
14 years 10 months ago #3378 by djw2
I need to have this option as well.

I was pretty far into converting my content over to FLEXIcontent when I ran across the fact that there are only the two options... I was stunned. FLEXI is such an improvement on the core content manager, I couldn't believe this was overlooked.

I made the same changes the person above made, that obviously doesn't work, so... any advice on adding a couple more columns to the blog view would be great.

Thanks.

Dan

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

More
14 years 10 months ago #3574 by ThatComputerDude
Has anyone attempted to create a template with more than 2 columns???

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

More
14 years 10 months ago #3598 by Rooney
Has anybody solved this? Would be excellent!

Rooney

Joomla! 3.9.24 and FC 3.3.9

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

More
14 years 1 month ago #11592 by mistcaller
The first poster was on the right track.
So, one quick way to create more columns is as follows:
1)create a new blog template,
2)then go to components\com_flexicontent\templates\new-blog-template\category.xml and add two more options for "intro_cols":
Code:
<param name="intro_cols" type="list" default="2" label="FLEXI_INTRO_COLS" description="FLEXI_INTRO_COLS_DESC"> <option value="1">FLEXI_1_COL</option> <option value="2">FLEXI_2_COLS</option> <option value="3">FLEXI_3_COLS</option> <option value="4">FLEXI_4_COLS</option> </param>

3) While you are at the same folder, you need also to change category_items.php, at around line 276,
from:
Code:
<?php endif; if ($count > $leadnum || $this->limitstart != 0) : ?> <ul class="introblock <?php echo ($this->params->get('intro_cols', 2) == 1) ? 'one' : 'two'; ?>">
to the following:
Code:
<?php endif; if ($count > $leadnum || $this->limitstart != 0) : //added to intercept more columns (see also css changes) $classnum = ''; if ($this->params->get('intro_cols', 2) == 1) : $classnum = 'one'; elseif ($this->params->get('intro_cols', 2) == 2) : $classnum = 'two'; elseif ($this->params->get('intro_cols', 2) == 3) : $classnum = 'three'; elseif ($this->params->get('intro_cols', 2) == 4) : $classnum = 'four'; endif; ?> <ul class="introblock <?php echo $classnum; ?>">

4) Lastly, you need to modify the file /css/category.css, and add lines for class "three" and class "four" e.g.
Code:
#flexicontent ul.introblock.three li { width: 30%; } #flexicontent ul.introblock.three li.even { margin-left: 1% } #flexicontent ul.introblock.four li { width: 23%; } #flexicontent ul.introblock.four li.even { margin-left: 1% }

cheers!

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 1.509 seconds
Save
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