Skip to content
This repository has been archived by the owner on Mar 10, 2021. It is now read-only.

Discussion: Content Areas #131

Open
jamonholmgren opened this issue Sep 16, 2017 · 1 comment
Open

Discussion: Content Areas #131

jamonholmgren opened this issue Sep 16, 2017 · 1 comment

Comments

@jamonholmgren
Copy link
Member

This is an issue to track the discussion about content areas in Thesis.

Here's a random page from the internet (Denny's restaurant, I guess):

dennys

As you can see, there are repeated, similar blocks vertically down the page. If we wanted to make this page editable in Thesis currently, it would be a bit of a pain. Usually what we do is put more content blocks than we need and hide the empty ones, something like this:

<%= for index <- 1..15 do %>
  <div class="year-block-<%= index %>">
    <%= content(@conn, "Year Block #{index}", :raw_html) do %>
      <h1>1953</h1>
      <img src="/images/1953.jpg" />
      <p>Harold Butler and Richard Jezak open Danny's Donuts in Lakewood, CA.</p>
    <% end %>
  </div>
<% end %>

It's not ideal.

One idea to fix this is to have content areas where you can repeat content blocks an arbitrary number of times.

Content Areas

<%= content_area(@conn, "Year Section", :raw_html) do %>
  <h1>1953</h1>
  <img src="/images/1953.jpg" />
  <p>Harold Butler and Richard Jezak open Danny's Donuts in Lakewood, CA.</p>
<% end %>

The do...end block holds the default content for any new content blocks that are added by the user.

The user can add content blocks to the content area by clicking a + icon or something, at the bottom of the content area. This drops in a new copy of the default content that they can then edit.

We would need to differentiate the blocks but also keep them grouped. Something like "Year Section" describes the whole area, but each content block is "Year Section-1" etc, or something like that.

That brings up the question of sorting, too. Do we need a sort order field on page_contents? We would also need a sorting handle, and it could get messy.

It's a bit late, so I'll stop here. Looking for more thoughts on this.

@gdub01
Copy link

gdub01 commented Mar 20, 2019

I like this idea a lot. I think there's maybe 2 items here:

  1. Grouped content. Currently content is only grouped in the context of a page. However, it could be you have a 'profile' piece of content that you want to always display using a piece of text content, image content, and html content. So you could define content blocks to be more modular. Grouped content may or may not be global content.

  2. Lists. This is tricky because there is ordering like you mentioned, and potentially dynamic sorting and filtering and search.

If you have a list of content groups, with each group having a piece of text content called 'title', you could sort by that field.

Generally, I kind of wonder if this will become something closer to contentful or headless cms-y because I immediately want to add tagging and collections to pieces of content.

If we added tagging/collections/categories to content or content groups, we could have a list component that could define which tags(s) to grab and sort order. In the case of content groups, maybe which fields to display. It may have to have content that nests other content (ie. if your list adds a presentationlayer around each item... like if your list is a list of blog posts, and you want to wrap the image, title, and description in a card in just the list ui.)

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

No branches or pull requests

2 participants