Archived topic
Add a gutenberg element to certain post types from 'elements'
5 replies · Started by Ayham on December 29, 2020
Hello!
I want to add a gutenberg block (say a table) only once from a generatepress 'Element' and have it apply to all posts of a certain type.
From 'Elements' I created a blocktype = 'hook' and hook = 'generate_inside_containter' but it does not work. I tried other variations that didn't work either.
If what I want to do is possible what should the parameter be?
Thanks.
Hi there,
whats the exact issue?
Is it just the styling ?
I am sorry I did not explain well.
The problem is that the block I want added (for example a table) does not appear in the posts of the type specified.
I would like to know what settings I should use when I create the element or whether what I am trying to do is possible.
thanks.
What Display Rules have you used in the Block Element?
And can you link me to a post where the block should be displayed?
Thanks for responding fast.
I am trying this element with learndash lms post types and just discovered that that the rule works for some post type 'courses' but not 'lessons' or 'topics'.
Block type = Hook
Hook = generate_after_content
Priority = 10 (This is default)
Location = Lesson
If the location is 'course' it works.
In any case, I will experiment a bit with tags to see if I can get it to work and let you know.
thanks.
Let us know :)