How to get page colors and page links in Inspector?
-
Hi, everyone.
I’m new to WP, and this plugin. Coming from React development, this is very new to me, so bear with me.
I’ve made a custom “block”, simply two text fields – one for the title text of my “bubble button” and one for the link, and also a “Color” field. I’ve set up a couple of css classes in the CSS tab, and a markup like this:
<div class="bubble-button"> <a href={{button-link}}> <p> {{button-text}} </p> </a> </div>
Now, in the Block editor I can find the block, insert it and fill in the fields. However, the color does not do anything – other than pick a Color. What I need is to display the color menu like in “native” blocks seems to do. I would like to hav e the theme colors displayed, and the option to apply these to the text (p tag) itself and/or the background color of the wrapper div.
Also, I would like the second text field to be a dropdown with all the pages on the site, so that the end user of the theme can pick an existing published Page as the “bubble button” link reference.
How would I achieve this?
- The topic ‘How to get page colors and page links in Inspector?’ is closed to new replies.