Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
sign in box built into page
Hi Guys, I have a custom homepage (using custom pages plugin) and I would like to have the stuff that pops up in the signin window (username and password boxes, sso button, etc) built into my homepage in a div at the top. Just wonder how I would do this this (my php isn't great im still learning)?
Tagged:
0
Best Answer
-
x00 MVP
Basically adapting the existing form.
<div> <?php $Form = Gdn::Factory('Form'); echo $Form->Open(array('Action' => $this->Data('FormUrl', Url('/entry/signin')), 'id' => 'Form_User_SignIn')); //echo $Form->Errors(); ?> <ul> <li> <?php echo $Form->Label('Email/Username', 'Email'); echo $Form->TextBox('Email'); ?> </li> <li> <?php echo $Form->Label('Password', 'Password'); echo $Form->Input('Password', 'password', array('class' => 'InputBox Password')); echo Anchor(T('Forgot?'), '/entry/passwordrequest', 'ForgotPassword'); ?> </li> <li class="Buttons"> <?php echo $Form->Button('Sign In'); echo $Form->CheckBox('RememberMe', T('Keep me signed in'), array('value' => '1', 'id' => 'SignInRememberMe')); ?> </li> </ul> <?php echo $Form->Close(); ?> </div>
grep is your friend.
1
Answers
I think its possible. Look the code in views folder and copy the same.
There was an error rendering this rich post.
I did this in the first version of VanillaBootstrap, you can find the code here: https://github.com/kasperisager/VanillaBootstrap/blob/v0.9a-2.0/views/default.master.tpl#L80
It should be pretty straight forward as it's just a simple HTML form.
Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub
Thanks @kasperisager for the replies i think @aery is on the right track I have had a look in \application\dashboard\view\entry files and tried copying various code but not having any luck as am not sure what file to copy from. Hoping @Todd or someone can answer this
Just an idea. You'll probably have more help, if you post your code and where you are having problems and a link to your site showing the problem. Otherwise, it seems like you want someone to write it for you from scratch (which may or may not happen). Often times, there are more responses when you show that you have been putting energy into it and provide your work thus far.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Thanks peregrine. Basically I have a blank page (custompages plugin) Im wanting to have the things that appear in the sign-in popup on this page. I can get the html code by viewing source of signin popup and just coping that to the page and it seems to work. But i was hoping there is some php i could use (eg from one of the pages in \application\dashboard\view\entry) that would be much cleaner probably better?
Just use the php code from the form...
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
Im guessing you mean the php code from the \application\dashboard\view\entry\signin.php page in vannila? If so yeah I tried this but am getting a bonk error also tried the index.php with the same result
Sorry im not able to get to a dev box, but if you post the code that you pit in the page and the details of the bonk ill try to help debug. Its likely missing some innocuos object reference or something.
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
thanks alot cause my php is skills are fairly limited.
signin.php
and index.php
Can you turn on debugging and post the error message?
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
Thanks (sorry I didnt know about debugging) error from index.php
Could not find a 'signin' view for the 'plugin' controller in the 'dashboard' application.
The error occurred on or near: /home/mmatippi/domains/mma-tipping.com/public_html/fs/library/core/class.controller.php (line 780 was highlighted)
Error message for signin.php:
Could not find a 'passwordform' view for the 'plugin' controller in the 'dashboard' application. With same code as above
uncomment line 778 and see what that displays.
add
var_dump($ViewPaths);
before lines starting with 1 2 3 and 4 - lines 748 thru lines 761
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
sorry I just realised I left the message at the top of page off. It was:
Fatal Error in PluginController.FetchViewLocation(); then error I posted above
Thanks peregrine I will try this when I get home
the code
php include($this->FetchViewLocation('SignIn'));
is trying to find a view called signin that is related to the controller that called the view you are in (plugin controller)
while there may be other solutions... i would suggest either copying the view file Signin to the views directory of the custom pages plugin, or removing the include and absorbing the code from that view into the page you are creating.
an alternate would be to invoke the view by referencing it via the proper controller, but i don't have a quick answer on how to do that.
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
include($this->FetchViewLocation('SignIn', 'entry', 'dashboard'));
grep is your friend.
thanks x00 for the help but I get the same error putting that code in. hbf I tried copying the Signin view file over but didnt have any luck.
Thanks, we need to document th interface and all of the overloads for these useful core functions on the wiki...
Im a bit perplexed that adding the controller and application path to the view fetch didnt work. I would bet the error was similar but not the exact same... probably a different object we need to get a proper handle on. Maybe try it again and copy paste the precise error in here again..
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
here you go, sorry I'm probably something simple wrong, its a bit complex for me
Fatal Error in PluginController.FetchViewLocation();
Could not find a 'passwordform' view for the 'plugin' controller in the 'dashboard' application.
The error occurred on or near: /home/mmatippi/domains/mma-tipping.com/public_html/fs/library/core/class.controller.php
Backtrace:
Variables in local scope: