Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account
This post has been closed. You can still view previous posts, but you can't post any new replies.

How to make the character sheet section load a specific tab every time you open it

Normally the Attributes & Abilities section saves which tab you opened last in Character Sheet based on its value so when you close the entire sheet or even Roll20 itself and then reload the sheet you will start on that particular tab based on the value Attributes & Abilities saved via its tracking your activity. However, I have 5 separate tabs in the Character Sheet section of my custom sheet and I would like the first tab to be set to be what players see open every time they reload their sheet instead of the tab Attributes & Abilities saved as their last tab opened. How can I go about doing this?
1552081898
GiGs
Pro
Sheet Author
API Scripter
You are conflating two types of tabs here: The top three tabs - Bio. Character Sheet, and Attributes & Abilities cant be controlled from the character sheet. Which one of them appears depends on how you open the journal. If you click ALT+and double click a token, it'll open on the Character Sheet tab and Shift opens on the Bio Tab, IIRC. The lower level Tabs within the Character Sheet can be controlled: you should have an Input which controls the tabs setting, and stores the active tab. Whenever people visit the top-level Character Sheet Tab, they'll see which lower level tab is active.
Yes and when you visit the Character Sheet tab the 5 tabs i added in my custom sheet are there and starting with the 2nd time you use the sheet and onward the last of the 5 tabs you had open is saved into the Attributes & Abilities tab so that the next time you click on Character Sheet that tab of the 5 in my custom sheet is the one opened first. To put it visually: Bio & Info    Character Sheet (currently open)    Attributes & Abilities Tab 1    Tab 2    Tab 3 (currently open)    Tab 4    Tab 5 I then close the window containing the sheet and Attributes & Abilities stores in its data Tab 3 was the last one opened. Now I re-open character sheet... Bio & Info    Character Sheet (switched to from Bio & Info)    Attributes & Abilities Tab 1    Tab 2    Tab 3 (default tab due to Attributes & Abilities data)    Tab 4    Tab 5 Here is what I want though: Bio & Info    Character Sheet (switched to from Bio & Info)    Attributes & Abilities Tab 1 (default tab due to custom sheet code regardless of Attributes & Abilities data)    Tab 2    Tab 3    Tab 4    Tab 5
1552083884

Edited 1552083930
GiGs
Pro
Sheet Author
API Scripter
That is doable. I think you are misunderstanding something though. The lower tabs (Tab 1 -5) are completely independent of the top level tabs (Bio/CS/A&A).  The standard way people design character sheets it works like this: When you switch to a tab, (say, tab 3), then close the sheet, it will always be at tab 3 when you reopen it. If you switch to tab 2, and close it, the next time you open it, it will be at tab 2. It does not matter whether you switch between Bio/CS/A&A, whenever you return to  CS, the lower tab will be showing the last one selected. You can change this behaviour with a sheet worker. You need to identify the attribute that is storing the active tab. there'll be an input linked to the tab. Once you identify that, you can create a sheet worker like this: <script type="text/worker"> on("sheet:opened", function() {     setAttrs({attribute:1}); }); </script> Put the above code at the bottom of your html file. You just need to change this line:     setAttrs({ attribute :1}); replace 'attribute' with the name of your tab attribute, and change 1 to the value of the first tab.
1552084423

Edited 1552084618
I must've explained wrong then. What I mean when I speak of Attributes & Abilities is every time I click on a tab that part creates an attribute to store the data involved with it, which basically does what you said here: When you switch to a tab, (say, tab 3), then close the sheet, it will always be at tab 3 when you reopen it. If you switch to tab 2, and close it, the next time you open it, it will be at tab 2. Hopefully that clears up any miscommunications from what I said and sorry if I made it so confusing. That said, the code you gave me with the necessary change didn't work. I tested by clicking on tab 5 then closing both the character sheet window and the game itself and then reloading the game and reopening the character sheet and it started off on tab 5. Edit: a change error on my part but I fixed it and it works, thanks!
1668593865
Roll20 Dev Team
Pro
Marketplace Creator
Thanks for the suggestion! After 30 days, Suggestions and Ideas with fewer than 10 votes are closed and the votes are refunded to promote freshness. Your suggestion didn't build the right momentum this time, but feel free to submit it again! We find that the best suggestions describe the problem you are having, and the solution you want. You can learn more about the process of making suggestions on the Roll20 Wiki! More details can be found here .