{"id":26034,"date":"2022-08-19T10:23:03","date_gmt":"2022-08-19T14:23:03","guid":{"rendered":"https:\/\/plumrocket.com\/docs\/?p=26034"},"modified":"2022-08-19T10:23:21","modified_gmt":"2022-08-19T14:23:21","slug":"how-to-add-custom-html-in-magento-2-social-login-extension","status":"publish","type":"post","link":"https:\/\/plumrocket.com\/docs\/magento-social-login-pro\/v4\/devguide\/custom-html","title":{"rendered":"How to Add Custom HTML in Magento 2 Social Login Extension"},"content":{"rendered":"\n<p>This developer guide is for <a href=\"\/magento-social-login-pro\">Magento 2 Social Login Pro<\/a> extension to demonstrate how to display any custom HTML only if the social buttons are displayed.<\/p>\n\n\n\n<h2 id=\"h-adding-html-code-to-phtml-file\">Adding HTML code (to phtml file)<\/h2>\n\n\n\n<p>In order to show any HTML code only if social buttons are displayed, use the code while editing phtml file:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-php\">&lt;?php if($this->helper('PlumrocketSocialLoginFreeHelperData')->hasButtons()): ?>\n    &lt;!-- Custom Html -->\n    &lt;?php echo $this->getLayout()\n        ->createBlock(\"PlumrocketSocialLoginProBlockButtons\")\n        ->setTemplate(\"Plumrocket_SocialLoginPro::customer\/form\/login\/buttons.phtml\")\n        ->toHtml(); ?>\n    &lt;!-- Custom Html -->\n&lt;?php endif; ?><\/code><\/pre><\/div>\n\n\n\n<p><div class=\"example-block\">\r\n    <p class=\"example-block-title\">Code Example<\/p>\r\n\r\n    <div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-php\">&lt;?php if($this-&gt;helper('PlumrocketSocialLoginFreeHelperData')-&gt;hasButtons()): ?&gt;\n        &lt;div class=\"pslogin-spacer pslogin-clearfix\"&gt;\n            &lt;table&gt;\n                &lt;tr&gt;\n                    &lt;td&gt;&lt;div class=\"pslogin-border\"&gt;&lt;\/div&gt;&lt;\/td&gt;\n                    &lt;td class=\"pslogin-bordertext w25\"&gt;&lt;?php echo __('OR'); ?&gt;&lt;\/td&gt;\n                    &lt;td&gt;&lt;div class=\"pslogin-border\"&gt;&lt;\/div&gt;&lt;\/td&gt;\n                &lt;\/tr&gt;\n            &lt;\/table&gt;\n        &lt;\/div&gt;\n        &lt;?php echo $this-&gt;getLayout()\n            -&gt;createBlock(\"PlumrocketSocialLoginProBlockButtons\")\n            -&gt;setTemplate(\"Plumrocket_SocialLoginPro::customer\/form\/login\/buttons.phtml\")\n            -&gt;toHtml(); ?&gt;\n     &lt;?php endif; ?&gt;<\/code><\/pre><\/div>\r\n<\/div><\/p>\n\n\n\n<h2 id=\"adding-html-code-to-html-file\">Adding HTML code (to html file)<\/h2>\n\n\n\n<p>In order to show any HTML code only if social buttons are displayed, use the code while editing html file:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-javascript\">&lt;!-- Custom Html with attribute data-bind=\"if: window.psloginButtons\" -->\n&lt;div data-bind=\"html: window.psloginButtons\">&lt;\/div>\n&lt;!-- Custom Html with attribute data-bind=\"if: window.psloginButtons\" -->\n    <\/code><\/pre><\/div>\n\n\n\n<p><div class=\"example-block\">\r\n    <p class=\"example-block-title\">Code Example<\/p>\r\n\r\n    <div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-javascript\">&lt;div class=\"pslogin-spacer pslogin-clearfix\" data-bind=\"if: window.psloginButtons\"&gt;\n        &lt;table&gt;\n            &lt;tr&gt;\n                &lt;td&gt;&lt;div class=\"pslogin-border\"&gt;&lt;\/div&gt;&lt;\/td&gt;\n                &lt;td class=\"pslogin-bordertext w25\" data-bind=\"i18n: 'OR'\"&gt;&lt;\/td&gt;\n                &lt;td&gt;&lt;div class=\"pslogin-border\"&gt;&lt;\/div&gt;&lt;\/td&gt;\n            &lt;\/tr&gt;\n        &lt;\/table&gt;\n    &lt;\/div&gt;\n    &lt;div data-bind=\"html: window.psloginButtons\"&gt;&lt;\/div&gt;<\/code><\/pre><\/div>\r\n<\/div><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This developer guide is for Magento 2 Social Login Pro extension to demonstrate how to display any custom HTML only if the social buttons are displayed. Adding HTML code (to phtml file) In order to show any HTML code only if social buttons are displayed, use the code while editing phtml file: Code Example &lt;?php &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/plumrocket.com\/docs\/magento-social-login-pro\/v4\/devguide\/custom-html\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Add Custom HTML in Magento 2 Social Login Extension&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[360],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v17.2 (Yoast SEO v17.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Add Custom HTML in Magento 2 Social Login Extension - Plumrocket Documentation<\/title>\n<meta name=\"description\" content=\"This developer guide is for Magento 2 Social Login Pro extension to demonstrate how to display any custom HTML only if the social buttons are displayed.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/plumrocket.com\/docs\/magento-social-login-pro\/v4\/devguide\/custom-html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Add Custom HTML in Magento 2 Social Login Extension\" \/>\n<meta property=\"og:description\" content=\"This developer guide is for Magento 2 Social Login Pro extension to demonstrate how to display any custom HTML only if the social buttons are displayed.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/plumrocket.com\/docs\/magento-social-login-pro\/v4\/devguide\/custom-html\" \/>\n<meta property=\"og:site_name\" content=\"Plumrocket Documentation\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-19T14:23:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-19T14:23:21+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Plumrocket\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Add Custom HTML in Magento 2 Social Login Extension - Plumrocket Documentation","description":"This developer guide is for Magento 2 Social Login Pro extension to demonstrate how to display any custom HTML only if the social buttons are displayed.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/plumrocket.com\/docs\/magento-social-login-pro\/v4\/devguide\/custom-html","og_locale":"en_US","og_type":"article","og_title":"How to Add Custom HTML in Magento 2 Social Login Extension","og_description":"This developer guide is for Magento 2 Social Login Pro extension to demonstrate how to display any custom HTML only if the social buttons are displayed.","og_url":"https:\/\/plumrocket.com\/docs\/magento-social-login-pro\/v4\/devguide\/custom-html","og_site_name":"Plumrocket Documentation","article_published_time":"2022-08-19T14:23:03+00:00","article_modified_time":"2022-08-19T14:23:21+00:00","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Plumrocket","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/plumrocket.com\/docs\/#website","url":"https:\/\/plumrocket.com\/docs\/","name":"Plumrocket Documentation","description":"Extensions docs, troubleshootings etc.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/plumrocket.com\/docs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/plumrocket.com\/docs\/magento-social-login-pro\/v4\/devguide\/custom-html#webpage","url":"https:\/\/plumrocket.com\/docs\/magento-social-login-pro\/v4\/devguide\/custom-html","name":"How to Add Custom HTML in Magento 2 Social Login Extension - Plumrocket Documentation","isPartOf":{"@id":"https:\/\/plumrocket.com\/docs\/#website"},"datePublished":"2022-08-19T14:23:03+00:00","dateModified":"2022-08-19T14:23:21+00:00","author":{"@id":"https:\/\/plumrocket.com\/docs\/#\/schema\/person\/c96fccdb89342ae6804272265723eca8"},"description":"This developer guide is for Magento 2 Social Login Pro extension to demonstrate how to display any custom HTML only if the social buttons are displayed.","breadcrumb":{"@id":"https:\/\/plumrocket.com\/docs\/magento-social-login-pro\/v4\/devguide\/custom-html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/plumrocket.com\/docs\/magento-social-login-pro\/v4\/devguide\/custom-html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/plumrocket.com\/docs\/magento-social-login-pro\/v4\/devguide\/custom-html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Magento 2 Extensions","item":"https:\/\/plumrocket.com\/magento-extensions"},{"@type":"ListItem","position":2,"name":"Magento 2 Social Login Pro","item":"https:\/\/plumrocket.com\/magento-social-login-pro"},{"@type":"ListItem","position":3,"name":"Documentation","item":"https:\/\/plumrocket.com\/docs\/magento-social-login-pro"},{"@type":"ListItem","position":4,"name":"v4","item":"https:\/\/plumrocket.com\/docs\/magento-social-login-pro\/v4"},{"@type":"ListItem","position":5,"name":"Developer Guide","item":"https:\/\/plumrocket.com\/docs\/magento-social-login-pro\/v4\/devguide"},{"@type":"ListItem","position":6,"name":"How to Add Custom HTML"}]},{"@type":"Person","@id":"https:\/\/plumrocket.com\/docs\/#\/schema\/person\/c96fccdb89342ae6804272265723eca8","name":"Plumrocket","image":{"@type":"ImageObject","@id":"https:\/\/plumrocket.com\/docs\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/10c44aa45aab391250913d982e552e53?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/10c44aa45aab391250913d982e552e53?s=96&d=mm&r=g","caption":"Plumrocket"}}]}},"_links":{"self":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/26034"}],"collection":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/comments?post=26034"}],"version-history":[{"count":2,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/26034\/revisions"}],"predecessor-version":[{"id":26036,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/26034\/revisions\/26036"}],"wp:attachment":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/media?parent=26034"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/categories?post=26034"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/tags?post=26034"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}