- Issue created by @dieterholvoet
- Merge request !231Issue #3345842: Remove the 'Back to site' link on admin-only sites. โ (Open) created by dieterholvoet
- Status changed to Needs review
over 1 year ago 3:29pm 3 March 2023 - ๐ง๐ชBelgium dieterholvoet Brussels
gin_preprocess_breadcrumb
contains some logic to set the 'Back to site' link to the canonical (view) route of the current entity if you're e.g. on the entity view/edit/delete pages. That doesn't really make sense IMO since there's always the View tab on these kind of pages, I doubt anyone really uses the 'Back to site' link to go to the canonical route of the current entity.I'm removing this logic since it also stands in the way of not showing the 'Back to site' link on admin-only sites, because the data-gin-toolbar-escape-admin data attribute currently isn't always added which means that the JS logic isn't always triggered.
- ๐จ๐ญSwitzerland saschaeggi Zurich
@DieterHolvoet
I doubt anyone really uses the 'Back to site' link to go to the canonical route of the current entity.
So it seems this change is based on your assumption as you don't use this feature (for your use case). But we clearly added this based on content editors feedback.
The expected logic is as follows:
โ If you come from a non admin route the ยซBack to siteยป link will lead you back to where you came from
โ If you're in the admin directly and it leads you to the ยซViewยป of that entityIf that's not the logic you would like to have it might be better if you handle it for your specific use case requirements in an override/hook instead. But maybe I did misunderstand the efforts here, than letting me know, otherwise I think we should close this request.
Cheers!
- Status changed to Needs work
over 1 year ago 4:09pm 3 March 2023 - ๐ง๐ชBelgium dieterholvoet Brussels
Okay, I'll keep the canonical entity route logic and try to work with it. The use case of not showing the 'Back to site' link on admin-only sites still stands.
- Status changed to Needs review
over 1 year ago 4:52pm 3 March 2023 - ๐ง๐ชBelgium dieterholvoet Brussels
Fixed! In my use case I blocked access to the node/user canonical routes because I didn't need them anyway (admin-only site). Had to do some changes to the template and styles to stop assuming the first breadcrumb item is the 'Back to site' link.
- Status changed to Needs work
over 1 year ago 9:36am 22 August 2023 - First commit to issue fork.
Based on the comment #saschaeggi , Tested the comment #9 solution for the issue. points covered in the in comment. attached images for reference.
1. Remove the 'Back to site' link from
js/toolbar.js
if the escapeAdminPath session variable is empty.
2. 'Back to site' link theming fix.
3. Just 2 commit for issue in MR.Before MR
After MR
- Status changed to RTBC
about 1 year ago 8:28am 12 October 2023 - ๐ฎ๐ณIndia vsheokeen NCR
This seems to be working after testing. Chaning its status.
- First commit to issue fork.
- Status changed to Needs work
12 months ago 8:35pm 30 November 2023 - ๐ฎ๐ณIndia saurabh-2k17
Hi, I tried to use the diff, but it is not working. Changing the status back to Needs Work.
- ๐ง๐ชBelgium dieterholvoet Brussels
@saurabh-2k17 can you please elaborate on how you tested and what exactly wasnโt working?
- ๐ฎ๐ณIndia saurabh-2k17
Hi @DieterHolvoet thanks for your quick response! Much Appreciated
After applying the patch, I referred to the comment on #10. As per that, I should not see the Back to site link after logging in as Administrator and visiting the content listing page or similar, but I could see it. The only time I was not seeing the link was, when I was visiting a 403 page (without logging).
- First commit to issue fork.
- ๐บ๐ธUnited States jeffschuler Boulder, Colorado
Sorry, I'm a still dumdum when it comes to d.o./gitlab integration. My intent was to merge the latest gin 8.x-3.x into the issue branch after resolving conflicts manually, but it looks like it has created a new MR.
At any rate these changes are also not removing the Back to Site button for me.
- Status changed to Needs review
4 months ago 9:20pm 22 July 2024 - ๐บ๐ธUnited States jeffschuler Boulder, Colorado
Ah, I see that the changes in the MR allow me to style that item directly, so in my CSS overrides I can just hide it:
.gin-breadcrumb__item--back-to-site { display: none !important; }
- Assigned to jeffschuler
- ๐บ๐ธUnited States jeffschuler Boulder, Colorado
The addition/modification of classes here in order to enable the removal of Back to site via CSS is useful.
The change in JS to remove the element entirely if
escapeAdminPath
is NULL not as clear. There is already logic for determining whether Back to site / etc. is added ingin_preprocess_breadcrumb()
. Additional conditional logic for that deserves to be there (instead of JS) if possible.And, as evidenced by Sascha's comments in #5, the question of whether to remove the element entirely is a lot more debate-able.
Incoming commit to MR!231 to remove those JS changes and constrain this issue to just allow styling of the link.
- ๐บ๐ธUnited States jeffschuler Boulder, Colorado
jeffschuler โ changed the visibility of the branch gin-3345842-3345842-remove-the-back to hidden.
there is some issue after switching the branch drupal site stop running so i tried the changes manually and it worked for me
RTBC +1
- ๐บ๐ธUnited States jeffschuler Boulder, Colorado
Thanks @saurav-drupal-dev!
Just to clarify (& confirm): the patch alone doesn't remove back-to-site button for you, correct?
Only if-and-when you also add some custom styling?If so, and if you do deem it RTBC, please change issue status to RTBC.
Thanks!