Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set_page_config function #5151

Closed
KhaledHassine11 opened this issue Aug 14, 2022 · 4 comments
Closed

Set_page_config function #5151

KhaledHassine11 opened this issue Aug 14, 2022 · 4 comments

Comments

@KhaledHassine11
Copy link

In a multi-page web app, we need to set the configuration for each page. Why we can use this function only on time in an app?

@vdonato
Copy link
Collaborator

vdonato commented Aug 15, 2022

Hi @Khaled11111111,

The function is limited to one call per script run to prevent dynamic changes to the page layout which may confuse a user if it's not clear why, for example, the page layout switched from centered to wide mode.

Closing as this isn't a feature request/bug report/etc. I'd recommend posting these types of questions in our community forums in the future.

@vdonato vdonato closed this as completed Aug 15, 2022
@tomgallagher
Copy link

I'm a bit confused about this not being described as a feature request or bug report in multi-page apps. If the st.set_page_config is called on the main page and the preference is for layout='wide', then all pages inherit this layout. Great.

However, if you have the app open in a browser on one of the pages (not main), then you go to another tab, do something else, then come back, the layout has changed. This is because of the browser behaviour with tabs, I think, in that it calls for a refresh on idle tabs when revisited. So the page itself does not have the st.set_page_config call, and the view goes awry.

One solution would be to allow layout to be set in the config.toml file maybe?

In any case, I'd be keen to hear what the solution is.

@zxdawn
Copy link

zxdawn commented Jan 20, 2023

Agree with "all pages inherit this layout". Any updates?

@gabrielziegler3
Copy link

Any updates on this? I'm still having trouble with st.set_page_config for multipages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants