Get data from Add/Edit Post to Forum - Thread

Hi, I am trying to create some new fields for the questions (under the subject) and for them to be added in the body of the forum - thread. I added new inputs but I can't seem to find the connection between Add/Edit Post and Forum - Thread (where the add/edit post is giving data to $thread in forum - thread). I'm thinking that I have to take the information from the input and add it in this function:  j.telligent.evolution.widgets.createEditPost.register({ });

Thank you

Parents
  • Hi Alexandra,

    The two widgets don't interact directly - instead, one is in charge of handling edits and saving changes, and the other is in charge of displaying the content. Check out the 'save.vm' file in 'Forums - Create/Edit Post', and the accompanying logic that calls that file in the _save function in 'ui.js'.

    If your goal is to add these extra fields directly to the body, you can manipulate the logic in _populateData in 'ui.js' to append/prepend the requested data to the body. However, this would result in those fields not being editable after create, or else requiring additional parsing to pull the fields out of the body. The alternative would be to store the fields on their own, either via ExtendedAttributes (see Overload 2 of core_v2_forumThread.Create Script API) or through a custom service that you create for storing this data in a separate location and fetching it along with the forum thread when displayed.

Reply
  • Hi Alexandra,

    The two widgets don't interact directly - instead, one is in charge of handling edits and saving changes, and the other is in charge of displaying the content. Check out the 'save.vm' file in 'Forums - Create/Edit Post', and the accompanying logic that calls that file in the _save function in 'ui.js'.

    If your goal is to add these extra fields directly to the body, you can manipulate the logic in _populateData in 'ui.js' to append/prepend the requested data to the body. However, this would result in those fields not being editable after create, or else requiring additional parsing to pull the fields out of the body. The alternative would be to store the fields on their own, either via ExtendedAttributes (see Overload 2 of core_v2_forumThread.Create Script API) or through a custom service that you create for storing this data in a separate location and fetching it along with the forum thread when displayed.

Children
  • Hi, 

    What I tried is to create a custom Add/Edit Post named Add/Edit Post Alexandra and by following the "Subject" creation I tried to create three more fields. I used core_v2_forumThread.Create like this:  #set($threadOrReplyAlexandra = $core_v2_forumThread.Create($forumId, $subject, $postRequest1, $postRequest2, $postRequest3, $body, $options))

    I don't know how the custom Forum - Thread Alexandra to point to Add/Edit Post Alexandra and not to Add/Edit Post. Also, right now if I use the input fields for request 1, request 2, request 3 it takes me to the "

    Pending Moderation

    The content you requested or created is pending moderation. It will be reviewed by site moderators before being made available to view.

    Back to  Q&A

    " screen but I can't find it anywhere on the moderation. 

    Thank you,

    Alexandra

  • The code calling $core_v2_forumThread.Create won't work - the method requires specific parameters (see the link in my previous reply). One method to add these to the blog post would be to use ExtendedAttributes - see example usage in the Parameters list from the link above (it's under Overload 2).

    If you use the ExtendedAttributes solution, you will then need your custom "Forum - Thread" (view) widget to parse out the ExtendedAttributes from the forum thread being displayed. See the ForumThread Script API Type documentation and the ExtendedAttribute Script API Type documentation for more information.

    Is your account set to be moderated (Administration > Membership > Members > [your account] > Edit > Administration > Moderation) ? Also check all three tabs under Administration > Moderation > Moderation Queue.