Facet Update: Editable Permissions & Quick Admin Links

Introducing page.isEditable and Quick Admin Links

Facet Update: Editable Permissions & Quick Admin Links

This update introduces permission-aware template variables and admin utility URLs, making it easier to build editor-focused UI directly in the frontend.

These additions enable templates to determine whether the current user can edit a page and provide convenient access to administrative actions.


✨ New Features

page.isEditable

Facet now exposes a new template variable:


page.isEditable

This variable indicates whether the current user has permission to edit the current page.

It allows templates to conditionally render UI elements intended only for editors.

Example

{{#if page.isEditable}}
  <a href="{{ page.url }}?edit=1">Edit this page</a>
{{/if}}

Typical use cases include:

  • inline edit buttons
  • editor toolbars
  • contextual editing controls
  • page-level management tools

If the user does not have edit permission, the block will not render.


Admin URL Variables

Facet now provides additional site-level variables for common administrative links:

VariableDescription
site.adminUrlAdmin dashboard
site.adminProfileUrlAdmin profile page
site.adminLogoutUrlLogout URL

These variables simplify building frontend admin navigation without hardcoding backend paths.

Example

<a href="{{site.adminProfileUrl}}">Profile</a>
<a href="{{site.adminLogoutUrl}}">Logout</a>

A common use case for these additions is a quick admin toolbar displayed on the frontend for logged-in users.

This toolbar can provide shortcuts to common admin actions such as editing the current page, accessing the dashboard, managing pages, or logging out.

Example implementation:

{{#deferred skeleton-width="0" skeleton-height="0"}}
{{#if user.isLoggedin}}
<div
  class="uniui-admin-links fixed right-4 top-1/2 -translate-y-1/2 z-50"
  aria-label="Quick admin links"
>
  <div class="uniui-admin-links__group">

    {{#if page.isEditable}}
    <a href="{{page.url}}?edit=1" aria-label="Edit page">
      Edit
    </a>
    {{/if}}

    <a href="{{site.url}}faceflow/">Dashboard</a>

    <a href="{{site.url}}faceflow/pages-manage">Pages</a>

    <a href="{{site.adminProfileUrl}}">Profile</a>

    <a href="{{site.adminLogoutUrl}}">Logout</a>

  </div>
</div>
{{/if}}
{{/deferred}}

Behavior Summary

ConditionResult
User not logged inComponent not visible
Logged in without edit permissionAdmin links visible, edit button hidden
Logged in with edit permissionFull toolbar visible

This ensures that management UI is only available to authorized users.


Summary

This release adds new capabilities for building editor-aware frontend interfaces.

New template variables

  • page.isEditable

New site variables

  • site.adminUrl
  • site.adminProfileUrl
  • site.adminLogoutUrl

These improvements make it easier to integrate contextual editing and admin navigation directly into Facet templates while maintaining proper permission control.

kingleoric

kingleoric

First Article You're at the beginning
Next Facet: A Template Engine For FaceFlow

Discussion

Join the conversation and share your thoughts

No comments yet. Be the first to share your thoughts!