CM to PI

Open to all! Ask other shopowners for help.
Post Reply
BatteryTrader
Contributor
Posts: 153
Joined: Thu Apr 11, 2024 7:18 am
Phoenix Version: 1.1.0.3
Has thanked: 3 times
Been thanked: 17 times

CM to PI

Post by BatteryTrader »

Is there a guide to change a Content module into a PI module, tried a few times, I know there is not a lot of differences, but not there yet.

David

Tags:


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
Kofod95
Senior Contributor
Posts: 748
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.20
Has thanked: 99 times
Been thanked: 179 times

Re: CM to PI

Post by Kofod95 »

Haven't seen a guide, but what I usually do is:
1) take a PI-module (usually, I use model)
2) rename class and constants to match your new module
3) copy whatever from the cm-module needed - often most of the execute function, save for the last bit and the function itself.
The last bit is:

Code: Select all

$tpl_data = [ 'group' => $this->group, 'file' => __FILE__ ];
      include 'includes/modules/content/cm_template.php';
4) paste it into the get_output() function in your new PI-module.
5) Make sure the template-file is referring the right variable
6) Make sure your language-files have the new constants

I think that's about it.

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: CM to PI

Post by burt »

Before re-inventing the wheel, check if the PI module you are trying to make already exists.
There are -loads- in the Addon area, some free, some not, some for PRO members (which you have access to).
I am not here to build for you.
I am here to build with you. Let's help each other.
BatteryTrader
Contributor
Posts: 153
Joined: Thu Apr 11, 2024 7:18 am
Phoenix Version: 1.1.0.3
Has thanked: 3 times
Been thanked: 17 times

Re: CM to PI

Post by BatteryTrader »

Yes I checked first, want to play with the advert carousel in the pi modular layout.

Regards


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