Admin Bar
Version 5.0.0
March 23, 2024
Added
- 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
"/"
Changed
- 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
- Fixed an issue with the asset build process removing spaces in CSS that shouldn’t have been removed. #42
Version 4.3.0
February 9, 2024
Added
- 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
- Removed unused logic around setting defaults for
fixed
andsticky
arguments.
Version 4.2.0
January 25, 2024
Added
- Link to Utilities page with a badge label showing number of utilities notifications.
- Added config option to disable Utilities link.
Changed
- Upgraded to Admin Bar Component 1.0.1 and updated dependencies
Version 4.1.0
January 14, 2024
Added
- 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.
Changed
- 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
Version 4.0.1
December 25, 2023
Changed
- 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!
Version 4.0.0
December 1, 2023
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
- 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.
Changed
- 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
- Fixed an issue preventing removing items from the Custom Links settings table field.
Removed
- 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.
Version 3.2.1
May 7, 2022
Fixed
- Fixed CHANGELOG link in
composer.json
Version 3.2.0
May 7, 2022
Version 3.1.11
October 31, 2019
Fixed
- Composer 2 compatibility #23
Version 3.1.10
November 28, 2019
Changed
- Bumped minimum Craft CMS requirement to
^3.3.16
Fixed
- Fixed Admin Bar appearing in Live Preview based on a change in Craft 3.2 (#16)
Version 3.1.9
November 28, 2019
Added
- 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
- Removed unused console commands
Version 3.1.8.1
April 29, 2019
Fixed
- Fixed a Twig bug introduced in 3.1.8
Version 3.1.8
April 27, 2019
Added
- 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
Changed
- Removed Vue component example in README and replaced it with a vanilla,
fetch()
-based Javascript example
Fixed
- Support for checking if the logged in user can edit an entry or category based on UID instead of user permissions. Thanks, Daniel Jagszent!
Version 3.1.7.1
April 16, 2019
Fixed
- Fixed a bug that occurred when you are not logged in to a site that has Admin Bar embedded
Version 3.1.7
April 15, 2019
Added
- 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
Changed
- "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
- 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
Version 3.1.6
May 10, 2018
Changed
- Changed "Logout" to "Sign out" to be consistent with Craft's CP Sign out link
Fixed
- Changed the method that registered Twig extensions
Version 3.1.5
February 16, 2018
Fixed
- Removed padding that caused a vertical scrollbar to appear
- Fixed an order of operations error (thanks to @sbossarte)
Version 3.1.4
February 10, 2018
Added
- 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
Changed
- 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
- 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.
Version 3.1.3
February 7, 2018
Added
- 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
Changed
- Replaced include CSS and JS pattern with new
{{ addAdminBarCss() }}
and{{ addAdminBarJs() }}
Twig tags
Fixed
- Fixed bug that prevented clicking on widget buttons
Version 3.1.2
February 5, 2018
Fixed
- Quick bug fix
Version 3.1.1
February 5, 2018
Fixed
- Quick bug fix
Version 3.1.0
February 4, 2018
Added
- Admin Bar Widgets lets plugins add contextual content to the front-end
- Added more re-branding options with a new Custom CSS setting
Changed
- 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)
Fixed
- Added pointer cursor to mobile menu toggle
- Cleaned up and updated the
config.php
file (copy this toconfig/admin-bar.php
to use it)
Version 3.0.3
November 24, 2017
Added
- Added
{{ editlink() }}
Twig tag for adding Edit Links to your templates. - Added
entry
andurl
arguments to Edit Link Twig tag.
Changed
- Removed template variables, in favor of using
{{ adminbar() }}
and{{ editlink() }}
.
Fixed
- Support for Craft RC1. Thanks to @MakeilaLundy for fixing translation bugs.
Version 3.0.1
May 29, 2017
Added
- Added option to turn off the section title shown in the default Entry/Category edit link.
Changed
- 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
- Fixed detection of default Entry or Category when using
{{ adminbar() }}
.
Version 3.0.0
February 6, 2017
Added
- Added
{{ craft.adminbar.canEmbed }}
to check if Admin Bar or Edit Links can be embedded. - Added
bgColor
andtextColor
settings.
Changed
- 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.