• Resolved huetherb

    (@huetherb)


    Hi,

    I am using Guternberg to build pages.

    My pages have content of form

    
    Lesson
    
       Topic1
         topic1 content (images, text, etc)
         topic1 exercise (a styled block with variable content)
       Topic2
         topic2 content
         topic2 exercise
       etc
    

    Where lesson and topic are custom post types.

    Because I often place exercises on my pages, and because the exercises have a consistent look and function, I want to use them similar to a related post, but keeping them as a block. Just like a page might have a video block, etc.

    Do you know anyway to do this in Guternberg, where I add some reusable block, and in doing so the block is given some id (like <div class=”exerciseblock” id=”someid”>my exerciseblock</div> such that in a navigation menu (like jquery based) I could have

    
    Lesson
      <a name="topic1">Topic1</a>
      <a name="exercise1">Exercise1</a>
      <a name="topic2">Topic2</a>
      <a name="exercise2">Exercise2</a>
    

    Notice what is happening here? Custom posts (which is what topics currently are on my site) and blocks (such as exercises) are both being treated as anchors on the page. And if the blocks are dealt with in a table (say with block_id, relatedtopic_id, relatedlesson_id, content) or metadata then they are given a relationship to the lesson and/or topic posts. Pretty elegant.

    This way a user has a fast browsing experience for the page, where they see topic, exercise, etc navigation and readily get to places of interest on the page.

    Anyway, wondering if this is already doable via guternberg. If so, tipis? If not, tips? ??

    thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jorge Costa

    (@jorgefilipecosta)

    Hi @huetherb

    Do you know anyway to do this in Guternberg, where I add some reusable block, and in doing so the block is given some id (like <div class=”exerciseblock” id=”someid”>my exerciseblock</div> such that in a navigation menu (like jquery based) I could have

    If you add a reusable block you can add a group block inside, in the group block you will be able to choose an anchor (id attribute) on the advanced section. This will allow you to link to that block.

    I hope you find my answer useful, feel free to comment if you need additional clarification.

    Thread Starter huetherb

    (@huetherb)

    Ok, I will look into group blocks, thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Creating Custom Blocks and Referencing Them In Navigation Menus?’ is closed to new replies.