Skip to content

Instantly share code, notes, and snippets.

@kalenjordan
Last active August 29, 2015 14:03
Show Gist options
  • Save kalenjordan/a3b747d97e53c8defe99 to your computer and use it in GitHub Desktop.
Save kalenjordan/a3b747d97e53c8defe99 to your computer and use it in GitHub Desktop.

Easy Content Management for Magento

Wondering whether anything like this already exists out there already. What I want to do is allow content for static blocks and CMS pages to be defined in specific content blocks that have individual fields with the content in them.

So, when editing a CMS Page, you would have a list of N content blocks which each contain their own set of fields based on the schema definition for that particular content block.

For example, imagine a page that has a hero section at the top with a hero image + title + subtitle, then below it a simple set of paragraphs, then below that a feature image set with a grid of feature images that have image + name + description.

That would look like:

  • Block (hero)
    • Title: (text field)
    • Subtitle: (text field)
    • Image: (image upload)
  • Block (paragraphs)
    • Content: (textarea)
  • Block Set (features)
    • Block #1 (feature)
      • Image: (image upload)
      • Name: (text field)
      • Description: (text field)
    • Block #2 (feature)
      • Image:
      • Name: (text field)
      • Description: (text field)
    • ...

Each type of block would need to be defined in config.xml and have a template implemented by a developer. But once that work was done, the content admin should be able to put together relatively rich pages without having to touch HTML at all.

--

This is kind of similar to how I understand the Advanced Custom Fields (w/ the Repeater add-on) plugin for Wordpress to work: http://www.advancedcustomfields.com/

--

I'm guessing maybe Widgets could help with some/all of this? Not totally sure - I'm open to using them, but it would have to be relatively easy for the content admin to manage. The way that widgets are embedded within a wysiwyg like this I don't think is super friendly, especially if your page is going to be made up entirely of 5 or 10 or 20 of them: http://www.magentocommerce.com/images/uploads/kb/tutorial-creating-a-magento-widget/widget-in-wysiwyg-mode-1.png

@brendanfalkowski
Copy link

Asked for this long ago when arguing against WYSIWYG, but was told it wasn't important. It is.

This: http://karenmcgrane.com/2012/09/04/adapting-ourselves-to-adaptive-content-video-slides-and-transcript-oh-my/

Every other page-model CMS from the last few years has this capability built in: Drupal, Joomla, WordPress, Statamic, Craft, Expression Engine, Harmony, Concrete5, Sitecore, and on and on...

Products are a content type. Pages can have many content types. It's absurd to me that page types can't be associated with attributes in the same way that products can. All the plumbing is there.

Every time I've used widgets it confuses the admin users to no end. A giant block of HTML is easiest for them, although it's definitely a stone-age way to manage content.

@kalenjordan
Copy link
Author

Thanks @brendanf! So it sounds like this would be something you'd be interested in then?

Actually one angle that I was thinking about for this was whether it made sense to simply run all content management through Wordpress. Most sites have a wordpress blog anyways and it may be the more natural place to deal with content management - and I guess it would allow you to use things like the Advanced Custom Fields right out of the box.

@brendanfalkowski
Copy link

I do not abide WordPress, so I wouldn't use anything that links through it. WP is still significantly a blog with blog-tainted CMS grafted on. It's a really unnatural CMS if you've tried other systems built around content definition. The fact that you need a plugin for that says a huge amount. Ditto for Magento's CMS.

I really like the way Statamic handles this with YAML fieldsets for schemas: http://statamic.com/learn/control-panel/fields-and-fieldsets

Anything more complicated than that is just getting in the way. Keep the schema + template-tagged markup in the codebase, and only use the admin for raw data. Of course Statamic's data is YAML also, so that makes it really easy to generate pages without screwing around with relational DB changes. Probably a can of worms.

@kalenjordan
Copy link
Author

Sure, I hear that. Does Statamic have the concept of "repeater" fields? Or if not would it be reasonably easy to extend Statamic to do so?

I guess part of what I'm trying to determine here is whether it even makes sense to build this natively in Magento, or whether it would be better to use a tool that's better than Magento is at content management (WP, Statamic, etc.).

Do you already use Statamic to power content pages for Magento integrations? Would you prefer something Magento-native?

@joshuaswarren
Copy link

Echoing Brendan's comments about products just being another content type, and associating attributes with pages - that's a discussion that came up in our offices recently, about how the CMS built into Magento doesn't have a good sense of hierarchy and attributes, which is why we often see people replacing it with things like WordPress. If the Magneto (or even Magento 2, at least) CMS could support this, or an extension could be written to make it happen...it would make us, and a lot of Magento users, very, very happy.

@jonpday
Copy link

jonpday commented Sep 2, 2014

we use widgets extensively and our clients love them, particularly when they are extended with image upload functionality. we've also added "widget of widgets" concept (e.g. carousel of banner images). next challenge is to refactor widgets to be EAV so that translations and content merging are supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment