statamic / ideas

đŸ’¡Discussions on ideas and feature requests for Statamic
https://statamic.dev
32 stars 1 forks source link

Frontend admin bar #1259

Open godismyjudge95 opened 2 weeks ago

godismyjudge95 commented 2 weeks ago

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:

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 commented 2 weeks ago

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 commented 2 weeks ago

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 commented 1 week ago

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