Creating Custom Blocks and Referencing Them In Navigation Menus?
-
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!
- The topic ‘Creating Custom Blocks and Referencing Them In Navigation Menus?’ is closed to new replies.