New Zenner
- Join Date:
- Nov 2008
- Location:
- Ohio
- Posts:
- 21
- Plugin Contributions:
- 0
Using PHP "include" in category & product description
I have several product lines that come in kits of various configurations. Example: Product line 1 has 4 components, A, B, C, and D. Kit 1 includes A, B, and C. Kit Two includes A, B, and D. Kit 3 includes only A and D.
I want to have a file with a detailed description of each component -lets say a_desc.php, b_desc.php and so on, so in the description of Kit 3 I could have
That way I would only have to update the detailed description of a component in one place to have all kits updated.
I've tried this with my _desc.php file located in a couple of different directories and changing the php include statement to use every possible combination of directory info from just filename all the way out to http://...filename, and nothing has worked.
Questions:
- Can this be done without more trouble than its worth? (If not, the rest of the questions don't matter, but I'd appreciate alternate suggestions.)
- Where is the best place to put the -desc.php files to avoid troubles with permissions, and should they be .php or .html by name.
- Should they be a standard html file format internally, or does there need to be any PHP tags or code added?
- are the above example include statements the correct way to include these files in the description, or is there a better way? If these are the best way, any tips you could provide (especially regarding designating the path)would be appreciated.)