[opencms-dev] OpenCMS blog module

Matt Levy matt at ducksoupdev.co.uk
Fri Jul 22 11:44:06 CEST 2011


Hi Christian,

Here is the source code for the blog module I emailed about. It is in the form of an OpenCMS module but you can extract the zip and all the files are within it.

I have included the source code for the classes and the JSPs. The com.levsys.modules.blog.Categories class loads the categories based on a path. I set the path to the base folder in the de-centralised categories folder. For example:

/_categories/
/_categories/sample1/
/_categories/sample2/
/_categories/blog/cat1/
/_categories/blog/cat2/

I set the blog folder as the base for the categories to fetch - 'blog/' and I set it as a property so it can be easily read. Setting this path before calling the readCategories(getCmsObject(), "blog/", false, "") method in class CmsCategoryService means it then only reads the sub-folders of blog/ rather than all of the category folders.

The elements/categories.jsp shows the use of the class to list the available categories and the pages/blog-content.jsp uses the allKeyValuePairFiltered collector to find all blog entries that are categorised with the matching category passed as a url param.

I hope this helps.

Regards

Matt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: com.levsys.modules.blog_0.3.10.zip
Type: application/zip
Size: 70184 bytes
Desc: not available
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20110722/5807857d/attachment.zip>


More information about the opencms-dev mailing list