cancel
Showing results for 
Search instead for 
Did you mean: 

Add attribute in forum aspect

jriker1
Champ in-the-making
Champ in-the-making
How do I add an additional attribute to the discussion forum? Say I want to take the discussion forum and have an option to pick Yes or No from a pulldown and the value on the back end is called Sticky. How would I associate Sticky to the schema of the forum post element?

Thanks.

JR
4 REPLIES 4

jriker1
Champ in-the-making
Champ in-the-making
Any thoughts on this?  Essentially want to add an extra field/property to the form when someone saves/edits a forum entry.

Thanks.

JR

mikeh
Star Contributor
Star Contributor
The discussion forums don't currently use the Forms Service, so this would be a manual code update, rather than mostly config.

The best advice I can give is to look at the source for the discussion post component (client-side JS) and the Repository webscript that receives the form data. The best way of adding additional fields is via aspects, as always.

Thanks,
Mike

jriker1
Champ in-the-making
Champ in-the-making
Thanks Mike,

I've added attributes to the user aspect, probably the wrong way as I never was able to get things working in a custom aspect.  Since I assume this would be a fairly easy example, to add one additional attribute to the forum form, could you show me in 3.3 exactly how to create a custom aspect and tie it to the forum posts?

Thanks.

JR

mikeh
Star Contributor
Star Contributor
The wiki has information on custom aspects: http://wiki.alfresco.com/wiki/Data_Dictionary_Guide#Step_3:_Create_a_new_Aspect

In the webscript, look for the form variable being set, then add the aspect and set the new property accordingly. In fact, there's an example in forum-posts.post.json.js already. Search for "// add the cm:syndication aspect"

Thanks,
Mike