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

batigolix’s picture

Issue summary: View changes

corrected file name

batigolix’s picture

Issue summary: View changes

added code

larowlan’s picture

Did you reinstall our stage the config so it got imported into your active store?

larowlan’s picture

Status: Active » Postponed (maintainer needs more info)
batigolix’s picture

Maybe 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?

batigolix’s picture

So you need to disable/enable a module for the tips to be available, right?

nick_schuch’s picture

You 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.

larowlan’s picture

The other alternative is to stage the config - this is how CMI works at present.
This involves

  • Copying the manifest.tour.tour.yml from your active store (sites/default/files/config_SOMEHASH/active) into your staging store (sites/default/files/config_SOMEHASH/staging)
  • Copying the new file you created from core/modules/node/config into the staging store
  • Editing the copy of the manifest in your staging store to add the new yml file
  • Going to synchronize configuration in the UI (under config -> development) and importing the new config.

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.

batigolix’s picture

I 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.

larowlan’s picture

@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.

batigolix’s picture

Status: Postponed (maintainer needs more info) » Fixed

Ok. let's move the discussion on which tips to include for which modules to #1921152: META: Start providing tour tips for other core modules.

batigolix’s picture

Status: Fixed » Active

I'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.

nick_schuch’s picture

Hi 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.

larowlan’s picture

Status: Active » Fixed
batigolix’s picture

Okay, 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?

batigolix’s picture

The most convenient method seems to be:

  • edit the YAML document in the active config folder in sites\default\files\config_XXXXXXXXXXXXXXXXXXXX\active
  • empty the table cache_config mysql --user=USER --password=PW drupal8 -e "TRUNCATE cache_config"
  • reload the page to test the tour

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Kristen Pol’s picture

I 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.

Kristen Pol’s picture

Issue summary: View changes

node form

batigolix’s picture

Notes from #17 moved to the documentation:

https://drupal.org/developing/api/tour#tour-tips-tech-note