NinjaNoodles Posted June 21, 2007 Posted June 21, 2007 After a few hours, this is the only way I could detect second level category names. I've modified the script so it converts this name into a file path, and includes a file into the page. That way, each category can include its own unique file. <?php $spbname = preg_replace("/[^a-zA-Z0-9s]/", "", strip_tags(strtolower(end(explode("-", $breadcrumb->trail('-')))))); $spbfile = "catpages/".$spbname.".php"; if (file_exists($spbfile)){ include "$spbfile"; } ?> That being said, is there an easier way? $category['categories_name'] only works on first level categories.
Guest Posted June 21, 2007 Posted June 21, 2007 what's the purpose of having multiple files for the categories? Consumes more disk space and there is more maintenance to it, but I believe that's not what you're aiming for.
NinjaNoodles Posted June 21, 2007 Author Posted June 21, 2007 What I've done is added the ability to have a unique page included into each category. So if the category is called "Category A," the page categorya.php will be included. If the page doesn't exist, the script will simply move on.
Guest Posted June 21, 2007 Posted June 21, 2007 why not using an SEO module instead? The purpose of using php with osC is to dynamically generate pages using just few main scripts.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.