Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
sadams101 Posted August 17, 2018 Posted August 17, 2018 I would like to modify my Guest Sign Up Widget to only show the Facebook sign in option, but still keep all of my current sign in options (~5) on the regular sign in page. Does anyone know how I can comment out some of the options from appearing in the widget?
Joel R Posted August 18, 2018 Posted August 18, 2018 Do you have IP.Pages? I was thinking you could create your own custom block in IP.Pages ("custom guest sign up widget) and just copy and paste over the HTML from the guest sign up widget. That way you can manipulate the HTML as much as you want while preseving the original.
sadams101 Posted August 18, 2018 Author Posted August 18, 2018 I do have Pages, so thank you for offering this as an approach, but I'm not exactly sure where the code is for the guest sign up widget...do you know? PS - I think I found it...I will try this and let you know. {{$buttonMethods = $login->buttonMethods();}} {{$usernamePasswordMethods = $login->usernamePasswordMethods();}} {{if $orientation == 'vertical'}} <div class='ipsWidget_inner ipsPos_center ipsPad'> <div class="ipsAreaBackground_light ipsPad"> <h2 class="ipsType_sectionHead ipsSpacer_bottom ipsSpacer_half">{$title}</h2> <p class="ipsType_richText ipsType_contained"> {$text|raw} </p> {{if $usernamePasswordMethods}} <ul class="ipsList_inline"> <li> <a href='{url="app=core&module=system&controller=login" seoTemplate="login"}' class="ipsButton ipsButton_primary ipsButton_verySmall ipsPos_right">{lang="sign_in_short"}</a> </li> <li>{lang="or"}</li> <li> <a href='{url="app=core&module=system&controller=register" seoTemplate="register"}' class="ipsButton ipsButton_primary ipsButton_verySmall ipsPos_right">{lang="sign_up"}</a> </li> </ul> {{endif}} {{if $buttonMethods}} <div class=''> <form accept-charset='utf-8' method='post' action='{$login->url}' data-controller="core.global.core.login"> <input type="hidden" name="csrfKey" value="{expression="\IPS\Session::i()->csrfKey"}"> <input type="hidden" name="ref" value="{expression="base64_encode( \IPS\Request::i()->url() )"}"> {{foreach $buttonMethods as $method}} <div class='ipsType_center ipsPos_center ipsSpacer_top'> {$method->button()|raw} </div> {{endforeach}} </form> </div> {{endif}} </div> </div> {{else}} <div class='ipsWidget_inner ipsPos_center ipsPad_half'> <div class="ipsAreaBackground_light ipsPad"> <div class="ipsGrid ipsGrid_collapsePhone"> <div class='ipsGrid_span{{if $buttonMethods}}9{{endif}}'> <h2 class="ipsType_sectionHead ipsSpacer_bottom ipsSpacer_half">{lang="widget_guestsignup_title"}</h2> <p class="ipsType_richText ipsType_contained"> {lang="widget_guestsignup_text"} </p> {{if $usernamePasswordMethods}} <ul class="ipsList_inline"> <li> <a href='{url="app=core&module=system&controller=login" seoTemplate="login"}' class="ipsButton ipsButton_primary ipsButton_verySmall ipsPos_right">{lang="sign_in_short"}</a> </li> <li>{lang="or"}</li> <li> <a href='{url="app=core&module=system&controller=register" seoTemplate="register"}' class="ipsButton ipsButton_primary ipsButton_verySmall ipsPos_right">{lang="sign_up"}</a> </li> </ul> {{endif}} </div> {{if $buttonMethods}} <div class='ipsGrid_span3 cSignInTeaser_right'> <form accept-charset='utf-8' method='post' action='{$login->url}' data-controller="core.global.core.login"> <input type="hidden" name="csrfKey" value="{expression="\IPS\Session::i()->csrfKey"}"> <input type="hidden" name="ref" value="{expression="base64_encode( \IPS\Request::i()->url() )"}"> {{foreach $buttonMethods as $method}} <div class='ipsPad_half ipsType_center ipsPos_center'> {$method->button()|raw} </div> {{endforeach}} </form> </div> {{endif}} </div> </div> </div> {{endif}}
sadams101 Posted August 18, 2018 Author Posted August 18, 2018 Not being a coder I don't see a way to make only the Facebook button appear.
Bluto Posted August 19, 2018 Posted August 19, 2018 (edited) You're going to probably need something like below. The foreach is a loop that is going to grab each button. Since you only want facebook, we're going to add an if statement that says, if, during the loop, facebook shows up, output that button. Obviously, if you don't have the facebook button active the button will now show. Not sure about the $method->button()->facebook but it should be something like that. {{if $buttonMethods}} <div class='ipsGrid_span3 cSignInTeaser_right'> <form accept-charset='utf-8' method='post' action='{$login->url}' data-controller="core.global.core.login"> <input type="hidden" name="csrfKey" value="{expression="\IPS\Session::i()->csrfKey"}"> <input type="hidden" name="ref" value="{expression="base64_encode( \IPS\Request::i()->url() )"}"> {{foreach $buttonMethods as $method}} {{if $medthod->button()->facebook}} <div class='ipsPad_half ipsType_center ipsPos_center'> {$method->button()|raw} </div> {{endif}} {{endforeach}} </form> </div> {{endif}} Just remember, modify the template code now, modify the template code forever. If you do modify the template code, before and after the edit put: <!--- MY MOD STARTS HERE --> <!--- MY MOD ENDS HERE --> Using the above allows you to search for "MY MOD" and that way you know where the edits are when you upgrade. Hope this helps! Edited August 19, 2018 by Bluto sadams101 1
sadams101 Posted August 19, 2018 Author Posted August 19, 2018 Thank you for this. I've been testing but still can't get the facebook button showing. Here is what the facebook code looks like for that button: <div class='ipsPad_half ipsType_center ipsPos_center'> <button type="submit" name="_processLogin" value="5" class='ipsButton ipsButton_verySmall ipsButton_fullWidth ipsSocial ipsSocial_facebook' style="background-color: #3a579a"> <span class='ipsSocial_icon'> <i class='fa fa-facebook-official'></i> </span> <span class='ipsSocial_text'>Sign in with Facebook</span> </button> </div>
sadams101 Posted August 22, 2018 Author Posted August 22, 2018 So I guess I'm stuck on this. I'm not sure what to include for the button name in this line: $method->button()->facebook
sadams101 Posted August 29, 2018 Author Posted August 29, 2018 Anyone else who wants to do this try: {{$buttonMethods = $login->buttonMethods();}} {{$usernamePasswordMethods = $login->usernamePasswordMethods();}} {{if $orientation == 'vertical'}} <div class='ipsWidget_inner ipsPos_center ipsPad'> <div class="ipsAreaBackground_light ipsPad"> <h2 class="ipsType_sectionHead ipsSpacer_bottom ipsSpacer_half">{$title}</h2> <p class="ipsType_richText ipsType_contained"> {$text|raw} </p> {{if $usernamePasswordMethods}} <ul class="ipsList_inline"> <li> <a href='{url="app=core&module=system&controller=login" seoTemplate="login"}' class="ipsButton ipsButton_primary ipsButton_verySmall ipsPos_right">{lang="sign_in_short"}</a> </li> <li>{lang="or"}</li> <li> <a href='{url="app=core&module=system&controller=register" seoTemplate="register"}' class="ipsButton ipsButton_primary ipsButton_verySmall ipsPos_right">{lang="sign_up"}</a> </li> </ul> {{endif}} {{if $buttonMethods}} <div class=''> <form accept-charset='utf-8' method='post' action='{$login->url}' data-controller="core.global.core.login"> <input type="hidden" name="csrfKey" value="{expression="\IPS\Session::i()->csrfKey"}"> <input type="hidden" name="ref" value="{expression="base64_encode( \IPS\Request::i()->url() )"}"> {{foreach $buttonMethods as $method}} {{if $method->getTitle() == 'login_handler_Facebook'}} <div class='ipsType_center ipsPos_center ipsSpacer_top'> {$method->button()|raw} </div> {{endif}} {{endforeach}} </form> </div> {{endif}} </div> </div> {{else}} <div class='ipsWidget_inner ipsPos_center ipsPad_half'> <div class="ipsAreaBackground_light ipsPad"> <div class="ipsGrid ipsGrid_collapsePhone"> <div class='ipsGrid_span{{if $buttonMethods}}9{{endif}}'> <h2 class="ipsType_sectionHead ipsSpacer_bottom ipsSpacer_half">{lang="widget_guestsignup_title"}</h2> <!-- lines below removed by scott <p class="ipsType_richText ipsType_contained"> {lang="widget_guestsignup_text"} </p> END removed --> {{if $usernamePasswordMethods}} <ul class="ipsList_inline"> <li> <a href='{url="app=core&module=system&controller=login" seoTemplate="login"}' class="ipsButton ipsButton_primary ipsButton_verySmall ipsPos_right">{lang="sign_in_short"}</a> </li> <li>{lang="or"}</li> <li> <a href='{url="app=core&module=system&controller=register" seoTemplate="register"}' class="ipsButton ipsButton_primary ipsButton_verySmall ipsPos_right">{lang="sign_up"}</a> </li> </ul> {{endif}} </div> {{if $buttonMethods}} <div class='ipsGrid_span3 cSignInTeaser_right'> <form accept-charset='utf-8' method='post' action='{$login->url}' data-controller="core.global.core.login"> <input type="hidden" name="csrfKey" value="{expression="\IPS\Session::i()->csrfKey"}"> <input type="hidden" name="ref" value="{expression="base64_encode( \IPS\Request::i()->url() )"}"> {{foreach $buttonMethods as $method}} {{if $method->getTitle() == 'login_handler_Facebook'}} <div class='ipsPad_half ipsType_center ipsPos_center'> {$method->button()|raw} </div> {{endif}} {{endforeach}} </form> </div> {{endif}} </div> </div> </div> {{endif}}
SC36DC Posted April 28, 2020 Posted April 28, 2020 How does one go about changing the color scheme of the Guest Sign Up Widget? Is there a setting in ACP or is it done with css? Thank you.
Recommended Posts