yourhead / s3

public info about s3
8 stars 7 forks source link

Class based stacks #779

Closed joeworkman closed 5 years ago

joeworkman commented 6 years ago

Make stacks class based. So that a customer can define a template for something but then have all of styles applied to a class.

The user could define multiple classes and apply those classes to any stack that they want.

Partials are similar but not quite as flexible. With classes, you could change the class on a stack. But with partials you would have to do more work and swap out the partial with a different one.

yourhead commented 6 years ago

You mean like CSS classes? Can you be a bit more specific. I just don't think I completely understand what you mean by "class-based"

I think a more concrete example of how you would see it working would be really helpful.

joeworkman commented 6 years ago

An example is my Total CMS Blog list. The user uses stacks to create the template of what a blog post will look like. My logic then takes that template and applies it to each and ever blog post.

In order to accomplish this, I had to create my own set of stacks that can only be used inside this template builder. I cannot allow user to place any stack inside the template builder because all stacks have an ID. If I allowed this when the template gets applied to many objects, there would be many instances of the same ID in the HTML DOM. This is obviously not valid markup.

What I do in my template stacks is take %id% and add it to the class. This way I can target that particular stack via that specific class name instead of by ID.

Make sense?

yourhead commented 5 years ago

this seems outside of the scope of what i can really offer