Problem/Motivation
Anonymous users cannot start Tours. Currently Tours can only be started by clicking a button in the toolbar, and typically anonymous users have no permission to access the toolbar.
Proposed resolution
Provide a block with a button to start a Tour. This block can then be freely placed anywhere in the website.
How to test
- Grant permission to access tours and the views UI (lol) to the authenticated and/or anonymous user role.
- Place the block in the sidebar.
- Log in as a test user and visit admin/structure/views.
- Click on a view to access it.
- Click the tour button in the sidebar.
- Or visit ie http://drupal.d8/admin/structure/views/view/frontpage?tour=1 (as both authenticated or anonymous
Remaining tasks
User interface changes
None.
API changes
None.
Data model changes
None.
Original report by clemens.tolboom
As the tour icon is only available on the Toolbar anonymous users must get access to the Tour icon.
Without the 'Use the administration toolbar' the tour code is not loaded on the page so even an auto start like http://drupal.d8/?tour=1 fails.
Having the toolbar enabled the user get an access denied for the 'Menu' button.
Comment | File | Size | Author |
---|---|---|---|
#103 | tour-block-no-css-2069073-103.diff.txt | 171 bytes | thejimbirch |
#103 | tour-block-no-css-2069073-103.patch | 6.02 KB | thejimbirch |
Comments
Comment #1
clemens.tolboom[edit]The quirks are resolved.[/edit]
The main issue is still applicable.
Comment #5
pfrenssenA good idea could be to provide a block with the button that site builders can place wherever they want.
Comment #6
clemens.tolboomI'm not sure why the image wasn't embedded. Now I see it the screenshot was not from anonymous. Argh. Trying to reproduce I failed misarably.
What route should we use to add one to the frontpage? Or node/1?
@pfrenssen your suggestion 'adding a block' sound great! It adds the possibility to theme it thus making it more prominent.
Comment #8
pfrenssenWe are interested in providing a Tour for anonymous users in our project so I am going to start on this.
I'm retitling this and transforming it into a feature request since solving it with a block feels more like a feature addition than a bugfix. This means that this will be for 8.5.x at the earliest, but it is very likely that the patches will also work on 8.4.x.
Comment #9
pfrenssenStarting off by creating a simple block that now shows the button on every page. It is already able to launch the tours if we are on a tour-enabled route.
Next step will be to only show the block on tour-enabled routes.
Comment #10
pfrenssenInteresting, so it actually already works as it should, since the showing / hiding of the button is handled in JS. I just added an access control here so the button will not be loaded if the user doesn't have permission to view tours.
This is going pretty smoothly. Next step is providing a test.
Comment #11
pfrenssenSome small improvements:
Comment #12
pfrenssenAdded a test. I opted for a JS test since none of the tour functionality was actually tested in a JS enabled browser. Now this also asserts that the tour tips actually become visible when the tour button is clicked, not just that they are present in the HTML.
Comment #13
pfrenssenExtended the test a bit to make sure the tour button doesn't show up on pages that do not offer a tour.
Comment #14
idimopoulos CreditAttribution: idimopoulos as a volunteer commentedTested it and works as designed! The tour button is properly placed.
Patch seems fine to me.
Moving to RTBC.
Comment #15
borisson_Can't we use
$this->t(
instead of a regulart
here?This can be {@inheritdoc} instead of the complete doc.
Comment #16
piyuesh23 CreditAttribution: piyuesh23 at QED42 commented@borisson_, we can definitely use $this->t() in here given this is a custom block plugin. Also, since we not overriding the doc comment here in any specific way the docblock in the base class BrowserTestBase makes more sense.
Uploading an updated patch here.
Comment #17
borisson_Awesome, this was already rtbc in #14 and the nitpicks I found were fixed. so back to rtbc it is.
Comment #18
xjmI think this is a great idea. (Providing the toolbar to anonymous users has funny results indeed, which is a separate bug.)
I tested this patch with the following steps:
admin/structure/views
.A few improvements I think we should make:
This can be done with:
That might be a separate issue scope, not sure. It might be a followup. But I think we should at least provide a border for the tips in Bartik in this patch so that they're not totally confusing and broken-looking (since this patch will remove the assumption that Tour pages only show up on administrative routes).
Thanks!
Comment #19
pfrenssenI tried my hand at some basic styling. My frontend chops are very poor so I just shamelessly stole the CSS from the Toolbar module :D
This is how the tour button now looks in Bartik:
And the balloons:
We can indeed further refine the styling in a followup.
Comment #21
pfrenssenComment #22
sardara CreditAttribution: sardara at Randstad Digital for European Commission and European Union Institutions, Agencies and Bodies commentedMaybe we can add a class in here, so we can target the element through that, instead of using the element type directly.
Maybe we can even use ".button", so we inherit the button styles present already.
This can be squeezed into a single line declaration.
Comment #23
pfrenssenAddressed the remarks:
background-size
. I read the documentation of the CSS3 background property but it is not very comprehensive on the sizing part. I tried a few things like "center/100% center/auto" but in the end the only thing that worked reliably is splitting it off on a second line. The other properties were no problem.Comment #24
idimopoulos CreditAttribution: idimopoulos as a volunteer commentedI would move ahead with it but I think the #2935334: Theme tour help balloons should be merged in first. An admin can already set batrik as the admin theme but it's not very common. This change can make it easy for a lot of tours to be created.
Comment #25
larowlanthis feels out of scope, but flagging for the front-end framework managers to review css
also, can we can get an IS update to indicate the solution - uses a block
Comment #26
xjm@larowlan, I think it needs to be in scope because of the visual bug; see #18. I was actually thinking we should also maybe additionally put a border by default in the module's CSS, so that other themes don't have tour tips bleeding into the background in a hard-to-read way.
Comment #27
xjmHm, patch is also adding CSS to Stable which I think might be considered a BC break. (Safe places to put it might be the module or the internal themes.) Not sure what the policy is on adding classes to Stable to new UI elements. Edit: Also, at least, I think the styles should go in Classy and not stable?
Comment #28
lauriiiStable is supposed ship with a minimum required CSS (only functional CSS). If we'd want to add these styles to the base themes, it should be inside Classy as pointed by @xjm on #27.
I would suggest that we leave all of the design decisions like this one for the themes themselves, meaning that we only apply this design in Seven and Bartik. The styles the latest patch adds for the button in Stable could be used as a base for the Seven and Bartik styles.
I agree with #18 that button with a text "Tour" can be confusing. Rather than adding the question mark, could we solve this by changing the wording for something more descriptive such as "Start a tour"?
Anyway, I reviewed the CSS code and by itself, it looks fine to me. Since there's some design involved with this, It would be great to get a UX team, and potentially later a product manager to review the design.
Comment #29
pfrenssenUpdated the issue summary.
Comment #30
pfrenssenLet's indeed change this to "Start a tour" and also make the text configurable in the block options.
Comment #31
pfrenssenSmall clarification of @lauriii's comment in #28. My understanding is that he suggests to NOT move the basic styling into the 'classy' theme, but rather move it directly into Seven and Bartik.
In general, basic styling for cosmetic purposes should be in Classy and not in Stable, so that it can be inherited by core themes and custom themes built on top of Classy. But this is a special case. These balloons can be implemented in very different ways, so any basic theming being present in Classy will just get in the way of custom themes and would need to be overridden.
So this means we will have duplication of the styling between Seven and Bartik, but that's an acceptable compromise.
Comment #32
idimopoulos CreditAttribution: idimopoulos as a volunteer commentedWhat about "Take a tour"? I don't know but it seems to me better than the "Start a tour" especially with the question mark in front.
Comment #33
pfrenssenComment #34
lauriii"Take a tour" as well sounds good for me.
Comment #35
idimopoulos CreditAttribution: idimopoulos as a volunteer commentedAlso, regarding the basic styling for batrik theme, a bit further refinement is needed. I tried the honeypot tour and the following two things happened:
1. When the tour box is below the target element, there is a small overlap as shown in the attached picture. These are only a few pixels though.
2.
When the tour box is above the element, and the window repositions, and the tour is high enough, a bit of text moves above the screen.This behaviour occurs also in the seven theme. The full window is not shown but the window is repositioned for the main content of the tour window.Also, sometimes it is not clear the element that the tour targets.
All these need to be fixed as for basic functionality.
Comment #36
idimopoulos CreditAttribution: idimopoulos at European Commission and European Union Institutions, Agencies and Bodies commentedChanges included:
Hope I did not forget anything.
The image contains the styled nub.
Comment #37
idimopoulos CreditAttribution: idimopoulos as a volunteer commentedComment #38
idimopoulos CreditAttribution: idimopoulos at European Commission and European Union Institutions, Agencies and Bodies commentedFix a minor remark.
Comment #40
clemens.tolboomAdded the test steps
Comment #41
clemens.tolboomVisiting http://drupal.d8/admin/structure/views/view/frontpage?tour=1 as anonymous works.
I missed the overlay background so added that
I don't understand the differences between
I found at least the tips lacking for bartik
Comment #43
idimopoulos CreditAttribution: idimopoulos at European Commission and European Union Institutions, Agencies and Bodies commented@clemens.tolboom your patch failed because you did not branch off my latest one and it was one with a leftover in the tests (sorry for that, I hid that file).
Thanks for the background set.
The differences from
diff core/themes/bartik/css/components/tour.theme.css core/themes/seven/css/components/tour.theme.css
are simple theming. As I mentioned above and as @laurii and @xjm noted, decisions on the design should not be picked up without someone from the design team have a say. So what I did is I tried to re-use whatever already exists so that nothing seems as new design decisions.This means that the colours should also match the respective theme colours. So the arrow is filled with the colour of the border of the tour box which in the specific case is
#ccc
.For example, I do not mind that you added the background for the case that is a generic text. I did not forget it, it just didn't exist before (it did in the Seven theme only) so I didn't want to mess with the FE implementation of the thing that much. But if this is accepted, indeed it looks nicer.
In any case, please update your patch to start off the latest patch (2069073-38.patch)
Comment #44
clemens.tolboomI'm sorry I took the wrong file :-( ...I'll try to find time. #41 is now hidden.
Comment #46
idimopoulos CreditAttribution: idimopoulos at European Commission and European Union Institutions, Agencies and Bodies commentedFollowing up @clemens.tolboom remarks.
Comment #47
idimopoulos CreditAttribution: idimopoulos at Randstad Digital for European Commission and European Union Institutions, Agencies and Bodies commentedComment #48
clemens.tolboom- Overlay is now styled as an overlay.
- Design wise the bartik variant is ok as we have #2935334: Theme tour help balloons and button
Comment #49
xjmIt looks like we should have a usability review or what exactly the block should be displayed. After that we should probably have Lauri look at it again too. Thanks!
Comment #51
clemens.tolboomHmmm ... the code sniffer reports about an untouched file AFAIKS. Should we comply?
The patch contains 1 item out of 6
Checking the https://www.drupal.org/pift-ci-job/866976 it has (Errors and) 6 coding style issue.
Next test https://www.drupal.org/pift-ci-job/868774 has 6 coding style issues.
Comment #52
lauriiiWe should add a data attribute or js- prefixed class to ensure that developers are aware that the element has JS attached to it.
Comment #53
pfrenssen@lauriii good idea, can you suggest a good class or data attribute to use?
Comment #54
lauriii@pfrenssen How about
js-tour-start-button
?Comment #55
pfrenssenGreat suggestion!
Comment #56
pfrenssenComment #57
lauriiiWe could use the js prefixed selector added in the most recent version of the patch here as well 🙌 Other than that everything looks good for me ✨
Comment #58
Dinesh18 CreditAttribution: Dinesh18 as a volunteer commentedHere is the interdiff and patch based on the comment #57.
Comment #60
pfrenssenThis should fix the test failure.
I'm wondering if this actually still need a usability review? The block only shows the toolbar button and it can be placed anywhere the site builder wants it.
Comment #62
claudiu.cristeaStraight reroll of #60.
Comment #64
claudiu.cristeaFix the test.
Comment #65
claudiu.cristeaNo, this needs no usability review. This is a block that shows the same button as in the toolbar.
I only did a reroll and a very small change to use
WebDriverTestBase
instead of the deprecated one. We tested this block and we're already running it for anonymous users in our project, in production. All the previous concerns and remarks were addressed. So, RTBC.Comment #67
lauriiiI do still think that we should get someone design oriented to review the new components this issue introduces. This doesn't use the pre-existing button styles, but rather introduces something new. If this would be just about using pre-existing components we have, we wouldn't necessarily need a review.
We should remove the block class name from the selectors since it should be possible to place the tour button outside the block.
Comment #68
claudiu.cristeaComment #69
claudiu.cristeaI split the triggering element selector in #3012027: Decouple tour triggering from the toolbar.
Comment #70
maboresev CreditAttribution: maboresev at SDOS commentedHello,
I've trained to apply this patch at 8.6.3 version of Drupal Core and it fails. In 8.7-dev version it works properly.
I've made a patch with the Tour Block which applies on 8.6.3 version.
Please, check it. It has no tests nor CSS.
Comment #71
pfrenssenThanks @maboresev for rolling this against 8.6.3. Unfortunately since this is a feature request this won't be accepted for Drupal 8.6.x which only receives bug fixes. New features are developed against the next release of Drupal core, so I will set this back to 8.7.x.
The current patch is the one from #64.
Comment #72
clemens.tolboomComment #74
jncrucesThe previous patch submitted on #64 not working with 8.8.x branch.
The attached patch is the same but corrected with the changes on the original file.
I can't attach the interdiff file because it fails on creation because both patches are of different versions of the original files.
The patch attached on #64 not work with 8.7.1, for this reason I hide it.
Greetings.
Comment #75
yogeshmpawarSetting back to Needs Review & Triggering bots.
Comment #77
fprevos2 CreditAttribution: fprevos2 at University of Ottawa commentedPatch in #74 works for me, thanks.
Comment #78
TomSaw CreditAttribution: TomSaw commentedApplied #74 and works fine!
You need to clear your browser cache, otherwise the required java is not loaded
Thanks for the patch :)
Comment #80
psf_ CreditAttribution: psf_ at Front ID commentedWork for me in Drupal 8.9.1, but the tests don't complete.
Comment #81
ridhimaabrol24 CreditAttribution: ridhimaabrol24 at Srijan | A Material+ Company for Drupal India Association commentedRerolling patch for 9.1.x!
Comment #83
ridhimaabrol24 CreditAttribution: ridhimaabrol24 at Srijan | A Material+ Company for Drupal India Association commentedFixing test cases!
Comment #84
paulocsPatch #83 looks good to me.
Set to RTBC.
Comment #85
paulocsActually I think we need Usability review before commit it. Am I right?
I'll set back to needs review
Comment #86
coaston CreditAttribution: coaston commentedIs there any update? When it will be available for drupal core update? Dont want to aply the patch for the core modules.
Comment #88
robin.ingelbrecht CreditAttribution: robin.ingelbrecht at EntityOne commentedWould be nice if we would be able to configure the button label?
Comment #89
gwvoigtAny luck with 8.9.10? Seems like none fo the patches work for this version
Comment #90
eit2103 CreditAttribution: eit2103 commentedSame here, been waiting for this to be included in core for a while now.
Comment #92
jimmynash CreditAttribution: jimmynash commentedThe patch in #83 applied to 8.9.13 for me with a little offset. This patch really helps with doing custom tours since we don't have to rely on the menu link and can use the block.
Comment #93
thejimbirch CreditAttribution: thejimbirch at Kanopi Studios commentedIn Drupal 9.2+ there are some pretty significant changes to Tours in core. The jQuery Joyride library has been deprecated and replaced with Shepherd JS.
This issue may be effected.
Deprecate and replace jQuery Joyride (for tours)
Issue: https://www.drupal.org/project/drupal/issues/3051766
Joyride library deprecated
Change Notice: https://www.drupal.org/node/3195234
Tour schema properties 'location' and 'attributes' deprecated
Change Notice: https://www.drupal.org/node/3204093
Comment #94
f0ns CreditAttribution: f0ns as a volunteer commentedFYI - Patch & functionality works perfectly on Drupal 9.2.4
edit 1: also works on 9.2.5
edit 2: also works on 9.2.6
Comment #95
f0ns CreditAttribution: f0ns as a volunteer commentedComment #96
thejimbirch CreditAttribution: thejimbirch at Kanopi Studios commentedIgnore this patch, it was not correct.
Comment #97
thejimbirch CreditAttribution: thejimbirch at Kanopi Studios commentedComment #98
thejimbirch CreditAttribution: thejimbirch at Kanopi Studios commentedok, trying this again.
Attaching a reroll of the patch in #83 that removes the styling, and adds the
.button
class instead of the.tour-button
class.?
icon IMHO.tour/tour-styling
library.Comment #99
thejimbirch CreditAttribution: thejimbirch at Kanopi Studios commentedComment #100
benjifisherThe testbot shows that there are some coding standards issues. That is what "Custom commands failed" means, and it also means that other tests were not run. One of these days, the testbot will set issues to NW in this case, but for now I will do that manually.
Comment #101
yogeshmpawarResolved CS issues
Comment #103
thejimbirch CreditAttribution: thejimbirch at Kanopi Studios commentedUpdated the patch to add the
button
class which I thought I had added in #98.Comment #106
thejimbirch CreditAttribution: thejimbirch at Kanopi Studios commentedPer discussion in Drupal Usability Meeting 2021-12-03, using the .button class and not adding additional CSS negates the need for a UX review/approval.
It was suggested to check with A11Y team, which I will queue.
Removing UX tags, adding A11Y review tag.
Comment #109
smustgrave CreditAttribution: smustgrave at Mobomo commentedThis sounds interesting wonder if the accessibility team had a chance to take a look.
Comment #110
smustgrave CreditAttribution: smustgrave at Mobomo commentedShould this be closed for #3012027: Decouple tour triggering from the toolbar?
Comment #112
quietone CreditAttribution: quietone at PreviousNext commentedThis extension is being deprecated, see #3336033: [Meta] Tasks to deprecate Tour module. It will be removed from core and moved to a contrib project, #3376099: [11.x] [Meta] Tasks to remove Tour.
This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
Comment #113
quietone CreditAttribution: quietone at PreviousNext commented