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

Update archive.php #580

Merged
merged 1 commit into from Nov 12, 2014
Merged

Update archive.php #580

merged 1 commit into from Nov 12, 2014

Conversation

jgclarke
Copy link
Contributor

Revising the "primary" element to use a "div" vs. "section" to bring it into sync with index.php and single.php

Revising the "primary" element to use a "div" vs. "section" to bring it into sync with index.php and single.php
@obenland
Copy link
Member

The spec says:

The section element […] is a thematic grouping of content, typically with a heading.

This would not apply to index.php or single.php, it does apply to archive.php though.

Also see #104, #117, #150, #363, and possibly others.

@jgclarke
Copy link
Contributor Author

Multiple points of feedback, in my opinion:

  • The spec also states that "The section element is not a generic container element.", which it is being used for here.
  • The spec also clearly shows examples wherein sections are intended to be used more often in groups, ie, it's less common to use 'section' in an isolated manner such as this. As supporting evidence, the spec states that "A general rule is that the section element is appropriate only if the element's contents would be listed explicitly in the document's outline."
  • The importance of using the same elements (div vs. section) consistently across the same type of templates, when factored into the spec's point (noted above) about 'section' not being intended for generic containers suggests that 'div' should be used here instead.

More broadly, there seems to be a strict interpretation of the spec, when in fact the spec itself is often ambiguous. This ambiguity suggests we should interpret the spec within the context of the overall theme, with the theme's organization and consistency taking precedent when there are conflicts with unclear aspects of the spec.

@obenland
Copy link
Member

The spec also states that "The section element is not a generic container element.", which it is being used for here.

If we had section titles in index or single, those divs would be sections too.

The spec also clearly shows examples wherein sections are intended to be used more often in groups, ie, it's less common to use 'section' in an isolated manner such as this. As supporting evidence, the spec states that "A general rule is that the section element is appropriate only if the element's contents would be listed explicitly in the document's outline."

I believe the section's contents would be listed in the document's outline.

The importance of using the same elements (div vs. section) consistently across the same type of templates, when factored into the spec's point (noted above) about 'section' not being intended for generic containers suggests that 'div' should be used here instead.

I think it is more important to use the right element for a given situation. Not necessarily the same ones. I still believe a section element in the context of archive pages is more fitting than a div, because in that context, it is not used as generic wrapper. It would be in index and single, which is why we don't use sections there.

@binaryliving
Copy link

After looking closely at the specs, and the code, it is being used as a generic container, although not as generic as a bootstrap container. The specs also prescribe "identification of themes..." such as h1, h2, etc.. as a child of the section. The loop inside the section (or multiple loops) as is would generate 1 to N various sized header elements (in theory). Rendering the intention of the section element useless.

obenland added a commit that referenced this pull request Nov 12, 2014
Use `div`s consistently throughout templates.
@obenland obenland merged commit 6c783cd into Automattic:master Nov 12, 2014
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

Successfully merging this pull request may close these issues.

None yet

3 participants