Forum Discussion
To edit custom content follow the instructions here: http://community.lithium.com/t5/Custom-Content/Edit-custom-content-on-a-page/ta-p/108545
If you want to add an additional custom content module to the layout of your post page take a look at http://community.lithium.com/t5/Custom-Content/Add-custom-content-to-a-page/ta-p/108549
- domladden10 years agoAce
Hi Claudius, thanks for your reply.
However, that's not what I want to do, I'm pretty comfortable with custom content in the usage you described but what I want to do is add a new module onto the page from which you write/publish posts, not the completed page.
The process you described will fix the content across posts and pages in that category/community depending on where you put it in the Admin. I want to set the posting process up so that I can add and insert original content into each post.
We currently have 2 already but I would like the ability to add more, if this is possible without direct Lithium development.
Thanks
- domladden10 years agoAceHi, has anyone else had a similar issue?
- phani10 years agoAdvisor
Hi domladden,
As per my understanding following is my suggestion,
1. In a post page, add a custom component.
2. In customcomponet capture sumbmit(or Post) button action using jQuery
3. Stop Lithium post activity by returning false.
4. Read user entered subject and Body using jQuery,
5. Add your data which you want to add into the body.
6. Call Lithium post message API and pass subject and body.
7. Capture new message ID and URL return from post API and redirect user to the new message page.
Following is the code snippet:
$('.lia-button-Submit-action').bind('click', function(e) { $.ajax({ url : '/restapi/vc/boards/id/${coreNode.id}/messages/post', type : "POST", data: {"message.author":"login/${user.login}","message.subject":subject goes here,"message.body":new body goes here,"restapi.response_style":"view","xslt":"json.xsl"}, async : true, error : function(data){ }, success : function(data){ redirect to data.response.message.view_href; } return false; }
Hope this helps!
Regards,
Phani