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.
Options

Can't seem to get changed views to work.

Hi! I am using Vanilla 2.3. I'm trying to remove the gender and 'why do you want to join' boxes from registration, as well as use a modified terms of service. Through searching through these forums I was able to hide the gender box. But the other two have stumped me.

I copied the default theme, and set my vanilla theme to this copied version. In the copied theme folder I created the /design/views/home and /design/views/entry directories. Then I place a modified registerapproval.php file in /entry with the gender and 'why do...' lines commented out (lines 49,50 and 56,57) . I also placed a new termsofservice.php file in /home, and all I changed about this file was changing the age from 13 to 18. But the gender field remained (until I hide it with CSS), the 'why do...' field remained, and the terms of service still has the default age of 13.

It seems as if the the files I've put into /mytheme/design/views are not taking any effect. The only non-core plugin I have installed is a custom css plugin called CSSedit. Would that cause the trouble?

Comments

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    The structure should be:
    /themes/mytheme/design
    /themes/mytheme/views

    But if you simply want to hide those two boxes, there are better way. Give me some minutes....

  • Options

    Oh hey look at that. Moving views out of /design and into /mytheme worked, but it still requires the "tell us why you want to join" info to actually register. Is this changeable with views or do I need to edit a core file?

  • Options

    It looks like my registration method, approval, requires the Why Do You Want to Join thing. Makes sense now.

  • Options
    R_JR_J Ex-Fanboy Munich Admin
    edited March 2017

    It's advisable to make as few changes as possible. If you can change anything with css, do it. Don't use a custom view if you can avoid it. If the next Vanilla version would enhance that view in any way, you would not even be able to see that!
    So create that file: /themes/mytheme/design/custom.css and save it with this content

    #Form_User_Register li.Gender ,
    #Form_User_Register li.Gender + li
    {
        display: none;
    }
    

    Beware: this will hide the Gender radio buttons and the list item below. If you activate a plugin which adds some information to the registry view, it might get hidden and the "Why do you want to join" appears again.

    Furthermore you need to remove that the reason for joining is required.
    Create a ThemeHooks file. In this file you can do some logic which you would otherwise need to create a plugin for.

    /themes/mytheme/class.mythemethemehooks.php

    <?php
    
    class MyThemeThemeHooks implements Gdn_IPlugin {
        public function setup() {
            return true;
        }
        public function onDisable() {
            return true;
        }
    
        public function entryController_registerValidation_handler($sender, $args) {
             $sender->UserModel->Validation->unApplyRule('DiscoveryText', 'Required');
        }
    }
    

    I haven't tested it, but it should do the trick. If not give feedback. Then we would simply add a default value for that text.

  • Options
    edited March 2017

    That didn't make the "Why do you want to Join" box go away, but it made it optional! Thanks! I think I can make it go away though.

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    Have you seen my CSS? That should hide the "Why do you want to join" box

    @R_J said:

    #Form_User_Register li.Gender ,
    #Form_User_Register li.Gender + li
    {
        display: none;
    }
    
Sign In or Register to comment.