Application of categories to content in various modules

I need to implement a solution where I can categorise content (news, events, oppportunites, etc.) in multiple categories (and preferably subcategories), like state/province and specific interest. In Pagesetter I would create publication types and use relations to achieve this.

With the move to .8 and the new categories there must be a way to use the categories instead and thus be able to apply the categorisation not only to Pagesetter publications, but also to Content articles, Pages, pnforum discussions?

I do know that this is not yet possible with all modules. How far can I currently go? What can be achieved with .8RC3?
Robert (rgaucsh) and Mateo (netromateo) have been working on the Categories for .8 While I cannot say specifically which modules have the best support for multiple categorization there is a working solution for most of the ValueAddons.

I am sure Mateo will be by later to give some better detail.

--
David Pahl
Zikula Support Team
Exactly that's the point of the "last minute change" in the Categories module before the RC3 release.

In the latest SVN snapshot the ValueAddons that supports Categorization of its items are: News, Pages, FAQ, Feeds, Reviews and Quotes. You can use Multiple Categorization and "share" common Categories between modules.

Recently i has a problem organizing the content of a pnSite that needed MultiCategorization too, and classify all the content with a Global category, News needs a 'type of article' category, Pages a 'type of information' and Feeds just a 'type'.

So, after RC3 multi-categorization is supported and can be used with ease (from my point of view):
Usually, the modules register a Category Property (the 'Main' one) in the installation process; if you want to have more categories per module you just have to go to the Categories Admin Panel > Category registry and register new properties for the module in question.


For instance, in my case i've set up the Categories Tree as:
/Root category/Modules
+ Global
++ list of the global site categories...
+ News
++ list of the types of articles...
+ Pages
++ types of information categories...
+ Feeds
++ types of feeds...


One defined the categories needed in the site, have to Register which ones are used by which modules, so, in the Category Registry, the table should be:

Module | Table | Property | Category
All the modules share the Global categories of the site:
News | stories | Main | /__SYSTEM__/Modules/Global
Pages | pages | Main | /__SYSTEM__/Modules/Global
Feeds | feeds | Main | /__SYSTEM__/Modules/Global
Each module has an specific category (second item category):
News | stories | Type | /__SYSTEM__/Modules/News
Pages | pages | Type | /__SYSTEM__/Modules/Pages
Feeds | feeds | Type | /__SYSTEM__/Modules/Feeds


If you want a third category for any of them, just define the tree and register it...
Then, in my case, i'm using the Content module to display the items of each Global category, and for that i've built a contentype plugin for the News module (available here) and i'm building the Pages plugin to complete the work.

So, what do you think of this Stuff? icon_cool


--
- Mateo T. -
Mis principios... son mis fines

nestormateo

So, what do you think of this Stuff? icon_cool


Cool, definitely cool!

nestormateo

Then, in my case, i'm using the Content module to display the items of each Global category, and for that i've built a contentype plugin for the News module (available here) and i'm building the Pages plugin to complete the work.


Sorry, I don't think I completely get this: you say you're using the Content module to display the items of each Global category and for that you've build a contenttype plugin for the News module.

Have you created a plugin for the Content module that displays news items in a particular page managed by the Content module?
I'm having difficulty assigning a specific category to the content module in particular. No matter what I change in the registry, it still displays the default global categories in the content module root.

any suggestions?

--
[ stevencopley.com ]

jaenosjelantru

I'm having difficulty assigning a specific category to the content module in particular. No matter what I change in the registry, it still displays the default global categories in the content module root.


Had exactly the same experience 5 minutes ago ;). Perhaps it's because the Content module does not yet support the use pf categories like some other modules do?
If that's the case, the only solution I see is:

1. Use the Pages module for static content instead, ugghh.
2. Change the global categories for what I want the content categories to be and then be forced to use those same categories sitewide, or at least everywhere else they are used and unchangeable.
3. Wait for Jorn or Steffen to help us n00bs figure how how to do it right.

If Jorn or Steffen could chime in here that would help. Are we just daft or is this working as intended?

Thanks for the help!

--
[ stevencopley.com ]

jaenosjelantru

Change the global categories for what I want the content categories to be and then be forced to use those same categories sitewide, or at least everywhere else they are used and unchangeable.


That's actually quite a good solution for now -:). Obviously not ideal, but to get the Content module to use categories at in a valuable way for now it should work.
Ouch!
I'm in the Content-dev team too and will update the new way of categories, just wait a little, Content 2.0 is almost out of the door.

dits

you say you're using the Content module to display the items of each Global category and for that you've build a contenttype plugin for the News module.

Have you created a plugin for the Content module that displays news items in a particular page managed by the Content module?


Yes, the contenttype plugin of the News module is available in the NOC.
I'm building the plugins because IMO Content is a pretty way to integrate all the Categorized items.

--
- Mateo T. -
Mis principios... son mis fines
Fantastic!! After being an absolute fan of Pagesetter for years I knew that when Jorn first posted about Content I would one day dive into it as well. Now seems the time! I saw a request on Jorn site for help with plugin development. I'll dive into it.

