Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #29038

    I’m using the s2member plugin and I want to use some of their conditional shortcode statements to output display objects.

    Ie. I want to do this:

    [s2If current_user_can(access_s2member_ccap_customccap1)]

    random text

    [/s2If]

    [s2If current_user_can(access_s2member_ccap_customcap2)]

    [av_portfolio columns='2' items='16' contents='excerpt' preview_mode='auto' image_size='portfolio' linking='' sort='yes' paginate='yes']

    [/s2If]

    But I’m having trouble getting it to work using the Advanced Layout Editor. It seems to work if I enter it in the default editor. Is there any way to put my s2member conditions around some Enfold shortcode?

    Or is my only option to design the whole page with shortcode? If that’s the case, is there an index of all Enfold shortcode for all elements?

    Last question: I already messed up the ALE of one page by editing the debug code on it’s own after creating the page in the ALE. Am I ok if I just completely delete that page in wordpress and recreate it from scratch or is my database still corrupted? I now understand why you don’t enable the debug code by default.

    Thanks.

    #139519

    Textblock elements also support shortcodes. The workaround in this case would be to to create a textblock element and then you can insert your code into the TinyMCE texteditor field

    [s2If current_user_can(access_s2member_ccap_customcap2)]
    [av_portfolio columns='2' items='16' contents='excerpt' preview_mode='auto' image_size='portfolio' linking='' sort='yes' paginate='yes']
    [/s2If]

    2) No, the ALE Code is saved in a custom field and if you delete this post/page the corrupt code won’t affect other database entries.

    #139520

    I tried inserting shortcode into textblocks, but the following code did not work as the trailing [/s2if]’s did not get picked up by the shortcode reader and just got displayed statically:

    [av_textblock ]

    [s2If current_user_can(access_s2member_ccap_custom1)]

    Text

    [/s2if]

    [s2If current_user_can(access_s2member_ccap_custom2)]

    [/av_textblock]

    [av_portfolio columns='2' items='16' contents='excerpt' preview_mode='auto' image_size='portfolio' linking='' sort='yes' paginate='yes']

    [av_textblock ]

    [/s2if]

    [/av_textblock]

    Is that code supposed to work?

    #139521

    No, this code will not work. You must make sure that the closing tags are within the same av_textblock shortcode. Use follow code instead

    [av_textblock ]
    [s2If current_user_can(access_s2member_ccap_custom1)]
    Text
    [/s2if]
    [/av_textblock]

    [av_textblock ]
    [s2If current_user_can(access_s2member_ccap_custom2)]
    [av_portfolio columns='2' items='16' contents='excerpt' preview_mode='auto' image_size='portfolio' linking='' sort='yes' paginate='yes']
    [/s2if]
    [/av_textblock]

    #139522

    Thanks for the reply – but how do I insert a Portfolio Grid graphically into a Text Block in the ALE? Must I know the shortcode for every layout element to do it?

    #139523

    Hey,

    Please switch your theme to debug mode. Edit function.php, find this code:

    if(isset($avia_config['use_child_theme_functions_only'])) return;

    Below, add this code:

    //set builder mode to debug
    add_action('avia_builder_mode', "builder_set_debug");
    function builder_set_debug()
    {
    return "debug";
    }

    You will be able to see the actual shortcode below the builder.

    Regards,

    Ismael

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Conditional shortcode around layout objects’ is closed to new replies.