Hello,
I'm searching for a way to do in confluence something like this:
IF checkbox xyz is checked then
display "{livesearch} limited to current space"
else
display "{livesearch}"
Is something like this possible?
I imagine I could get this done with some "jquery-magic" (and the html-macro), but perhaps there a existing (user-)macros for this kind of task?
Thanks in advance for any hint!
Bye
Sven
You can use the Run Plugin to do things like this. In more complex cases, you may need some some additional logic using Confluence Script Plugin or other similar macros.
wow, that looks powerful, I'll try this out! Thanks!
(although I've stepped some time ago through all confluence plugins, I've missed this one ;-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
could you give me a quick hint:
I try:
{run:autorun=true|replace= year:::checkbox::SEO:SEO} livesearch:spaceKey=$year {run}
...and when I click on the link, it replaces the correct word but in '' (which cases it to fail) - Why?
livesearch:spaceKey='SEO'
(I will add the {livesearch:spaceKey='SEO'} later...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Checkbox is a multi-select control, so use suppressQuote=true to avoid in your case - see Run macro documentation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the answer!
I'm a developer, and I was digging through the documentation, but I didn't figure this out... Are there somewhere more samples than that:
https://studio.plugins.atlassian.com/wiki/display/RUN/Release+notes+2.0
Anyway, I've formulated it the other way round in the meantime and it's working well:
{run:autorun=true|titleRun=Go|replace= space:SEO:search everywhere:checkbox:30:'':''} {livesearch:spaceKey=$space} {run}
And I added some jQuery-Magic to make an Form-Submit on checking the checkbox:
(must go to CustomHTML in head):
<script> jQuery(document).ready(function() { //jQuery('input[type="button"][value="Go"]').hide(); jQuery('input[name=run_1_space]').click( function(e){ jQuery(this).closest('form').submit(); }); }); </script>
This way I've added even some "ajax" ;-)
Now... the only thing I'm struggling with is:
- to get rid of the tables in your run-macro
- to get rid of the "submit"-Button
I've tried to do it by jquery, but the table in the run-macro has no "custom class" (just confluence-table) and the submit-button has no custom id...
...or did I miss some settings in your incredible useful macro?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Look through the parameters on the documentation page Run macro , for instance - hideRun, hideColumnHeadings, parameterInput.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I would like to do something similar to the feature you've explained.
I have 2 documents (template A, template B) with check lists that are almost the same at 90%.
I want to create one document/template, with info from both A and B, so I need to do something like Sven did
IF checkbox xyz is checked then
display "paragraph specific A"
else
display "paragraph specific B"
but the link you gave, for the Run Macro and Script Plugin are not working. Is this not supported anymore?
Thanks in advance
Benoit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Checkbox is a multi-select control, so use suppressQuote=true to avoid in your case - see Run macro documentation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the answer!
I'm a developer, and I was digging through the documentation, but I didn't figure this out... Are there somewhere more samples than that:
https://studio.plugins.atlassian.com/wiki/display/RUN/Release+notes+2.0
Anyway, I've formulated it the other way round in the meantime and it's working well:
{run:autorun=true|titleRun=Go|replace= space:SEO:search everywhere:checkbox:30:'':''} {livesearch:spaceKey=$space} {run}
And I added some jQuery-Magic to make an Form-Submit on checking the checkbox:
(must go to CustomHTML in head):
<script> jQuery(document).ready(function() { //jQuery('input[type="button"][value="Go"]').hide(); jQuery('input[name=run_1_space]').click( function(e){ jQuery(this).closest('form').submit(); }); }); </script>
This way I've added even some "ajax" ;-)
Now... the only thing I'm struggling with is:
- to get rid of the tables in your run-macro
- to get rid of the "submit"-Button
I've tried to do it by jquery, but the table in the run-macro has no "custom class" (just confluence-table) and the submit-button has no custom id...
...or did I miss some settings in your incredible useful macro?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.