Viewing 30 posts - 1 through 30 (of 30 total)
  • Author
    Posts
  • #1075963

    Hi
    We use an Accordeon to show events on a website.
    We wanted to generate shorcodes for this accordeon with a plugin. So we activated the debug modus, copied the shorcodes and generated them with our plugin.
    When we show the plugin shorcodes together with the manually created accordeon, it works fine.
    But when we remove the manually created accordeon, the color settings are lost and it uses the default color settings.
    What can be the problem?
    Details you can see below.

    #1077484

    Hey Michael,

    Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?

    Best regards,
    Victoria

    #1077773

    Hi Victoria
    I send you the information in the private box below.
    When we use both, the manually inserted accordeon and the generated accordeon, it looks correct.
    When we remove the manually inserted accordeon, then the generated accordeon has another look.
    Best regards
    Mike

    #1079444

    Hi,
    Sorry for the late reply, as I understand, if I remove your custom shortcode for the accordeon ([gcst_events]) the colors for the accordeon element changes?
    I tried to recreate this error but the accordeon element didn’t change colors for me. Did I misunderstand?

    Best regards,
    Mike

    #1080134

    Hi Mike
    No, it is the other way.
    We have the manually inserted accordeon and the with the shortcode [gcst_events] created accordeon.
    Now, when we remove the manually inserted accordeon (because we want to replace it with the shorcode [gcst_events] created accordeon), then the accordeon with the [gcst_events] shortcode has the default colors in red, and not the colors we set.
    So its the other way as you tried it out.
    Best regards
    Mike

    #1080229

    Hi,
    Thanks that is clearer, I see that this is a custom plugin that you have created that uses the shortcode above, when I test the shortcode above in a code block on a new test page the colors for the element are correct.
    There are a couple of issues that could be causing this, there are some issues with the new block editor and shortcodes, in some cases, disabling the block editor solves and in others there is a beta update version that solves.
    But the dev team posted that they are very close to releasing the next version that will address these issues properly, so I’m not sure if this is something you would want to wait for?

    Best regards,
    Mike

    #1080286

    Hi again
    Hm, It seems at the moment Enfold has a lot of problems ;-(
    So, what you think, when this next release version will come?
    Are you shure, that with the next release version this problem here will be fixed?
    Will also this bug here be fixed?

    Thanks.
    Regards
    Mike

    #1080319

    Hi Mike, are you talking about an WordPress Update to come? We also have a similar issue with shortcodes in sidebar widgets.

    #1080661

    Hi,
    Yes, the dev team has released the update today Enfold v4.5.5, please try updating your site to see if that corrects it.

    Best regards,
    Mike

    #1080914

    Hi Mike
    I just updated to Enfold 4.5.5.
    It is not better, now the shortcode generated accordeon is not there anymore, when we remove the manually created accordeon. So the shortcode only works together with the manually created accordeon. So nothing is better ;-(
    Also the other open topic still does not work correct:

    Hope you will fix all the problems with Enfold and WordPress 5.1.x as soon as possible, because we have a lot of Enfold websites productive ;-(
    Regards
    Mike

    #1080920

    We have also a lot of errors in the console when we edit the page, see below in the private section. This we did not have before (block validation failed).

    #1081016

    @Mike : Thx a lot! The update fixed the issue!
    Goooood :)

    #1081122

    Hi,
    That is great news. We will close this now. Thank you for using Enfold.

    For your information, you can take a look at Enfold documentation here
    For any other questions or issues, feel free to start new threads under Enfold sub forum and we will gladly try to help you :)

    Best regards,
    Mike

    #1084472

    Hi,
    I tried to investigate your page with the shortcode from your custom plugin, by creating a copy at the url in the Private Content area and removing the according element so that there was only the shortcode according, expecting that the shortcode would work, but with the wrong colors. But the shortcode didn’t work.
    Yet if I recreate the shortcode with our shortcode tool it works correctly. I don’t believe that this is a shortcode issue, but an issue with your custom plugin.
    When I check your custom plugin I find this error for “title”

    $toggles .= do_shortcode("[av_toggle title='" . $titel . "' tags='' av_uid='av-ihbnj']" . $details . "[/av_toggle]");

    which is braking it, please try reviewing your custom plugin for errors.

    Best regards,
    Mike

    #1086106

    Hi Mike
    Ok, now I see the problem.
    It seems like the do_shorcode cannot be called for every av_toggle and the av_toggle_container. It only can be called for all together, then it works.
    But now, we have another problem.
    As we deleted the manually generated accordeons, there comes the following message (in german):

    Admin-Hinweis für:
    Akkordeon
    Dieses Element wurde in den Theme-Einstellungen deaktiviert. Sie können es hier aktivieren: Leistungseinstellungen

    I think its because the setting of “Deaktivieren von Vorlagen-Ersteller-Elementen”

    But is there no possibility to load the elements also when they are used in shortecodes of custom plugins? ;-)

    Thanks.

    Best regards
    Mike

    #1086314

    Hi,
    Glad to hear you found the issue. I believe the error you are getting is because in your performance settings your “Disable template creator items” is set to “Load only used elements (recommended)”
    Please change to “Always load all elements” and then try again.
    2019-04-02-221028

    Best regards,
    Mike

    #1086418

    HI Mike
    Yes, when I change the setting to “Always load all elements”, it works.
    But, for performance, I would like to set it to “Load only used elements (recommended)”
    So, is there a possibility, to load additional elements in my PHP code? For that I could load the accordeon (if not loaded yet by static code) before my shortcode generation? This would be very cool.
    Best regards
    Mike

    #1086519

    Hi,
    I believe what is happening is that because your plugin is inserting the shortcodes out of order for the shortcode tree. The “tree” is the list of shortcodes inside the page telling it which elements to get.
    In the past the solution was to use the parser in the debugger to rebuild the “tree” but your shortcode is added after so it won’t help.
    I didn’t find a filter to always load one element, but you can choose to manually set which elements to load in the performance option.
    Please try this.

    Best regards,
    Mike

    #1086975

    Hi Mike

    Yes, would be very nice to have a filter or something like that, to manually add additional elements to load. Or a trick, how Enfold realizes, that my shortcode of my plugin will need some elements ;-)

    Best regards
    Mike

    #1087267

    Hi,
    I had to edit my response right after I sent it because the theme does allow you to manually set which elements to load in the performance option.
    Please try using this option to always load the accordion element.
    The issue is that your plugin’s shortcode is getting added after the “tree”
    So I’m not sure if you tried this yet
    2019-04-04-204521

    Best regards,
    Mike

    #1088193

    Hi Mike
    Yes, this option I already did see.
    But here I think I have to know which elements I need in the whole website, right?
    So, where can I find out, which elements are used also without my plugin’s shortcode?
    Best would be, to load all elements dynamically and to have the possibility to add elements manually.
    Regards
    Mike

    #1088510

    Hi,
    If you take a look at the elements listed in the options you should be able to remember which elements you used when creating your site, or at least which elements you didn’t use such as the “Progress Bars Element”, “Headline Rotator Element”, & “Animated Numbers Element”
    You can also look at the backend of your page and the title for each element is visible without having to open it if you are unsure which elements you used.

    Best regards,
    Mike

    #1089959

    Hi Mike
    Ok. But let me know, if it will be possible, to activate elements in a plugin code, because that would be the coolest way for us ;-)
    Regards
    Mike

    #1091208

    Hi,

    We haven’t tried that but it should be possible. You can set one of the plugin directories as the element source.

    // https://kriesi.at/documentation/enfold/intro-to-layout-builder/#add-elements-to-alb

    The code there should set the child theme’s “shortcode” folder as one of the shortcodes’ source along with the default ones.

    Best regards,
    Ismael

    #1091326

    Hi Ismael
    Thanks for your response.
    I think this solution only works, if you want to have individual shortcodes in the chlid theme.
    But what we want is to add shortcodes with a plugin, calling the WordPress function do_shortcode.
    So, it would be nice, that Enfold has a code, for activating the elements, we use in this shortcodes. If this is possible, we only can load the needed elements and then add the additional elements in the plugin. But I think you have no solution for this yet.
    Best regards
    Mike

    #1092169

    Hi,

    The builder has its own public function to compile the shortcodes inside the post content. Not really sure what you’re trying to do here, but maybe that function would help.

    Example of that code can be found in this thread: https://kriesi.at/support/topic/blog-posts-16/#post-1042867

    You have to fetch post and then compile the content using the following function.

    $content = Avia_Builder()->compile_post_content( $post );
    

    Best regards,
    Ismael

    #1094383

    Hi Ismael
    Do I understand you correct, when I compile the post content in my plugin code, Enfold will recognize, that I use this elements and activates them?
    Best regards
    Mike

    #1094601

    Hi,

    Yes, that’s the general idea. It also builds the shortcode tree, so any shortcodes outside the builder will still be included in the elements array. Let us know if it helps.

    Best regards,
    Ismael

    #1094663

    Hi Ismael
    This solution does not work for me.
    But it is the only website which generates elements by a special plugin, so here I will activate only the used elements and then it’s fine. You can close this topic.
    Regards
    Mike

    #1094937

    Hi,
    Thanks for sharing your solution, we will close this now. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 30 posts - 1 through 30 (of 30 total)
  • The topic ‘Generated Shortcode does not work’ is closed to new replies.