Tagged: 

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1433994

    Hi Enfold team,
    Thanks always for your support and theme.

    I’m using posts in two ways. 1) Display full post when accessing via post URL. 2) Displaying a lightbox of a post when adding the iframe=true to the end of the URL.

    When doing #2, I’d like to only display the body of the post. When doing #1 I would like to display all (header, footer, sidebar and socket as it normally does.
    I saw https://kriesi.at/support/topic/open-page-in-modal-lightbox-without-sidebars-header-and-footer/ but that addresses only one situation. How might I accomplish both?

    Thanks for your help.

    #1433995

    Updating to get notified.

    #1434035

    Hi,
    I tried to recreate the post that you linked to, so I created a test page with two links:
    Enfold_Support_4697.jpeg
    the first link opens a Classic Editor post in a new tab, the second opens the same post in a lightbox, in order for the link to work this must be added to the end of the post url:
    ?iframe=true&modal
    Enfold_Support_4699.jpeg
    Then I added two snippets in my WP Code plugin, the first is a PHP snippet

    function add_modal_qs(){	
    	if(isset($_GET['modal'])) {
    		global $avia_config;
    		if(isset($avia_config)) {
    			$avia_config['template'] = 'blank';
    		}
    	}
    }
    add_action('init', 'add_modal_qs');

    the second is a CSS snippet

    #top.blank .title_container,#top.blank #main .sidebar{display:none;}
    #top.blank .container .av-content-small.units {width: 100%;}
    #top.blank .container .content {border: none;}
    #top.blank #main .sidebar {border: none;}

    The PHP snippet opens the post in a lightbox with no header or footer, the CSS snippet hides the titlebar and the sidebar and makes the post content full width.
    So the first link, with the normal url, opens the post in a new tab with everything showing:
    A-nice-entry-two--Enfold.png
    the second link with ?iframe=true&modal added to the url open a lightbox with only the content showing:
    Enfold_Support_4701.jpeg

    Best regards,
    Mike

    #1434094
    This reply has been marked as private.
    #1434133

    Hi,

    Thank you for the update.

    You can add the following css code to adjust the space above the post content. However, please note that this modification will also be applied to the actual post template, not just the lightbox content.

    html .postid-2243 #main {
        padding-top: 0 !important;
    }
    
    html .postid-2243 #main .container .content {
        padding-top: 10px;
    }

    Best regards,
    Ismael

    #1434167

    Hi Ismael,
    Thanks for the response. I’m looking for the margin adjustment to only affect the lightbox. I tried using your code but as a class=contentmodal for the link like this, but it didn’t work.

    /* Hide modal margin where header is */
    html .contentmodal #main {
    padding-top: 0 !important;
    }
    html .contentmodal #main .container .content {
    padding-top: 10px;
    }

    In Mike’s functions.php he references “modal” which appears in the link as ?iframe=true&modal. Is there any way to style just the modal with your CSS by adding a class or ID? This is my only use for the modal on the event site.
    Thanks for your help!

    #1434171

    Hi,
    Try this CSS in your Enfold Theme Options ▸ General Styling ▸ Quick CSS field:

    .html_header_top.html_header_sticky #top.blank #wrap_all #main {
    	padding-top: 0 !important;
    }

    the pages shown in the lightbox have the class “blank” added to the body, so #top.blank can be used to target elements inside the lightbox.
    The lightbox has the class “mfp-iframe-holder” but the page in the lightbox is in a iframe and the parent page css can not effect the iframe page, so the css must be added to the child page css, thus the #top.blank.
    If you clear the cache and the above css still doesn’t work, try adding it to your WordPress ▸ Customize ▸ Additional CSS, it has a highest priority.

    Best regards,
    Mike

    #1434176

    Perfect! Mike :) Ismael owes you a cup of coffee and SO DO I. LOL :)

    #1434240

    Hi,

    Glad to know this has been resolved! Please feel free to open another thread if you have more questions about the theme.

    Have a nice day!

    Best regards,
    Ismael

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Link with lightbox only content option’ is closed to new replies.