2010-09-16: Blog Features IMPORTANT: Add "published" culumn to "blog" table ALTER TABLE wbblog ADD COLUMN `published` tinyint(1) NOT NULL default '1' AFTER body; Draft Feature ============= The draft feature allows the editor to decide whether to save a blog-entry as draft or published one. To use this feature add a suitable control to "etc/blog/edit.xml" e.g. ---------8<---------8<---------8<---------8<---------8<---------8<--------- RadioGroup Publish Do you want to display this article field 1 yes 0 1 ---------8<---------8<---------8<---------8<---------8<---------8<--------- Also make sure this element finds a place in your edit-template file, see "template/Blog/edit.tmpl" As mentioned, this feature is optional. So, if you don't want to support draft, just, leave the form element away and new records will automatically set to "published" (according the table's default value). Time Controled Publishing ========================= It is possible to save ("published") blog-records with future created timestamp. The Blog-component makes sure, that it won't display future records. Using this feature, you are able to schedule blog records for publishing, e.g. place an article "Happy New Year 2011" witch created=2011-01-01 00:00:00" and it will automatically pop up on January 1st. To use this feature, add Date control to "etc/blog/edit.xml" e.g. ---------8<---------8<---------8<---------8<---------8<---------8<--------- Date Date Date and time to publish blog record field yes Y-m-d H:i:s now -1 year +3 year ---------8<---------8<---------8<---------8<---------8<---------8<--------- Again, make sure that element "created" is in your template, as well, see: "template/Blog/edit.tmpl". This feature is optional, too. Wombat is capable to auto-fill the "created" column. To do so, just add the created tag to the blog's table definition in "etc/table.xml". (This file contains plenty examples how to use auto "created" and "changed" columns). Blog Categories =============== Well, using categories for blog-entries is quite an old feature, implemented in the early days of Wombat1 :-) This feature got somewhat lost, still, tables were prepared for categories and such. Current verion of Blog-component provide category support - it is possible to display blog-entries of any number of categories, using the configuration parameter "category". In order to set/change a blog entry's category, add element "catid" to your "etc/blog/edit.xml". As the example shows, the attribute-source Table is used to load allowed records from the "blogcategory" table. ---------8<---------8<---------8<---------8<---------8<---------8<--------- Enum Category Blog's record category field 0 0 values Table blogcategory
%s - %s (%s) title brief catid
---------8<---------8<---------8<---------8<---------8<---------8<--------- As always, add this form element to the template file, see: "template/Blog/edit.tmpl". If you don't need categories, just leave away the element "catid". Don't be afraid of future requirements of your blog, you can add category support any time you want. To add and edit the categories, use the TableEditor component.