This shortcode generates button, onclick show popup with page iframe inside.
- popup_page_link: link to page, template "TABLEON Blank Page" should be selected
- button_text: link text, for example: 'Send message to the product manager'
- popup_title: Popup title
- css_class: CSS class of the link
- help_title: text of the link on the popup header from the right
- help_link: link in popup header
Demo shortcode: https://demo.posts-table.com/tableon_popup_iframe_button/
The code as an example for developers:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | add_shortcode('tableon_popup_iframe_button', function($args) { wp_enqueue_script('tableon-helper', TABLEON_ASSETS_LINK . 'js/helper.js', [], TABLEON_VERSION, true); wp_enqueue_script('popup-23', TABLEON_ASSETS_LINK . 'js/popup-23.js', ['tableon-helper'], TABLEON_VERSION, true); wp_enqueue_style('tableon-popup-23', TABLEON_ASSETS_LINK . 'css/popup-23.css', [], TABLEON_VERSION); wp_enqueue_style('tableon-general', TABLEON_ASSETS_LINK . 'css/general.css', [], TABLEON_VERSION); $popup_page_link = ''; if (isset($args['popup_page_link'])) { $popup_page_link = $args['popup_page_link']; } $button_text = 'Send message to the product manager'; if (isset($args['button_text'])) { $button_text = $args['button_text']; } $popup_header_text = ''; if (isset($args['popup_header_text'])) { $popup_header_text = $args['popup_header_text']; } $css_class = ''; if (isset($args['css_class'])) { $css_class = $args['css_class']; } return TABLEON_HELPER::draw_html_item('a', [ 'href' => "javascript: new Popup23({iframe:\"{$popup_page_link}\", title:\"{$popup_header_text}\", style:\"height: 100vh\"});void(0);", 'class' => $css_class ], $button_text); }); |