denny / ShinyCMS

ShinyCMS is an open source CMS. This is the Perl version, built with Catalyst and DBIC. (There is also a Ruby on Rails version: www.github.com/denny/ShinyCMS-ruby)
56 stars 24 forks source link

New Page, Need Automatic Template Element Detection #32

Closed wbraswell closed 9 years ago

wbraswell commented 9 years ago

When a user creates a new page, they must somehow already know the names of the template elements to add, and what kind of element to set each as: "Short Text", "Long Text", "HTML", or "Image".

Even for the "HTML Only" template I made, the ShinyCMS user must still know to add template elements named "page_heading" as "Short Text" and "page_body" as "HTML". Unless every template is somehow documented to tell users what elements to create, then the only way to actually know is to read the *.tt file source code, which is beyond the abilities of a normal user.

The desired behavior would automatically detect each element from within the .tt files, and properly populate the new Page with said elements. I don't know how to denote the kind of element ("Short Text", "HTML", etc) inside the .tt files, a comment or other Template Toolkit markup perhaps?

denny commented 9 years ago

I think you're misunderstanding how the system works.

The idea at present is that a Template Admin (somebody with HTML skills such as yourself) creates the CMS Templates with the correct element stack, based on the .tt files, and then your 'normal' site users (Page Admin) only have to create CMS Pages using the existing CMS Template records, which will prepopulate the element stack for them appropriately.

Looking at your site (thanks for giving me the login details on IRC) it looks like you're not adding any elements to your CMS Template. That means every time you create a CMS Page, you have to add the elements manually. Add them to the CMS Template, then any new CMS Pages created using that CMS Template will get the right elements automatically.

denny commented 9 years ago

(That said, it would be nice to autopopulate the CMS Template page with the suggested element stack and only require the admin to set types - it's on the TODO list but a long way down it! It wouldn't work for more complicated templates anyway, for example those which use loops to build up element names programmatically.)

wbraswell commented 9 years ago

Okay I'm dumb, thanks for setting me straight, it works great now!

denny commented 9 years ago

No, you're not dumb, the documentation is inadequate! Please consider writing up some extra words for the Getting-Started doc that explain this part of the system more clearly, so the next person doesn't trip up the same way. :)