Structural/opinion question
-
Hi all- I have a question about high-level/structural theme organization I’d love to get some feedback on. Here’s my issue:
* I have a site design from a client that has 4 unique page styles:
- A one-column right-hand layout
- A one-column left-hand layout
- A one-column full-width layout
- A two column left-hand layout
And, to make things more complex, there are 8 total pages: 1 page uses style #1, 5 pages use style #2, 1 page uses style #3, and 1 page uses style #4.
The way I see it, I have two main options for creating the structure to empower the relationship between these layouts and their pages:
- I can create a custom template (pagename.php) for each of the individual pages on the site, and then combine styles in the CSS file (so I don’t repeat myself) to
- I can inject the page slug into the body tag, so that I can write things like body.pagename [styles].
The downside I see to each of these options is that the HTML structures are based on variables that are user-surfaced; ie, if an end-user changes the page template or the page slug on the edit page, the front-end website will immediately break.
That being said, I don’t know of a way that I’d be able to define the structure *without* using a user-editable setting. So if that is my constraint, I think my *best bet* is to use the page slug, since that requires less custom templates (and therefore less duplicated code).
Does anyone have any other ideas or feedback? Thank you in advance!
- The topic ‘Structural/opinion question’ is closed to new replies.