Problem/Motivation
The tour module can be automatically started on page load by adding "?tour=1" to the URI. But in a lot of cases you only want to start the tour module once: the first time the user uses this new functionality.
Proposed resolution
Add an extra property to the yml config "show_only_once". This value can be TRUE or FALSE. When FALSE, the tour functionality does what is does in it's current state. When TRUE, the module sets a cookie for this (anonymous) user, indicating the tour has been showed (and completed). Next time when user goes to www.site.com/?tour=1, the tour won't start unless the "tour" button is clicked explicitly.
Remaining tasks
Implement new yml config property
User interface changes
None
API changes
Documentation on how to use this new property
Edit: I'm in the process of creating this patch. But I'm stuck on one thing: how can you update a config entity, without re-installing the module?
Comment | File | Size | Author |
---|---|---|---|
#36 | interdiff_35-36.txt | 5.38 KB | ranjith_kumar_k_u |
#36 | 2850391-36.patch | 14.8 KB | ranjith_kumar_k_u |
#35 | 2850391-31.patch | 14.5 KB | miguel.leal |
#30 | interdiff_27-30.txt | 7.95 KB | raman.b |
#30 | 2850391-30.patch | 12.89 KB | raman.b |
Comments
Comment #2
robin.ingelbrecht CreditAttribution: robin.ingelbrecht at EntityOne commentedComment #3
shadcn CreditAttribution: shadcn at Chapter Three commented@robin.ingelbrecht you will need an update hook. https://www.drupal.org/docs/8/api/update-api/introduction-to-update-api-...
Comment #4
saurabh.tripathi.cs CreditAttribution: saurabh.tripathi.cs as a volunteer and at Faichi Solutions Pvt Ltd for Faichi Solutions Pvt Ltd commentedComment #5
robin.ingelbrecht CreditAttribution: robin.ingelbrecht at EntityOne commentedHere is a first try to implement this functionality.
Comment #6
nod_I'd rather have this in localStorage. A cookie seems overkill (we had a couple of issues for removing several cookies from D7 to D8). This cookie would bust a varnish type of cache.
We can add the list of only once tour in drupalSettings and check that on the frontend. No need to involve the backend for this, especially since the tours are not actually removed from the page, they're just prevented from starting.
Comment #7
robin.ingelbrecht CreditAttribution: robin.ingelbrecht at EntityOne commentedI guess you're right. I will move the functionality to the font-end
Comment #8
saurabh.tripathi.cs CreditAttribution: saurabh.tripathi.cs as a volunteer and at Faichi Solutions Pvt Ltd for Faichi Solutions Pvt Ltd commentedComment #9
robin.ingelbrecht CreditAttribution: robin.ingelbrecht at EntityOne commentedMoved storage from cookie to localStorage.
Also added the list of tours to drupalSettings and moved backend code to frontend.
Comment #10
robin.ingelbrecht CreditAttribution: robin.ingelbrecht at EntityOne commentedComment #11
robin.ingelbrecht CreditAttribution: robin.ingelbrecht at EntityOne commentedPatch in #9 was not ok in case multiple tours are loaded . Settings were overriden
Comment #12
sarmiliboyz CreditAttribution: sarmiliboyz commentedcurrent active development branch is 8.4.x-dev
Comment #13
jofitz CreditAttribution: jofitz at ComputerMinds commentedRe-rolled for 8.4.x
Comment #21
ridhimaabrol24 CreditAttribution: ridhimaabrol24 at Srijan | A Material+ Company for Drupal India Association commentedRerolling patch for 9.1.x
Comment #22
ridhimaabrol24 CreditAttribution: ridhimaabrol24 at Srijan | A Material+ Company for Drupal India Association commentedTrying to fix some failed tests.
Comment #23
ridhimaabrol24 CreditAttribution: ridhimaabrol24 at Srijan | A Material+ Company for Drupal India Association commentedFixing the error.
Comment #25
nod_the .js file is generated automatically, it is the
tour.es6.js
file that needs to be modified, and then runyarn run build:js
. See this documentation to see all there is to know about working with js in core: https://www.drupal.org/docs/frontend-developer-tools-for-drupal-coreComment #26
sd9121 CreditAttribution: sd9121 at QED42 commentedComment #27
sd9121 CreditAttribution: sd9121 at QED42 commentedComment #29
sd9121 CreditAttribution: sd9121 at QED42 commentedComment #30
raman.b CreditAttribution: raman.b at OpenSense Labs commentedResolving failed tests cases and coding standard issues from #27
Comment #35
miguel.leal CreditAttribution: miguel.leal commentedUpdated patch with the new shepherd version.
Comment #36
ranjith_kumar_k_u CreditAttribution: ranjith_kumar_k_u at Zyxware Technologies commentedComment #40
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.