how to add text into the composer title?
-
Re: howto: inject hidden data into composer?
Hi
I need to add custom text into the composer title in the publish timeexample:
test
>help | test
how can I do this?
Thank you -
@yehonatan-albert You'll want to listen to a composer client-side hook.
When the user hits submit, the
action:composer.submit
window event is fired.You can listen to that event thusly:
require(['hooks'], (hooks) => { hooks.on('action:composer.submit', (data) => { data.composerData.title = 'help | ' + composerData.title; }); });
-
What have you tried? Do you have a plugin set up?
-
@pitaj I'm trying to create a plugin in JavaScript.
I have custom text and I have the text of the title using this code:document.getElementsByClassName("title form-control")[0].value
I want to change the title in the publish time, but I don't know how to change the publish event
-
@yehonatan-albert You'll want to listen to a composer client-side hook.
When the user hits submit, the
action:composer.submit
window event is fired.You can listen to that event thusly:
require(['hooks'], (hooks) => { hooks.on('action:composer.submit', (data) => { data.composerData.title = 'help | ' + composerData.title; }); });