Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Hierarchical Categories and Tags for reports


Go to End


5 Posts   1147 Views

Avatar
kindleman.com.au

Community Member, 70 Posts

3 August 2011 at 8:33pm

Hello,

I have a page type called reports, and i want to put them into categories. Categories will have subcategories, so hierarchical.

I Also want to classify reports by tag.

Ill then want to in the front end: show all reports by tag, show all reports by category, and show reports by category and filtered by tag.

So my plan is, use the tagsField module using the model method (rather than text) for the tags.

Then have a reportsHolder in which all the reports live, and have them some how assigned to categories - using the datagrid or DOM or something.

Is that going to work out for me? Will the front end stuff work out? can anyone tell me more about what I ought to be doing about the assigning the categories to reports, and how i give them titles & descriptions etc?

alternatively, am i doing it wrong? I'm super new to SS, and I'd rather do it in as standard a SS way as there is, rather than swimming upstream.

Thanks for any tips,

will

Avatar
zenmonkey

Community Member, 545 Posts

4 August 2011 at 5:49am

I haven't used the TagField module but I have done similar things using a ComplexTableField in the front end

Avatar
kindleman.com.au

Community Member, 70 Posts

4 August 2011 at 6:39pm

I have abandoned that plan then.

After reading the forums a bit, seems like if the categories have their own page, they should extend the page class, otherwise its just too hard. so i now have holder, categories and reports all extending pages, so the tree now provides the hierarchy by nesting the categories. all good.

I still need to be able to add reports to more than one category, so I have implemented a TreeMultiselectField so i can select other categories for the report.

It works, but i'd like to be able to limit what it displays to the category pages. I don't think thats possible.

Is there any other way to show all items of a certain page type of the tree, multi-selectable?

w

Avatar
zenmonkey

Community Member, 545 Posts

5 August 2011 at 1:40am

Well the TreeMultiselectField is Child of TreeDropdownField which has a filter function, so in theory you should be able to use that function

http://api.silverstripe.org/2.4/forms/fields-relational/TreeDropdownField.html

Avatar
davede

Community Member, 24 Posts

20 August 2011 at 10:18am

Hi,

Did you ever find a solution to filtering out your sitetree field to only one part of the sitetree?

We're looking to do the same thing: allow a selection of a hierarchical categories for pages.