Problem/Motivation
The <front>
route name is not been used to match on route name for current route name
when a selected node had been set as the front page for the site
Steps to reproduce
Given that we have a custom tour for the home page
And we used the <front>
as the route to show the tour up
When we select a node as the front page like "/node/1" for the homepage
Then the tour icon in the toolbar will not show up
as the entity.node.canonical
is been returned by
// Load all of the items and match on route name.
$route_match = \Drupal::routeMatch();
$route_name = $route_match->getRouteName();
Proposed resolution
Check if the current matching path is the front page
and change the route name been passed to the tour Drupal entity query
To mach by route name not the entity.node.canonical
by a node which been selected as the front page settings.
We could add
// Check if the current matching path is the front page.
if (\Drupal::service('path.matcher')->isFrontPage()) {
$route_name = '<front>';
}
As the route is more important than any other route name when the page is the front page.
Remaining tasks
User interface changes
When we configure a tour for the <front>
page route
It will show up the icon for the Tour on the front page
even if we had other type of entities or selected entity as the front page.
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
Comment | File | Size | Author |
---|---|---|---|
#2 | 3165435-2.patch | 610 bytes | Rajab Natshah |
Comments
Comment #2
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commentedComment #3
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commentedComment #4
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commentedComment #5
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commentedComment #6
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commentedComment #7
vikashsoni CreditAttribution: vikashsoni as a volunteer and at Zyxware Technologies commented@RajabNatshah Patch apply successfully for me
Thanks ...
Comment #8
thejimbirch CreditAttribution: thejimbirch at Kanopi Studios commentedPatch applies cleanly, but I was unable to get the Tour to load on a node set as the home page.
Here are the steps I took to try to validate this. I may be missing something, or misconfiguring.
Comment #9
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commentedThanks, Jim for reviewing and testing
Using the #2 patch in
#3164237: Fix Varbase Welcome message not showing up after install compilation after adding and enabling moderation sidebar on the homepage
But using
In the tour.tour.welcome-to-varbase.yml
Not any other routes or aliases
Comment #10
thejimbirch CreditAttribution: thejimbirch at Kanopi Studios commentedI'll try queuing another test using a custom module, rather than Tour UI.
Comment #15
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.