Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
    Posts
  • #1435039

    Hi,
    would you please check my blog page?
    The Title overlays the header.
    How and where can I ajust the template for a single post? I want the single post to appear just in the right cell of the grid row
    Links on private content.

    Best regards!

    #1435082

    Hey northorie,

    Thank you for the inquiry.

    Have you tried increasing the top padding of the second cell containing the Blog Posts element? You can also add this css code.

    .flex_cell.av-lsvwj3of-18478217b22834a47eecc5a153470720 {
        padding-top: 100px;
    }

    Best regards,
    Ismael

    #1435096

    Great, that did the trick :) thank you

    How can I get the single post to open within the right cell or how to ajust the template of the single post that it fits the styling of the main blog?
    Other solution: open tghe single post in a lightbox?/PopUp?

    • This reply was modified 1 month, 4 weeks ago by northorie.
    #1435099
    #1435175

    Hi,


    @northorie
    : Would you mind providing a screenshot of the changes that you’d like to make? You can use platforms like Savvyify, Imgur or Dropbox to upload and share the screenshot. Here are the steps to follow:

    1.) Visit the website of your chosen platform, such as Savvyify, Imgur or Dropbox.
    2.) Locate the option to upload a file or an image.
    3.) Select the screenshot file from your computer or device and upload it to the platform.
    4.) After the upload is complete, you will be provided with a shareable link or an embed code.
    5.) Copy the link or code and include it in your message or response to provide us with the screenshot.

    Thank you for taking the time to share the screenshot. It will help us better understand the issue you’re facing and provide appropriate assistance.

    Best regards,
    Ismael

    #1435196

    Hi Ismael,

    I uploaded a screenshot on private data. Can you open it?
    I want the single post to open inside the area, that I circled green. I hope you get my point, it’s difficult to discribe ;)

    #1435375

    Hi,
    Thanks for the screenshot I believe that you want to embed one page into another and have the links open in the same embed section.
    Such as embed the blog in one side of a grid row and then open the clicked posts in the same section, this is quite tricky but I believe that I have achieved it on this test page.
    Enfold_Support_4831.jpeg
    in the backend I have a grid row element and one side has a background image and the other side has a code block element:
    Enfold_Support_4833.jpeg
    the code block element has this code:

    <div id="embedded-section"></div>
    
    <script>
    window.addEventListener('DOMContentLoaded', function() {
        (function($) {
            var initialContent = null; // Variable to store the initial content
    
            // Function to load content via AJAX
            function loadContent(url, initialLoad = false) {
                $.ajax({
                    url: url,
                    type: 'GET',
                    dataType: 'html', // Explicitly expect HTML
                    success: function(data) {
                        var content;
                        // Determine the selector based on whether it's the initial load
                        if (initialLoad) {
                            content = $(data).find('#av_section_1').html();
                        } else {
                            // Try the first selector
                            content = $(data).find('.av-main-single').html();
                            // If not found, try the second selector
                            if (!content) {
                                content = $(data).find('.post-entry').html();
                            }
                        }
    
                        // Check if content was found
                        if (content) {
                            if (!initialLoad) {
                                content = '<a href="#" class="back-link">Back</a>' + content; // Prepend back link to content
                            } else {
                                initialContent = content; // Save initial content if it's the initial load
                            }
                            $('#embedded-section').html(content);
                            bindLinkClicks(); // Re-bind click events to new links within the content
                        } else {
                            console.error('Requested content not found using the provided selectors.');
                            $('#embedded-section').html('Requested content not found.');
                        }
                    },
                    error: function(xhr, status, error) {
                        console.error('Error loading content:', error);
                        $('#embedded-section').html('Error loading content.');
                    }
                });
            }
    
            // Bind click events to links within the embedded section
            function bindLinkClicks() {
                $('#embedded-section a').off('click').on('click', function(event) {
                    event.preventDefault(); // Prevent default link behavior
                    var linkUrl = $(this).attr('href'); // Get the URL of the clicked link
                    
                    if ($(this).hasClass('back-link')) {
                        // If the back link is clicked, load the initial content
                        $('#embedded-section').html(initialContent);
                        bindLinkClicks(); // Re-bind click events
                    } else {
                        console.log('Attempting to load:', linkUrl);
                        loadContent(linkUrl); // Load content via AJAX, not initial load
                    }
                });
            }
    
            // Initial loading of content with specific section
            loadContent('https://enfold.savvyify.com/embed-2', true);
    
            // Initial binding of click events on page load
            bindLinkClicks();
        })(jQuery);
    });
    
    </script>

    Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.
    Please change the url in the code to your page with the blog element, look for this part of the code:

    // Initial loading of content with specific section
            loadContent('https://enfold.savvyify.com/embed-2', true);

    Now the page that is embeded is a ALB page with a color section set to 100% height and a blog element inside:
    Enfold_Support_4835.jpeg
    by default the first color section of a ALB page has the ID av_section_1, this is important because it is what the script calls and will only show this section, not the header, footer, or sidebar, but set this page to no sidebar as the content width is affected.
    Now to show the posts with no header, footer or sidebar we will use the class av-main-single for Classic Editor pages and if that is not found because it is a ALB post we will try post-entry, so when a post link is clicked the post will load in the same section:
    Enfold_Support_4837.jpeg
    Now since the back button on the browser won’t work we added a small “back” link at the top of the embed section:
    Enfold_Support_4839.jpeg
    Please give this a try.
    Please note that this will only work for pages and links on your site.
    Please note Page Preloading will interfere, so please disable.

    Best regards,
    Mike

    #1435412

    Hi Mike!
    Your Test-Page is exactly, what I was looking for! That’s awesome! Thank you very much!!

    I seem to have made a mistake and probalby didn’t understand something.
    I get an error in the Blog page: Error loading content.

    Did I get you right, that I need to create a new page, containing a color section with the blog post?
    I’ve posted the blog main page and my new page on private content

    #1435418

    Hi,
    Thank you for the link to your site, you are getting the error because the code above is pointing to my test site.
    Please change the url in the code to your page with the blog element, here:

    // Initial loading of content with specific section
            loadContent('https://enfold.savvyify.com/embed-2', true);

    I also had set my grid row height to 100% of the page, you may want to try this.

    Best regards,
    Mike

    #1435436

    *Duh*
    I’ve got Step one now :)
    When I click on a past you can get a glimpse that the entry opens correctly within the right cell, but it changes immediatly to full screen page.
    What did I do wrong?

    • This reply was modified 1 month, 3 weeks ago by northorie.
    #1435475

    Hi,
    It looks like it works and then the new url reloads the page, because if you use the browser back button you will the first page with the article loaded in the grid row correctly like in my demo.
    I’m not sure why you are experiencing this I’m not seeing any error messages, try disabling all of your plugins and see if that helps, if not please include an admin login in the Private Content area so we can check.

    Best regards,
    Mike

    #1435489

    I only had one Plugin. I deactivated it. No change.
    Admin-Account in private content

    #1435580

    Hi,
    Thank you for the login to your site, it looks like the Page Preloading interferes with the script, I disabled it and now the page works correctly, please check.

    Best regards,
    Mike

    #1435596

    Wow! Thank you !! That’s amazing! You’re a genius :)

    Is there away to fix the width of the right cell?
    And is it possible to use the blog naviagion (front and back buttons)

    But theese are just wishes on top, I am more than happy with what I got :)

    #1435625

    Hi,
    Glad that this helps, I’m not sure what you mean by fixing the right cell width, you are using a grid row with two cells at 50%, if you want a different cell size try the grid row Set Cell Size button below the element:
    Enfold_Support_4855.jpeg
    Perhaps you mean that you only have two items showing but the items are each set to 1/3 of the space, to make them each 1/2 try changing the number of columns the blog element:
    Enfold_Support_4857.jpeg
    If this doesn’t help try explaining further.
    As for using the built-in blog post navigation, you will not see these prev/next elements in the embed area because we are not embeding the whole page, only the inner “content” area,
    but you could add this solution to add new blog post navigation buttons to the content area of your posts, and in my test on my demo page clicking them changes the embed post successfully:
    Enfold_Support_4859.jpeg

    Best regards,
    Mike

    #1435646

    Thank you, I will try the post navigation tomorrow.

    With the cell sice I mean that the width “jumps” when clicking on an enty and back again to the main blogpage

    #1435667

    Hi,
    I don’t see a change in the cell width, here is the starting blog page:
    Enfold_Support_4861.jpeg
    and one of the post pages:
    Enfold_Support_4863.jpeg
    I also don’t see a “jump” while the embed page is loading, however on the page load I see that your grid row height changes a lot, I recommend setting the height of the grid row to 100% of the page instead of the content height that you have it set to now.

    Best regards,
    Mike

    #1435734

    The “jumoing” ist gone. Don’t know why.
    Navigation works perceftly.
    Now I’m really, really happy with this solution!! Thank you so much for your effort.

    Topic can be closed

    Best regards!

    #1435735

    Hi,
    Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 19 posts - 1 through 19 (of 19 total)
  • The topic ‘Blog Layout’ is closed to new replies.