Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not all blocks show tooltips #13

Open
mauritsvanrees opened this issue Oct 28, 2024 · 3 comments · May be fixed by #14
Open

Not all blocks show tooltips #13

mauritsvanrees opened this issue Oct 28, 2024 · 3 comments · May be fixed by #14

Comments

@mauritsvanrees
Copy link
Collaborator

We see that tooltips are not shown in all blocks. Two relevant ones for us are the standard description field block and volto-accordion-block.

Sample page where Alpha, Beta and Gamma should be tool tips, and only Delta shows up:

Screenshot 2024-10-28 at 16 50 18

Blocks config is:

{
 "79e1657a-a505-4136-8e4d-a71b60668b36": {
  "styles": {},
  "@type": "slate",
  "plaintext": "Standard text block with Delta term.",
  "value": [
   {
    "children": [
     {
      "text": "Standard text block with Delta term."
     }
    ],
    "type": "p"
   }
  ]
 },
 "9410d3fc-e431-47ea-b59e-4ddbd08a0e1b": {
  "@type": "description",
  "fixed": true
 },
 "9f03f741-36c3-42f2-8087-74ef8854ad05": {
  "@type": "accordion",
  "collapsed": false,
  "data": {
   "blocks": {
    "ae930b9a-4b55-4ad4-9943-f643e870fa2c": {
     "@type": "accordionPanel",
     "blocks": {
      "c267c4f7-ced1-45d8-9d00-c4234631e00c": {
       "@type": "slate",
       "plaintext": "Accordion text Gamma",
       "styles": {},
       "value": [
        {
         "children": [
          {
           "text": "Accordion text Gamma"
          }
         ],
         "type": "p"
        }
       ]
      }
     },
     "blocks_layout": {
      "items": [
       "c267c4f7-ced1-45d8-9d00-c4234631e00c"
      ]
     },
     "title": "Accordion title Beta"
    }
   },
   "blocks_layout": {
    "items": [
     "ae930b9a-4b55-4ad4-9943-f643e870fa2c"
    ]
   }
  },
  "filtering": false,
  "non_exclusive": true,
  "right_arrows": true,
  "title_size": "h3"
 },
 "b359698e-39a5-40b7-b7a2-681266c43e0a": {
  "@type": "title",
  "fixed": true
 }
}

And the blocks layout is:

{
 "items": [
  "b359698e-39a5-40b7-b7a2-681266c43e0a",
  "9410d3fc-e431-47ea-b59e-4ddbd08a0e1b",
  "9f03f741-36c3-42f2-8087-74ef8854ad05",
  "79e1657a-a505-4136-8e4d-a71b60668b36"
 ]
}

Is this something that can be fixed?

Or is by design only the standard slate text block supported?
Note that the accordion block does contain slate sub blocks.

@ksuess
Copy link
Member

ksuess commented Dec 20, 2024

The accordion block texts (not panel headers) should be equipped with tooltips. I'll include their slate sub blocks.

description block: Yes, as you mentioned, by design only slate text blocks are supported. But I have an idea how to support also the description block. And also the teaser block description, which I think could also be supported. The key is to first include also description and teaser block descriptions in the calculation of the enhanced markup. And second use the enhanced markup. But this use must be left to the project with custom description block view and custom teaser block view. Don't want to override core blocks here. They do not provide a nice hook like slate blocks do.

@ksuess
Copy link
Member

ksuess commented Dec 20, 2024

@mauritsvanrees Can you please check if the instructions are comfortable.
As the description block and teaser block should not be fiddled here in an add-on, and I do not see a hook to inject tooltip enhanced markup, I wrote down the instructions for a way to support these two blocks and further more nevertheless, with minimal code per project.

@mauritsvanrees
Copy link
Collaborator Author

Hi @ksuess. I will try this out next year. But the instructions look clear. Thanks for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants