Skip to content

Page_icon & Title not showing on subpages #6572

@vince-weka

Description

@vince-weka

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

With an app that has multiple pages (pages/ directory), the set_page_config(page_icon='my_favicon.ico') only works on the base page. All other pages (everything in pages/) get a streamlit icon & title or no icon at all (world).

Reproducible Code Example

# this takes 2 files to reproduce...
# base_page.py is here:
import streamlit as st

st.set_page_config(page_title="Icon Test Main", page_icon='favicon.ico',
                   layout="wide", menu_items=None)

st.markdown("## Base Page")

# The second file (below) should be in a pages/ subdirectory
# pages/1_page1.py:
import streamlit as st

st.markdown("## Page 1")
# That's it!   (you'll also need a favicon... mine is 48x48)

Steps To Reproduce

  1. place a favicon.ico in the directory with base_page.py (download via curl -LO https://weka-repo-test.s3.us-west-2.amazonaws.com/favicon.ico - I can't upload it here. Or use your own)
  2. streamlit run base_page.py
  3. click between the pages and observe the tab icon (page_icon) and page title

Expected Behavior

The page_title and page_icon settings made with set_page_config() should be globally applied to all pages.

Since set_page_config() can only be used in base_page.py, the settings should be global, but the page_title and page_icon don't get set in any sub-pages.

Current Behavior

page_title and page_icon are not set on sub-pages

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version: streamlit-1.21.0
  • Python version: 3.11.3 and 3.8.12
  • Operating System: Rocky Linux 8.6 and MacOS 12.3
  • Browser: Chrome Version 112.0.5615.49 (Official Build) (arm64)
  • Virtual environment: venv

Additional Information

Download favicon.ico from here: https://weka-repo-test.s3.us-west-2.amazonaws.com/favicon.ico

Are you willing to submit a PR?

  • Yes, I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions