Page 1 of 1

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

Posted: Sun Apr 16, 2023 11:05 am
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

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

Posted: Sun Apr 16, 2023 11:22 am
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

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

Posted: Sun Apr 16, 2023 11:29 am
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 :)

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

Posted: Sun Apr 16, 2023 12:53 pm
by Kofod95
I'm glad you found something that worked! :)

//Daniel