The space list macro provides a list of spaces however the category value changes apparently to whatever was last used.
I need to set the value for the category list to a default value whenever the page is refreshed.
Tried the following but it had no effect.
<div> <script> let teamOptions = document.getElementsByName("spacesSelectedTeam")[0].options; for (let i = 0; i < teamOptions.length; i++) { if (teamOptions[i].value == "ttgkb") { // Item is found, set its property and exit //teamOptions[i].selected = true; break; } } </script> </div>
Your approach is not very bad at first sight. But I have some questions.
Perhaps my little input helps you already to figure something out.
When I change the category it reloads the whole page with a new URL:
conflueceURL/page/viewpage.action?spaceKey=KEY&title=Space+Category&spacesSelectedTab=category&spacesSelectedTeam=ttgkb
With this URL, you will always get to the page where the team "ttgkb" is selected.
Hope it helps, Regards,
Dominic
Hi, I just added it inside the page.
A user macro may be possible.
The URL is okay but the user may go directory to the page from another path.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think I know why the Javascript directly in the page did'nt work, because the space category macro wasn't loaded at this time.
I added it in end of the body in the "Custom HTML" section in the administration console. There it worked, but not very user friendly...
When you go to the page, it sets the category as excpected --> ttgkb. But because a manual change of the dropdown reloads the page, the script is executed again and the category ttgkb is selected again... That means you would never be able to change the category.
The user macro didn't work out for me either. Because in the settings you cannot change the default dropdown value.
The only really dirty way I can think off would be:
Regards, Dominic
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.