P.S. Obviously valuing the the work of others on the team very much as well!



edited by: dits, Feb 26, 2008 - 09:04 PM
I've created a subcategory under Modules - Global called Themes.
Now I want to create a subcategory under Modules - Global - Themes, but I can't select Themes as the parent category. Is there a limitation on the depth of the tree?
This sounds really cool, thanks Mateo, dits and jeanos. @ dits and jeanos: your examples really point to really what we have all been looking for in terms of asset management and presentation. & @ Mateo, your response has really been practical and pragmatic and it is much appreciated.

I am looking forward to Content 2.0 as it will fulfill the promise of what many saw in the sections/pages module for presenting a site that was just not possible before. By keeping the tasks of the value-add-ons simple and hooked/available to an aggregating type module you have given us all stairs to climb up to the application platform where we can profess our digressions. :)

I have liked many of the third party modules folks have come up with, however most seemed to as well stand alone, either as a response to the inability of the basic "system" to work well together/sharing data, or as a response to the limited data collected by the original design of a module. By standing alone some modules forced the path of a work flow in cumbersome and awkward manner, some to the extent that basic components were as well alienated if not obsoleted before their time. In other words the basics were ignored for grand specializations that served few. Jorn & Mateo deserve props for sticking with the basics because in the long run it unleashes more true power from the core/add-ons development that has been sitting there dormant.(You got me drifting into the world of hope and possibility.) icon_biggrin

--
Paul
____________________________________________________
"...Humor, ITs just a state of mind"
TakeIT2.CoM :: Open Destination
...my site is a perfect example of why doctors do not operate on them self :)

TakeIT2

You got me drifting into the world of hope and possibility. icon_biggrin
Cool! i'm already on that world! icon_biggrin

Each time that i study the PN-core i found real power there and new possibilities raises in my imagination, just limited by the 24 hours of a day...

Currently i'm happy with the Theme development because with BlankTheme we can dream, and let fly our imagination to define any layout to the sections of our 0.8 sites.
The hook functionality is great and we need to "discover" the ideal way to connect all the ValueAddons functionalities like here we're saying that Content does, but with a Navigation solution too, and some things that still have to code...

I really appreciate your point of view 'TakeIT2'
please, think/observe the ideal way to connect it all, in a "superficial" level, don't go deep in technical issues, just your dream of a mature application platform, and how it looks, the forms, the management, what functions are available, how is the ideal navigation management, some special options... and we can begin to build a clear idea to code it easiest... sometimes the code restrict our vision and time to figure out new ways...

So, let's open a new thread and begin to define some cool features?
I like to dream then code! icon_cool

--
- Mateo T. -
Mis principios... son mis fines
Not sure if this fits here, but I've had trouble with crpCalendar in RC3 - categories just won't stick. They show up in the module, you can add new ones, the category tree looks great, but when editing an event, the category just will not save (ie, mapobj record not created).

Any ideas? Due to the RC3 changes?

EDIT - answered in another post - RC3 categorization changes necessitated changes in crpCalendar. SVN has fixes, next released version will have fixes.

NCM



edited by: uheweb, Mar 03, 2008 - 03:24 PM

nestormateo


Yes, the contenttype plugin of the News module is available in the NOC.
I'm building the plugins because IMO Content is a pretty way to integrate all the Categorized items.


Is it possible to get those plugins? I mean for Pages and News... The link to NOC is not avaiable.
I was about to start write them, there are some instructions in Content help, but I'm affraid I'm not so good coder...

