Modular Index - Again

Open to all! Ask other shopowners for help.
Post Reply
LeeFoster
Contributor
Posts: 263
Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times

Modular Index - Again

Post by LeeFoster »

Ok I'm looking at the modular index again and have a few questions, I suspect only @ecartz or @burt can answer.

1. Is it possible to add extra sections past I?
2. Is it possible to give each section a background colour?


Join The Code Co-op to get access to your library in the Code Co-op Forum
LeeFoster
Contributor
Posts: 263
Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times

Re: Modular Index - Again

Post by LeeFoster »

LeeFoster wrote: Thu Apr 01, 2021 9:04 am 1. Is it possible to add extra sections past I?
I have answered this one myself.
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: Modular Index - Again

Post by heatherbell »

LeeFoster wrote: Thu Apr 01, 2021 9:22 am
LeeFoster wrote: Thu Apr 01, 2021 9:04 am 1. Is it possible to add extra sections past I?
I have answered this one myself.
Maybe post the answer for future readers?
LeeFoster
Contributor
Posts: 263
Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times

Re: Modular Index - Again

Post by LeeFoster »

heatherbell wrote: Thu Apr 01, 2021 9:24 am Maybe post the answer for future readers?
It was done by adding/duplicating the parameters in cm_i_modular.php

They need to be added to
protected function get_parameters() {
and
public static function display_layout() {

I'm not yet sure how this is going to affect anything so I do not recommend doing it unless you are 100% confident in your abilities.
User avatar
burt
Core Team
Posts: 4550
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Modular Index - Again

Post by burt »

Add in a .css target to each block in the main template file (or a copy of if running a template):

echo '<div class="col-sm-' . $v . '">';

to

echo '<div class="col-sm-' . $v . ' block-' . $k . '">';

And then in .css:

.block-a { background: red; }
I am not here to build for you.
I am here to build with you. Let's help each other.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply