Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • saintsaint
    Participant

    Hi Peter,

    No problem, thank you for your reply. I just tried both suggestions:

    1.) For the Textarea, it doesn't seem to have any effect and had the same result.

    GIF: https://share.zight.com/nOuOelmQ

    2.) For the Custom HTML area, I added the shortcode in there as well - however, I couldn't find a way to display that on the frontend.

    It was added to the Custom HTML area in the Custom Fields group settings/config, but I didn't see it in the CPT record itself, or was able to find a way to output that out.

    Given that Envira support was able to properly render the gallery directly, but once in a Metabox field it breaks, I suspect something in the output process of a metabox field is interrupting this process?

    saintsaint
    Participant

    Hi @peter, checking in to see if you have any thoughts on this. Thank you.

    saintsaint
    Participant

    Hi Peter,

    Thanks for your note. Actually, I started this thread after working with Envira support because it appears the pagination for the Envira gallery shortcode, when added to a normal page looks fine.

    But when added in a Metabox custom field, that is when it displays the abnormal behavior.

    That's why I went ahead and created this ticket. Do you know if there's something that Metabox adds to it's custom fields that may be causing conflict with their gallery?

    Thank you.

    saintsaint
    Participant

    Thank you Peter! That would be wonderful.

    in reply to: SLUG Limit for Custom Taxonomy Terms #46147
    saintsaint
    Participant

    Ok, great! Thank you Peter.

    saintsaint
    Participant

    As an addendum: They are aware of this issue and will likely address it in one of the upcoming releases.

    saintsaint
    Participant

    Hi Peter,

    Thank you for your help! A quick update for you and for others that may stumble upon this when running into the same situation.

    From what I understand, in Bricks Builder, the issue is that all dynamic tags will be sanitized before using on an element.

    The workaround to have a form shortcode render from a Metabox WYSIWYG field on the frontend when using Bricks Builder is:

    
    add_filter( 'wp_kses_allowed_html', function( $tags, $context ) {
      if ( ! isset( $tags['form'] ) ) {
        $tags['form'] = [
          'data-id' => true,
          'id' => true,
          'class' => true,
        ];
      }
      return $tags;
    }, 100, 2 );

    Can add this filter as a code snippet and it should render the output correctly. I've tested this in production and can confirm the solution works.

    saintsaint
    Participant

    Hi Peter,

    Sure, I've updated the site to reflect your feedback.

    Re: #1 -

    $value = rwmb_meta( 'mb_resource_resource_offer_cta_box' );
    echo do_shortcode( wpautop( $value ) );

    Is now added to content-single.php template for TwentyTwentyOne.

    https://share.zight.com/8LuNYO9D

    When I added: [rwmb_meta id="resource_offer_cta_box"] Post Content Here. to Post Content, I see:

    Frontend: https://share.zight.com/v1u9WpLY
    Backend: https://share.zight.com/04u8vXLW

    Re: #3 - Yes, it is a custom field of the current post.

    saintsaint
    Participant

    Hi Peter,

    Thanks for your reply. I've tried the above suggestion, but may be implementing it incorrectly? Here are the steps I took:

    1. Activated and switched over to the Twenty-Twenty Two theme, then added the code into the functions.php file:
    https://share.zight.com/BluvbvAq

    2. De-activated all plugins except Metabox, Classic Editor, and a form plugin for testing purposes

    3. Added the helper shortcode into the Post Content area of the test record in the backend:
    https://share.zight.com/8LuNqNAX

    4. This is what I saw on the frontend:
    https://share.zight.com/xQuoRJlj

    5. Tested with a form plugin shortcode for a side-by-side comparison:
    https://share.zight.com/Kouk98d9

    6. Frontend with MB and form plugin shortcode:
    https://share.zight.com/qGubqn5Z

    Could there be a step I missed during the implementation?

    saintsaint
    Participant

    Other attempts tried:

    1) [rwmb_meta id="mb_resource_resource_offer_cta_box" render_shortcode="true"]
    2) {echo:resource_form_sc}

    <?php 
    
    add_filter( 'rwmb_get_value', function( $value, $field, $args, $object_id ) {
        if ( 'wysiwyg' === $field['type'] ) {
            $value = do_shortcode( $value );
        }
        return $value;
    }, 10, 4 );
    
    ?>
    <?php
    
    function offer() {
        $value = rwmb_meta( 'mb_resource_resource_offer_cta_box' );
        echo do_shortcode( wpautop( $value ) );
    }
    
    ?>
    
    <?php
    
    $value = rwmb_meta( 'mb_resource_resource_offer_cta_box' );
    echo do_shortcode( wpautop( $value ) );
    
    ?>
    <?php
    
    echo do_shortcode( 'mb_resource_resource_offer_cta_box' );
    
    ?>
    in reply to: Output shortcode from a custom field #45699
    saintsaint
    Participant

    Same here, can MB support provide some insight into how this can be achieved? Typically I've included shortcodes inside a WYSIWYG and displayed them with no issues, but not sure how to best approach this in Metabox.

    saintsaint
    Participant

    Thank you, Peter!

    That worked perfectly. I was under the impression that I could just pull back from field name since it is looping through the same reciprocal CPT, but will make sure to check the loop name next time and output from there.

    As an aside, in trying to make this query a little more efficient, and easier to execute through the UI, I tried out different combinations and got the below to work.

    
    {% set relationship = attribute( relationships, 'software-cpt-and-software-alternatives-cpt' ) %}
    {% for post in relationship.from %}
    	<h2>Software: {{ post.title }}</h2>
        {% set software_reciprocal_args = { post_type: 'software', relationship: {id: 'software-cpt-reciprocal-relationship', from:post.ID} } %}
        {% set software_reciprocals = mb.get_posts ( software_reciprocal_args ) %}
            {% for software_reciprocal in software_reciprocals %}
                <h4>Software_reciprocal: {{ software_reciprocal.post_title }}</h4>
            {% endfor %}
    {% endfor %}
    

    But is there any way for me to use the Queries in the INSERT FIELDS button in lieu of the below:

    
    {% set software_reciprocal_args = { post_type: 'software', relationship: {id: 'software-cpt-reciprocal-relationship', from:post.ID} } %}
        {% set software_reciprocals = mb.get_posts ( software_reciprocal_args ) %}
            {% for software_reciprocal in software_reciprocals %}
                <h4>Software_reciprocal: {{ software_reciprocal.post_title }}</h4>
            {% endfor %}
    

    If possible, I'd like to get rid of having to manually setting up the second args statement to get to the final nested loop just so I don't get a chance to mess things up by entering typos or setting the from/to direction wrong, etc.

    Thank you!

    saintsaint
    Participant

    Hi Peter,

    Thank you for your reply. I read through the link, plus the reference link in that thread and redid the logic.

    For the most part, it looks like the nested views is working. Except when I got to the Reciprocal Relationship resultset.

    After getting to that View, the records I pull back from that Relationship is the same title of the related record all 3 times, when I was expecting the titles of the 3 records selected in that Reciprocal Relationship.

    Backend setup in the Reciprocal Relationship: https://share.zight.com/WnuXXDgD
    MB View code: https://pastebin.com/aNY9TtWm
    Frontend result: https://share.zight.com/KouKK16q

    Could I be missing something that's making it repeat itself?

    saintsaint
    Participant

    Hi, following up on this to see if this is doable in the latest version?

    in reply to: Missing Metabox IDs / Fields in Oxygen #19621
    saintsaint
    Participant

    Hi Long,

    Thanks for the note, as I'm relatively new to Metabox and making the switch to be more "developer-ish", is there a video tutorial on how to do this with Oxygen? I'd love to be able to do all of these, but the documentation isn't as useful to me at this point as I don't really have much of an "end-to-end" view of how it all fits together and I'm still a relatively new developer.

    Can you help provide a more interactive step-by-step view perhaps? Would be greatly appreciated - for this scenario and other future ones as well. I learn much better this way, and can start adopting Metabox to use if I can better know how.

    Thanks much.

Viewing 15 posts - 1 through 15 (of 19 total)