So I'll be very appreciated for some code or files to download. I'm trying to build a site with modules integrated with Content. With some additional layouts it's much easier for redactors (no technical skills) to arrange items within pages then using blocks etc.
Hi!
Currently Erik Spaan is working on the contenttype plugin for the News module at http://code.zikula.org/news.
You can checkout the development version (SVN co https://code.zikula.org/svn/news/trunk)
and copy the contenttypes folder and pntemplates/contentypes.

Haven't worked in the Pages module content plugin yet.
Too much things to do before that, but have to see an Erik's answer about the improved content plugin and stories block.
icon_wink

--
- Mateo T. -
Mis principios... son mis fines
Thanks for quick reply. I checked News SVN, but there are no plugin file. I suppose it should be pncontenttypesapi/newsrticles.php but theres no folder like this. I found templates, lang files and Ajax edition js file, and that's all... icon_frown
Is it something wrong with that plugin, or just an oversight?
I looked into templates and it seems very promising...

And with the pages module - I'll try to find another solution. Probably i'll use the content module, but I wished to have crpTags for News and Pages module, and possibility to arrage most of layout tasks through Content module instead of using blocks etc.
One cannot have all icon_smile Thanks anyway, but if you'll find the missing plugin for News it would be very usefull not only for me I hope.



edited by: obywatel, Sep 28, 2008 - 12:34 PM
your wish is my command icon_wink
I have updated the storiesext block to version 2.3 (http://code.zikula.org/storiesext) and finally got the multicategorization with multiple properties working. (You learn a lot on the categorization insides icon_smile ).

And I have also updated the Content newsarticles plugin based on this new storiesext version. So also multi categorization and some minor new features and updates to make it more usable.
Check out http://code.zikula.org/news under downloads for the Content plugin.


A plugin for Pages. What would you like to display in Content from Pages? A list of pages items of the content of a Page? It would be helpful to specify some of your wishes.
There is already a Content plugin for module output (not sure if it is released or only in SVN). It could be that it is already enough for your Pages ideas.



edited by: espaan, Sep 30, 2008 - 10:09 AM

--
campertoday.nl, Module development, Dutch Zikula Community
Wow, that rulez icon_smile It has much more that I thought I needed... But now I have new possibilities - it means more sleepless hours then I supposed icon_smile
Your blocks are the best ABC for "coders" like me - i mean CaP+SaL coders... It means "Copy and Paste then Save and Look" what happes icon_smile

I have inside your code everything that may help me to understand PN API. Great.
I've made once kind of "ekstended" stories block (see www.obywatel.org.pl - blocks on the left), and I now need something like this also for pages. Writing blocks is for me easier then Content plugins, because I don't have yet many plugins to "CaP" icon_wink So I made a block for pages that chooses from categories, displayes title and then truncates a content.

I can't write in PHP but I'm familiar with Smarty, so I took News-stories block, made CaP+SaL and some changes, and just finished template with [$content|truncate:200:"...":false].
So the result is categorized block for pages with titles, links and truncated content. Every variable (like 200) is hardcoded in template.

It would be very useful to have similiary plugin for Content. Of course without hardcoded variables - but with variables taken from adminmenu.

What's for?
I need news for "normal" news, and pages for longer publicistic texts. It would be best if both of them has the same tag system (cprTags) and as I wrote above, arranging homepage through Content "drag and drop" is much easy for redactors then using blocks

Thanks a lot for your work.
Grat Job icon_smile

Yeah, the extended stories block has a lot of options, but I like to be able to choose what to show in the news list (and not only by editing templates and hard coding stuff icon_smile ).
Mateo took an earlier version of storiesext and made the 1st version of the Content plugin. I made it consistent with the latest storiesext in several steps.

For the Pages module I more or less see what you mean. You would like to show the Pages of a category, but then "truncated" to a certain length. Keep in mind that truncating real content is not se easy, since there can be all kinds of HTML markup (and even images) in there. You dont want to truncate in the middle of that.
An option to choose between string truncating and clipping of a div to a certain height (and/or width) might be the solution. I'm checking out the options.

And of course I use CaPSaL a lot icon_smile For the categorization stuff I had to dig a little deeper, but then you still can use code from other modules. And there are some nice examples of the interactive javascript stuff to make the admin section cleaner.

BTW I put a new download of the Content plugin. There was a minor display error when no extra info was selected.



edited by: espaan, Sep 30, 2008 - 03:51 PM

--
campertoday.nl, Module development, Dutch Zikula Community

espaan

eep in mind that truncating real content is not se easy, since there can be all kinds of HTML markup (and even images) in there. You dont want to truncate in the middle of that.
An option to choose between string truncating and clipping of a div to a certain height (and/or width) might be the solution. I'm checking out the options.

And what about "|strip_tags" before truncate ? I'll test this method with strip tags on "my" pages block. I have to test the second categorisation, I don't understand yet what is that for?
Generally there are not many informations about categories, and how to use it. I see - it's revolutionary change to PN 7.6, but still don't get how to use it. Content module + plugins + categorisation, made that I said goodbye to my big love - Pagesetter icon_smile And I bide for Pagemaster instead...
Hi,
strip tags will work, but then you will also loose all the HTML markup you have given to your NewsArticle/PagesPage/etc. I have found a Smarty plugin (there is not much out there, so luckily I found something icon_smile ) for truncating a string and keeping the HTML tags in there. It finds the tags and when the string is clipped in the middle of a part that is within for example strong the closing /strong will be pasted on the end to make it work.
I made a zikula modifier plugin and put it for testing in my News install.

Been testing it out and it seems to work nicely. Nested tags also work etc. For example
Part of an (Dutch icon_wink ) article string:

Code

Zikula 1.0.0 <strong>geïnstalleerd <em>op</em> deze website</strong>. Zikula is

truncating with $text|truncatehtml:35:"..." gives

Code

Zikula 1.0.0 <strong>geïnstalleerd <em>op</em> deze</strong> ...


Check out the code in the SVN here. I've uploaded the plugin to the Cozi news project.
Give it a try. I have tested a little bit, but I guess some more testing might be necessary.

I will use it for storiesext and the Content newsarticles plugin as well. It solves the truncating and messing up HTML tag stuff.

--
campertoday.nl, Module development, Dutch Zikula Community
I've added a Wiki page to the knowledge base about truncating strings here

--
campertoday.nl, Module development, Dutch Zikula Community