Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1098126

    Hey,

    I’m trying to add multiple pages that shall append a last different section to a mostly common content. With that it will be easier to created multiple pages with same content but the last section differs and I’m also able to edit the common content above in one single page.

    • To reach that goal I create a page based on Standard-Template template-builder.php, in the following called Base Landingpage.
    • Then I create multiple pages basing on a custom template template-landingpage.php and it’s content can be something different that shall be appended to the content of Base Landingpage
    • My custom template is a copy of template-builder.php with one small change. Before outputting the variable $content I try to fetch my page Base Landingpage through it’s ID. I duplicated most of the code between get_header() and get_footer(). For the first duplicated code occurence I swapped the get_the_ID() with my hardcoded ID.

    It’s works nearly fine. I see the content of Base Landingpage and at its end I see the content of that new page using template-landingpage.php.

    The problem I have is, that when calling a page with my custom template I can see some <br/> and <p> that are not existent when calling Base Landingpage. I can not understand why that happens.
    Interesting is, that the breaks doesn’t appears everywhere, but e.g. in an one_half column with three elements inside I got two <br />s between them and when using the promobox the box title has a margin-top > 0 and the box itself has a margin-bottom > 0 because the CSS class avia-builder-el-no-siblings is missing. Also the First headings inside sections has an unexpected margin-top because the CSS class avia-builder-el-first is missing.

    To be able to easily reconstruct that behavior simple add a new template (e.g. template-test.php) in a child theme or main theme. Put following code inside:

    <?php
    /*
     Template Name: Landingpage Test
    */
    
    require_once get_template_directory() .'/template-builder.php';

    For my understanding this template should do the same like Standard-Template. But it isn’t.
    So why are the autogenerated <br />s and <p>s only removed when using the frontpage?

    • This topic was modified 5 years, 6 months ago by algorhythm.
    #1100001

    Hey Martin,

    Thank you for using Enfold.

    Interesting what you want to do – but this is high customization and beyond the scope of support.

    You will need to debug step by step to find out what causes the problem.

    What you can try is to reset shortcode index to 0 and load the shortcode tree for your custom page (see function shortcode_handler_prepare how this can be done)

    Hope this helps you.

    Best regards,
    Günter

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