Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I try to create a Tour tip for the Create Basic page node form and I'm following the instructions from the Tour API documentation.
After creating a tour.tour.add-page.yml file (see code block below) in the folder core > modules > node > config I load http://example.com/node/add/page to see the tips. But the tour button is not appearing, and no tips are visible. It seems that the path and ids are correct.
What are the necessary elements in the yml file for activating for the Tour tips?
Contents tour.tour.add-page.yml file:
id: add-page
module: node
label: test tour
langcode: en
paths:
- node/add/page
tips:
edit-log:
id: edit-log
plugin: text
label: This is the revision log message field
body: Draught parrel Arr squiffy gangplank hulk fire ship coxswain lanyard aft. Scallywag hands coxswain salmagundi jolly boat long boat Barbary Coast chandler bucko matey. Wench boom nipper Shiver me timbers fluke bilged on her anchor bilge lateen sail gunwalls belaying pin.
weight: "1"
attributes:
data-id: edit-log
edit-preview:
id: edit-preview
plugin: text
label: This allows you to preview your work
body: Capstan Blimey take a caulk Privateer Jack Tar hardtack pillage scurvy ballast Barbary Coast. Warp walk the plank take a caulk trysail matey yawl hogshead starboard scuttle bucko. Cat o'nine tails rope's end square-rigged gunwalls sloop trysail yo-ho-ho grapple gibbet rutters.
weight: "2"
attributes:
data-id: edit-preview
Comments
Comment #0.0
batigolixcorrected file name
Comment #0.1
batigolixadded code
Comment #1
larowlanDid you reinstall our stage the config so it got imported into your active store?
Comment #2
larowlanComment #3
batigolixMaybe I'm missing something here. I did not reinstall or stage nothing (dont know what that would mean).
I'm following the documentation in http://drupal.org/node/1934442
Is there any information there about those steps?
Comment #4
batigolixSo you need to disable/enable a module for the tips to be available, right?
Comment #5
nick_schuch CreditAttribution: nick_schuch commentedYou will need to reinstall or uninstall and enable the module for these tips to appear. This is a common thing across Drupal 8. We can add this into the docs just to be sure.
Comment #6
larowlanThe other alternative is to stage the config - this is how CMI works at present.
This involves
None of this relates to tour module, it is how config entities and CMI work.
FWIW I don't believe that this tour belongs in node module, it belongs in standard profile - the basic page content type does not belong to node module - it is created by standard profile - so it does not make sense for node module to own the config. If you use the minimal profile or some other profile like aGov or Kickstart, the tour will be added into the active store during node module's installation but will never be used - adding a performance overhead.
Comment #7
batigolixI added a note to the Tour API docs about enabling the module.
@larowlan: is there already documentation on how to stage configuration files? It would make easy reference.
Also: I have no intention to create a tour for Adding Nodes, it was pure for testing.
Comment #8
larowlan@batigolix, I don't see why this shouldn't be a tour in standard, as seen at #1921152: META: Start providing tour tips for other core modules. the 'initial experience' is highly important - and this would address that.
With regards to doco for staging, I don't think this is the intended approach - ie this is a 'developer only' thing. I'll ask @heyrocker if it is documented anywhere.
Comment #9
batigolixOk. let's move the discussion on which tips to include for which modules to #1921152: META: Start providing tour tips for other core modules.
Comment #10
batigolixI'm afraid I need again some help.
What would be the necessary steps to create a tour for the core block module? This core module has no config folder.
Comment #11
nick_schuch CreditAttribution: nick_schuch commentedHi batigolix,
You will need to create a folder named "config" in the root of the modules directory. You can then add your tour in there. I had to do the same with views ui module.
Comment #12
larowlanComment #13
batigolixOkay, I see it is necessary to uninstall the block module before enabling it for the configuration file to load. (as you already mentioned in #5, but in some mysterious way I managed to get the first test working by just disabling / enabling).
I found a tiny bit of documentation for staging configuration files.
I added another note to the Tour docs
I suppose I already exhausted my credit here, but I dare to ask: what would be the recommended workflow for writing tour yaml files? I mean where do I actually write&edit the yml file? If i put it in module/config then it gets loaded initially, but to make any changes after that the file needs to be placed in sites/default/files/configXXX/staging. But Drupal removes the file from that directory after import. So I am a bit puzzled about what would be the best location for editing the YAML. Also the process of synching configuration seems very slow for development. Is there a way to see changes quicker & more easily?
Comment #14
batigolixThe most convenient method seems to be:
mysql --user=USER --password=PW drupal8 -e "TRUNCATE cache_config"
Comment #16
Kristen PolI added some notes here:
https://drupal.org/node/1921152#tour-tips-tech-note
that made adding the tour and reloading the page (without clearing cache all the time) simple.
Comment #16.0
Kristen Polnode form
Comment #17
batigolixNotes from #17 moved to the documentation:
https://drupal.org/developing/api/tour#tour-tips-tech-note