Support Forum
Support › MB Settings Page › Absolute noob, couldn't figure out how to create the setting pageResolved
Hi!
I just got my unlimited lifetime license for Meta Box, and want to put it to work ASAP for a project I want to launch.
Meta Box is completely new to me, and my coding skills are basic; the KB entry for the settings age doesn't explain how to create the fields or have them modify the site's actual settings (like modifying the theme's colors, the logo, etc..).
I want to have these basic customization settings for Shop Managers, and also give them some fields that will be used as part of the frontend (company name, phone number, address, short standard texts, etc..)
Can anyone please point me in the right direction?
So far i have created the setting page, added 4 tabs and that's it, don't know what should i do next 🙁
PS: When i try to change the "Required capability" the page hangs and sometimes maxes out execution time.. what is this field for? It isn't clear to me if this is the required permission to see the settings page or what, it needs a tooltip and an example, i think
Hi,
Thank you for reaching out.
Most of the documentation to help you create a settings page and custom fields on the backend. To show them on the frontend, you need to know how to display fields with the helper function.https://docs.metabox.io/displaying-fields/
We also note it on the MB Settings Page docs https://docs.metabox.io/extensions/mb-settings-page/#getting-field-value.
Refer to this topic https://support.metabox.io/topic/getting-field-values-from-settings-page/.
The capability setting is to restrict user roles and capabilities to access the settings page. Get more details here https://wordpress.org/support/article/roles-and-capabilities/.
Hi Long!
Thanks for the reply, I actually read all those before posting here.
As I mentioned, I'm really new with this, and I'm not a developer, so I'm using the builder and trying the shortcode route.
I'm trying to use this:
[rwmb_meta id="datos_direccion_de_la_empresa" object_type=“setting” object_id=“$my_options"]
datos_ being the Field ID prefix for my Field Group.
I've tried all the variations i can think of, and nothing works, that doesn't display anything on my frontend.
Instead, if i go to Views and create a shortcode for that Field, i can display it. I was happy about it, so I created a second view for my logo's URL, that one is not working 🙁
The documentation here is not easy enough for someone like me; if you check the links you sent, they go about the displaying with code, not the shortcodes.
Please advise,
Thanks!
Hi,
To get show the field value of the settings page via shortcode, please try to use this
[rwmb_meta id="datos_direccion_de_la_empresa" object_type="setting" object_id="my_options"]
my_options
is the option name, not the variable $my_options
. If the shortcode does not work, please share the code that creates the settings page and custom fields, I will check it on my end.
https://docs.metabox.io/extensions/meta-box-builder/#getting-php-code
In general, you should have a basic knowledge of WordPress and coding (PHP, HTML, CSS) to use Meta Box.
Wow, that worked!
So the problem was that i had "" different from the "" in the code you pasted here.
I actually copied and paste from the comment you left on my facebook comment, tried eveything except changing those!
Here, if you see them side by seide they look almost identical:
[rwmb_meta id="datos_direccion_de_la_empresa" object_type="setting" object_id="my_options"]
- works
[rwmb_meta id="datos_direccion_de_la_empresa" object_type=“setting” object_id=“my_options”]
- doesn't work
Anyhow, thanks!
I appreciate the documentation, but it is seriously not straight forward enough for non-dev users; but Meta Box is, so there's a good opportunity there to make the plugin more useful for people like me 🙂
Before we close this one, I'll try to map all the other fields to see if i get them all to work, could you please explain how to get a class into the image via shortcode? I checked https://docs.metabox.io/fields/image/ but it only has code examples, no shortcodes
I defined the Field as Single Image, to avoid having an array of images
Using the custom css code:
<div>.logo-comercio {
width:200px;
border-radius: 50%;
}</div>
I have tried:
[rwmb_meta id="datos_logo" object_type="setting" object_id="my_options" class="logo-comercio"]
I also tried applying the CSS class to the shortcode widet in Elementor (free) and it doesn't work either, any ideas?
Thanks!
Hi,
The shortcode or the helper function rwmb_meta() only helps you to output the value. It does not support adding the class to the value.
You should wrap the value inside a <div class="my-custom-class">
tag then style with the CSS class.
For example:
<div class="my-custom-class">
your shortcode goes here
</div>
CSS code:
.my-custom-class {
do your stuff
}
If you are using the Elementor, just add the custom class via Elementor option CSS Classes, screenshot https://share.getcloudapp.com/2Nuwypne.