All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Added support for Craft 5
- An icon is shown when no utility notifications are shown
- An icon is shown when a custom url is set to
"/"
- The
{{ adminBar() }}
Twig method now returnsnull
instead offalse
when Admin Bar isn’t rendered. - Updated Admin Bar icons to match Craft CMS’s CP icons
- Fixed an issue with the asset build process removing spaces in CSS that shouldn’t have been removed. #42
- Added
position
argument to{{ adminBar() }}
#40- When setting
{{ adminBar({ fixed: true, position: 'bottom' }) }}
Admin Bar will be fixed to the bottom of the page.
- When setting
- Removed unused logic around setting defaults for
fixed
andsticky
arguments.
- Link to Utilities page with a badge label showing number of utilities notifications.
- Added config option to disable Utilities link.
- Upgraded to Admin Bar Component 1.0.1 and updated dependencies
- Added
textElements
setting for the{{ adminBar() }}
method, letting you add text elements and labels to Admin Bar. - Added a text element label to indicate the current environment when
devMode
is enabled. - Added an option to
adminBarCssFile()
andadminBarJsFile()
Twig methods that lets you output the contents of the file, instead of getting the cpresources URL.
- Upgraded to Admin Bar Component 1.0.0
- When
useJs
is set totrue
the<script>
tag that loads Admin Bar’s JS is set todefer
.- To avoid this, set
useJs
tofalse
and load Admin Bar’s JS file using{% js adminBarJsFile() with { type: 'module' } %}
.
- To avoid this, set
- Custom CSS that is set on the Admin Bar plugin settings page no longer gets registered when
useCss
is set tofalse
.- The Custom CSS will now get loaded whenever the
adminBarOnPageCss()
is called.
- The Custom CSS will now get loaded whenever the
- Removed rounded corners and margin on buttons so that the "flat" style is the default.
- Moved the icon SVG code into the Admin Bar main template—making it easier to load Admin Bar via Sprig or Blitz dynamic includes. Thanks to alexr on the Craft CMS Discord for the idea!
{warning} Admin Bar’s composer package name has changed from
wbrowar/adminbar
towbrowar/craft-admin-bar
. Update your composer.json to point to the new package on Packagist.
- Added static translations for all strings on admin bar.
- Added
rtl
config option that can be passed intoadminBar()
asadminBar({ rtl: true })
.- NOTE: Admin Bar will automatically adjust when the page reading direction is set to
rtl
, so this option is here for situations where you have to manually set it.
- NOTE: Admin Bar will automatically adjust when the page reading direction is set to
- Added
force
option toadminBar()
, bypassing the default check to see if Admin Bar can be rendered. - When rendering
{{ adminBar() }}
results in an error, the error is caught and contained for easier debugging. - All PHP classes are now documented with updated comments.
- Admin Bar is now rendered as a web component, Admin Bar Component, instead of via a Twig template and custom JavaScript.
- It’s rendered via the Shadow DOM, which means that Admin Bar is less likely to be affected by your front-end’s CSS.
- More CSS Custom Properties can be changed to customize the look of Admin Bar.
- The
adminbar()
twig function has been deprecated and changed toadminBar()
to better follow Craft Twig naming conventions. - Changed all CP URLs to use the
cpUrl()
Twig method, instead ofurl()
. - Changed the Custom CSS text area field into a Craft Code Editor field.
- Changed all instances of
adminbar
withadmin-bar
orcraft-admin-bar
, where applicable.
- Fixed an issue preventing removing items from the Custom Links settings table field.
- Removed any code related to deprecated "Admin Bar Widgets" feature.
- Removed any code related to deprecated "Edit Links" feature.
- Removed the
category
config option foradminBar()
- Removed
addAdminBarCss
Twig function. - Removed
addAdminBarJs
Twig function. - Removed
editlink
Twig function. - Removed
getAdminBarAssets
Twig function. - Removed
enableMobileMenu
config option. - Removed
clearAdminBarCache
method from Bar service. - Removed
renderAdminBarForUri
method from Bar service. - Removed
AdminBarRenderEvent
event. - Removed
BarController
controller.
- Fixed CHANGELOG link in
composer.json
- Craft 4 compatibility #28
- Removed Edit Links and Admin Bar Widgets
- Composer 2 compatibility #23
- Bumped minimum Craft CMS requirement to
^3.3.16
- Fixed Admin Bar appearing in Live Preview based on a change in Craft 3.2 (#16)
- You can now set the Edit Link to a custom URL or URI (it will be run through the
url()
Twig function). (#15) - The label for the Edit Link can be set to a custom string when setting a custom Edit Link URL.
- Removed unused console commands
- Fixed a Twig bug introduced in 3.1.8
- You can switch from CSS
position: sticky
toposition: fixed
by passing in{ fixed: true }
- NOTE: Passing in
{ sticky: false }
usesposition: relative
by default
- NOTE: Passing in
- When using Javascript to embed Admin Bar, a
params
object can be passed in to pass arguments into the rendered Admin Bar
- Removed Vue component example in README and replaced it with a vanilla,
fetch()
-based Javascript example
- Support for checking if the logged in user can edit an entry or category based on UID instead of user permissions. Thanks, Daniel Jagszent!
- Fixed a bug that occurred when you are not logged in to a site that has Admin Bar embedded
- Added Guide link if the Guide plugin is installed and enabled and the user can access the Guide CP section
- Added
displayGuideLink
to disable Guide link inadmin-bar.php
config file
- Added
- "Edit" links only appear for users who have access to edit the linked Entry or Category
- "Settings" link only appears when
allowAdminChanges
is set totrue
- Changed sticky CSS from
position: fixed
toposition: sticky
- Changed default Admin Bar background color
- Bumped minimum Craft version to 3.1.22
- Fixed an issue that displayed section name on the "Edit" link when
displayDefaultEditSection
was set tofalse
- Fixed an issue that added an asset bundle to the CP when it shouldn't have
- Changed "Logout" to "Sign out" to be consistent with Craft's CP Sign out link
- Changed the method that registered Twig extensions
- Removed padding that caused a vertical scrollbar to appear
- Fixed an order of operations error (thanks to @sbossarte)
- An Admin Bar Widget can now be invalidated using PHP via an Event that's called before widgets are loaded
- The title on Edit Links can now be overridden when
url
andtitle
are both passed in as config parameters
- Removed
--adminbar-color-bg-image
CSS variable and replaced it with--adminbar-bg
so you can set the entirebackground
shorthand CSS property - Removed need to pass
includeAssets
into{{ addAdminBarCss() }}
and{{ addAdminBarJs() }}
Twig tags
- Fixed an issue that duplicated
additionalLinks
when settings were saved through CP- If you're seeing duplicate
additionalLinks
, just re-save Admin Bar's plugin settings
- If you're seeing duplicate
- Set Edit Links on Edit Links widget to a fixed height
- Fixed a bug that loaded AdminBarAsset bundle files on the front-end
- Fixed an error that was thrown when
{{ getAdminBarAssets() }}
was called and there was no logged in user - Fixed a bug where the current logged in user photo was shown instead of the revision author's photo.
- Admin Bar can now be pulled into sites via HTTP Request (using jQuery, Axios, and other HTTP clients)
- Added
{{ getAdminBarAssets() }}
Twig tag that includes the CSS and Javascript for Admin Bar and its widgets - Added
--adminbar-color-bg-image
CSS variable
- Replaced include CSS and JS pattern with new
{{ addAdminBarCss() }}
and{{ addAdminBarJs() }}
Twig tags
- Fixed bug that prevented clicking on widget buttons
- Quick bug fix
- Quick bug fix
- Admin Bar Widgets lets plugins add contextual content to the front-end
- Added more re-branding options with a new Custom CSS setting
- Redesigned Edit Links to be more mobile friendly and more consistent with the look of Admin Bar
- Overhauled the CSS for Edit Links
- Changed much of the HTML and CSS for Admin Bar to make Admin Bar Widgets work
- Removed the
scrollLinks
andcacheBar
settings - Removed old color settings
- Replaced mobile menu toggle text with the Admin Bar icon (if you can think of a better icon idea, please suggest it)
- Added pointer cursor to mobile menu toggle
- Cleaned up and updated the
config.php
file (copy this toconfig/admin-bar.php
to use it)
- Added
{{ editlink() }}
Twig tag for adding Edit Links to your templates. - Added
entry
andurl
arguments to Edit Link Twig tag.
- Removed template variables, in favor of using
{{ adminbar() }}
and{{ editlink() }}
.
- Support for Craft RC1. Thanks to @MakeilaLundy for fixing translation bugs.
- Added option to turn off the section title shown in the default Entry/Category edit link.
- Moved check for user and user permission from template files over to Service.
- Removed Admin Bar and Edit Links from templates when in Live Preview.
- Fixed detection of default Entry or Category when using
{{ adminbar() }}
.
- Added
{{ craft.adminbar.canEmbed }}
to check if Admin Bar or Edit Links can be embedded. - Added
bgColor
andtextColor
settings.
- The default Admin Bar embed tag,
{% hook 'renderAdminBar' %}
, has been replaced with{{ adminbar() }}
. - Deprecated
color
settings and replaced it withhighlightColor
. - Color settings—
bgColor
,highlightColor
, andtextColor
—require CSS hex values.