[accepted ...] Directory view, dividing columns equal size

More
10 years 11 months ago #41805 by jrodgar
I needed on my code a way to automatize the blocks per column variable on the directory view so I overrode the flexicontent\tmpl\default_categories.php file.

Feel free to comment

Changing this
Code:
// Get the directory menu parameters $cols = JRequest::getVar('columns_count',false); if(!$cols) $cols = $this->params->get('columns_count',1); $c1 = $this->params->get('column1',false); if(!$c1) $c1 = $this->params->get('column1',200); $c2 = $this->params->get('column2',false); if(!$c2) $c2 = $this->params->get('column2',200); $c3 = $this->params->get('column3',false); if(!$c3) $c3 = $this->params->get('column3',200); $i = 0;

With this
Code:
// Get the directory menu parameters $cols = JRequest::getVar('columns_count',false); if(!$cols) $cols = $this->params->get('columns_count',1); // Modification: If 0 blocks for col, divide equally between columns $items_per_column = round(count($this->categories)/$cols); $c1 = $this->params->get('column1',false); if(!$c1) $c1 = $items_per_column; $c2 = $this->params->get('column2',false); if(!$c2) $c2 = $items_per_column; $c3 = $this->params->get('column3',false); if(!$c3) $c3 = $items_per_column; $i = 0;

Unless otherwise indicated:
Joomla 3.8.1
Flexicontent 3.2.1.7

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

More
10 years 11 months ago #41824 by micker
thanks for shareing

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
10 years 11 months ago #41840 by ggppdk
Hello

nice suggestion, we have in our mind to add improve direction view even more,

you suggestion will be added,

Also we will change default value of column
from
Code:
<field name="column1" type="text" default="200"...
to
Code:
<field name="column1" type="text" default="0" ...

so that by default the menu item will balance all columns

Regards


-- 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...

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

More
10 years 11 months ago #41962 by jrodgar
Glad to help :)

Unless otherwise indicated:
Joomla 3.8.1
Flexicontent 3.2.1.7

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.839 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