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

Cannot set page title #3049

Closed
josselex opened this issue Dec 27, 2021 · 9 comments · Fixed by #3290
Closed

Cannot set page title #3049

josselex opened this issue Dec 27, 2021 · 9 comments · Fixed by #3290
Milestone

Comments

@josselex
Copy link

josselex commented Dec 27, 2021

Using panel 0.12.6

I cannot set the title of the site. I use panel serve.

However I cannot find the proper way of setting the page title. It is always "Panel Application"
For example this does not work:

import panel as pn
pn.extension(sizing_mode='stretch_width')
template = pn.template.FastGridTemplate(
    site="Panel", title="FastGridTemplate",
    sidebar=[pn.pane.Markdown("## Settings")],
)
template.servable()
@jbednar
Copy link
Member

jbednar commented Dec 27, 2021

template.servable("Title") ?

@josselex
Copy link
Author

template.servable("Title") ?

Thanks. Indeed this works. And also my code above.

It does not work however when there is another servable in the document. I think this was the error.

@josselex
Copy link
Author

Is there a proper way to do it? Is this intended behaviour?

@jbednar
Copy link
Member

jbednar commented Dec 27, 2021

Not sure. Try adding the same title to all servable calls?

@josselex
Copy link
Author

Indeed, it works when adding the title just to the last call.
My suggestion: Maybe the title should not get overwritten if nothing is passed explecitly.

@MarcSkovMadsen
Copy link
Collaborator

I cannot reproduce the problem (using Panel: 0.12.6).

If I run the initial script the title is there.

image

import panel as pn
pn.extension(sizing_mode='stretch_width')
template = pn.template.FastGridTemplate(
    site="Panel", title="FastGridTemplate",
    sidebar=[pn.pane.Markdown("## Settings")],
)
template.servable()

@josselex
Copy link
Author

I cannot reproduce the problem (using Panel: 0.12.6).

If I run the initial script the title is there.

Indeed it works. The problem was caused by another .servable() call below.

MY proposed solution would be that other servable calls do not override the title (to be the default) unless a title is explicitely given there with .servable(title=...)

@philippjfr philippjfr added this to the v0.13.0 milestone Jan 4, 2022
@philippjfr
Copy link
Member

Here's what I'd propose:

  • The title on the template, if set, takes absolute precedence
  • If no title is set the last explicitly set .servable(title=...) takes precedence
  • .servable() without a title should have no effect on previously set titles

@josselex
Copy link
Author

josselex commented Jan 5, 2022

  • The title on the template, if set, takes absolute precedence

  • If no title is set the last explicitly set .servable(title=...) takes precedence

  • .servable() without a title should have no effect on previously set titles

I think this sounds reasonable and intuitive.

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

Successfully merging a pull request may close this issue.

4 participants