Oxygen builder, get value from settings field in code block does not work

Support MB Settings Page Oxygen builder, get value from settings field in code block does not workResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #32698
    Majd AzarMajd Azar
    Participant

    Hello,

    I am a user of Oxygen Builder (v. 3.9).

    I have setup a settings page with some fields.

    I wanted to pull one field value inside a code block.

    Following your documentation I then simply pasted this code inside a code block:

    <?php 
    $value = rwmb_meta( $vardagar, ['object_type' => 'setting'], $oppettider ); 
    echo $value; 
    ?>

    But nothing got printed. Do you know why?

    #32705
    Long NguyenLong Nguyen
    Moderator

    Hi,

    You need to assign values to the variable $vardagar and $oppettider before, or pass them directly to the helper function.

    $vardagar = 'your_field_ID';
    $oppettider = 'your_option_name';
    $value = rwmb_meta( $vardagar, ['object_type' => 'setting'], $oppettider ); 
    echo $value;

    or

    $value = rwmb_meta( 'your_field_ID', ['object_type' => 'setting'], 'your_option_name'); 
    echo $value;
    #32712
    Majd AzarMajd Azar
    Participant

    Thank you for the help.

    There must have been some bug. I tried the helper function before and it didn't work. Now it seems to be working.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.