Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about recipe page structure #4

Open
pjv opened this issue Feb 10, 2017 · 1 comment
Open

Question about recipe page structure #4

pjv opened this issue Feb 10, 2017 · 1 comment

Comments

@pjv
Copy link

pjv commented Feb 10, 2017

Hi @aristath,

Thanks for putting this plugin out there. I wanted to build something similar and was getting ready to start from scratch when I found it.

When I started playing with recipes, I found that to match the style and structure of the site I'm trying to integrate it with, I wanted to move the "recipe-content" section into what you are calling the recipe's header (specifically, I wanted to put it directly after the featured image). I first thought I could just edit templates to get what I wanted, but when that didn't work, I dug into your code (very clean coding, btw) a bit and looked at how you are leveraging the customizer compatibility and so I can see that there is a fundamental separation between the recipe header and the recipe content that is enforced at the level of the implementation of the customizer code (in customizer.php). That makes it super simple to re-order elements within each section, but impossible to move an element from one section to another (e.g. I wanted to move the recipe-content section from "content" to "header").

I'm wondering what the advantage is to splitting the recipe page output into header and content at the customizer level. If there were no separations between header and content in customizer.php, so all the sections were freely re-orderable in the customizer, wouldn't you still be able to output the sections arbitrarily in the main template file (content-single-recipe.php) so the resulting page structure could still be split into header and content for styling purposes?

@aristath
Copy link
Owner

aristath commented Mar 4, 2017

Hey there!

After looking at cookbooks and other recipe sites I found they all have one thing in common: on the top there's the gist of the recipe with basic info, followed by the recipe materials and execution.
Initially I wanted to expand on that and allow users to order them as they pleased, but found it almost impossible to style!

Example: Right now the content is basically split in 2 main areas: ingredients & execution. They are wrapped in a div that uses flexbox for styling so you can adjust their width from the customizer.
Let's assume there was no header/content distinction, and the user chose to display things in this order:

'title',
'intro',
'content',
'featured-image',
'execution',
'general-info'

Now... how would that be styled without requiring the user to write custom CSS?
Where would things go?
Would the feature image for example be next to the content, on top of the content, next to the execution, or below the content and above the execution?
If I were to remove the header/content distinction, I'd have to add dozens of options allowing users to style things...
It's definitely possible, but then it would no longer be as simple and intuitive, and it would no longer adhere to the WordPress philosophy - with which I agree 100%: Decisions, not Options

The current structure seemed like a reasonable one, covers most use-cases, and if a user desired custom templating they can just use a custom template file on their theme

Changing to another implementation would be pretty simple if we could come up with a viable way to handle things... so if you have any ideas I'd be more than happy to work together and co-maintain this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants