need a new page to be sorted in the category tree (set cPath)

Open to all! Ask other shopowners for help.
Post Reply
loop
Contributor
Posts: 253
Joined: Thu Mar 25, 2021 12:26 pm
Phoenix Version:
Has thanked: 7 times
Been thanked: 3 times

need a new page to be sorted in the category tree (set cPath)

Post by loop »

Hello all
i would like to sort a newly created page (blog post) into the category tree. so that when you open the page, the category tree on the left is expanded as you are in the category
i.e. I want to set the cpath manually e.g. cPath = "862_22" and then you should think that you are in category 22
can i set this somehow?
thank you very much for the help / tip


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: need a new page to be sorted in the category tree (set cPath)

Post by Kofod95 »

Can you use the category descriptions for the blog purpose and then just uninstall the no products module or make a new one with a check for "blog-stuff"?
To me, the simplest approach would be to use the categories in one way or another.

Have you tried just adding the cPath to the URL and check if that is enough?

Sorry, a few unstructured proposals..

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
loop
Contributor
Posts: 253
Joined: Thu Mar 25, 2021 12:26 pm
Phoenix Version:
Has thanked: 7 times
Been thanked: 3 times

Re: need a new page to be sorted in the category tree (set cPath)

Post by loop »

thank you for your help!

just found it out:

Code: Select all

$category_tree =& Guarantor::ensure_global('category_tree');
$cPath_array = tep_parse_category_path("864_22");
$cPath="864_22";
$current_category_id = 22;
on top of my page and thenn it shows everything correctly :)
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: need a new page to be sorted in the category tree (set cPath)

Post by Kofod95 »

I'm glad you found something that worked! :)

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide


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