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

Frontend admin bar #1259

Open
godismyjudge95 opened this issue Nov 6, 2024 · 3 comments
Open

Frontend admin bar #1259

godismyjudge95 opened this issue Nov 6, 2024 · 3 comments

Comments

@godismyjudge95
Copy link

It would be great if there was an option to enable a frontend admin bar.

I think the most straight forward solution would be to make it an internal tag like:

{{ statamic_admin_bar }}

This would allow for wrapping it in conditions based on whatever the developer wants:

{{ nocache }}
	{{ if is_super }}
		{{ statamic_admin_bar }}
	{{ /if }}
{{ /nocache }}

Ideally the admin bar would have the following base configuration:

  • CP link
  • Edit current page link
  • Current user name (maybe click to edit profile link)
  • Logout link

Additionally it would be nice if there was a way to extend the bar to add additional items to it (similar to how widgets work on the cp?) Or perhaps this would be handled by being able to publish the template - see below

It would be great if this admin bar was already styled in such a way that matched the cp but had options to disable/override the styling.

Finally, I think the tag should load a template similar to how the form fields have pre-rendered templates that can be published - https://statamic.dev/tags/form-create#prerendered-field-html
This would allow for maximum customization

@jasonvarga
Copy link
Member

jasonvarga commented Nov 7, 2024

You can DIY this pretty easily. Throw this in your layout:

<div>
    <a href="{{ edit_url }}">Edit this page</a>
    {{ if logged_in }}
        {{ user }} <a href="{{ edit_url }}">{{ email }}</a> {{ /user }}
        <a href="{{ user:logout_url }}">Log out</a>
    {{ /if }}
</div>

@godismyjudge95
Copy link
Author

You can DIY this pretty easily. Throw this in your layout:

<div>
    <a href="{{ edit_url }}">Edit this page</a>
    {{ if logged_in }}
        {{ user }} <a href="{{ edit_url }}">{{ email }}</a> {{ /user }}
        <a href="{{ user:logout_url }}">Log out</a>
    {{ /if }}
</div>

Yep this is what we do currently, would just be cool to have an out of the box solution

@aaronbushnell
Copy link

Something first-party would be cool! If you're looking for something comparable for the time being we made Palette which gives this type of experience: https://statamic.com/addons/trendyminds/palette

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

3 participants