1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

set the registration page as the homepage

Discussion in 'Styling and Customization Questions' started by time, Jun 27, 2013.

  1. time

    time Active Member

    So I wanted to do facebook homepage, I just want to set the registration page as the homepage. You know what helped me do it.
     
  2. time

    time Active Member

  3. time

    time Active Member

  4. James

    James Well-Known Member

    time likes this.
  5. Jeremy

    Jeremy XenForo Moderator Staff Member

    Bumping your thread will have no bearing on getting support, especially within 24 hours of your original thread post date. You should give it at least a day or two before doing any sort of bump. Other than that, see James' post.
     
    LPH likes this.
  6. time

    time Active Member

    Thanks @James (y)

    Thanks @King Kovifor :)
     
  7. time

    time Active Member

    @James I could not have done, because it is too much for my level
     
  8. James

    James Well-Known Member

    In which case post in add-on requests and see if someone can whip one up for you. I cannot at current as I have no access to an installation of XenForo.
     
    time likes this.
  9. time

    time Active Member

    Hi @James ,
    I'm done with Recent Activity - node page for better results

    but with register: The controller XenForo_ControllerPublic_register does not define an action called Index.

    Here is the code I used
    Code:
    <?php
     
      class CustomIndex_addon2
      {
          public static function initDependencies(XenForo_Dependencies_Abstract $dependencies, array $data)
          {
              if (!$dependencies instanceof XenForo_Dependencies_Public)
              {
                  return;
              }
    
        $config = new Zend_Config(array(
            'routePrefix'    => 'register',
            'controllerClass' => 'XenForo_ControllerPublic_register',
        ));
        GeekPoint_CustomIndex_Helper::setDefaultRoute($config, $data);
    }
      }
     
      ?>
     
  10. James

    James Well-Known Member

    Register needs to be uppercase.
    Register not register.
     
    time likes this.
  11. time

    time Active Member

    Thanks @James
    But

    An exception occurred: Undefined index: Register in /home/mywebsite/domains/mywebsite.com/public_html/mywebsite/library/GeekPoint/CustomIndex/Helper.php on line 39

    1. XenForo_Application::handlePhpError() in GeekPoint/CustomIndex/Helper.php at line 39
    2. GeekPoint_CustomIndex_Helper::setDefaultRoute() in CustomIndex/addon5.php at line 16
    3. CustomIndex_addon5::initDependencies()
    4. call_user_func_array() in XenForo/CodeEvent.php at line 54
    5. XenForo_CodeEvent::fire() in XenForo/Dependencies/Abstract.php at line 180
    6. XenForo_Dependencies_Abstract->preLoadData() in XenForo/FrontController.php at line 125
    7. XenForo_FrontController->run() in /home/mywebsite/domains/mywebsite.com/public_html/mywebsite/index.php at line 13
     
  12. James

    James Well-Known Member

    Can you post an update to your code?
     
    time likes this.
  13. time

    time Active Member

    Thanks @James
    Code:
    <?php
      class CustomIndex_addon5
      {
          public static function initDependencies(XenForo_Dependencies_Abstract $dependencies, array $data)
          {
              if (!$dependencies instanceof XenForo_Dependencies_Public)
              {
                  return;
              }
    
        $config = new Zend_Config(array(
            'routePrefix'    => 'Register',
            'controllerClass' => 'XenForo_ControllerPublic_Register',
        ));
        GeekPoint_CustomIndex_Helper::setDefaultRoute($config, $data);
    }
      }
      ?>
    and I used XenForo 1.1.5
     
  14. James

    James Well-Known Member

    The routePrefix should have a lowercase register, I believe.
     
    time likes this.
  15. time

    time Active Member

    It's great. Thank you very much. Thank @James .
     
    James likes this.
  16. time

    time Active Member

    Code:
    <?php
    
      class CustomIndex_addon1
      {
          public static function initDependencies(XenForo_Dependencies_Abstract $dependencies, array $data)
          {
              if (!$dependencies instanceof XenForo_Dependencies_Public)
              {
                  return;
              }
    
        $config = new Zend_Config(array(
            'routePrefix'    => 'pages',
            'controllerClass' => 'XenForo_ControllerPublic_Page',
            'params'          => array('123' => 'lectus-pretium-consequat'),
        ));
        GeekPoint_CustomIndex_Helper::setDefaultRoute($config, $data);
    }
      }
    
      ?>
    @James

    I used the above code to set page title with 123 (id 16 and url: /pages/123_a/) as the homepage, but the message "The requested page could not be found"

    Can you help me cause of this error.

    Thanks @James
     
  17. James

    James Well-Known Member

    @time

    (Replace "lectus-pretium-consequat" with your node name. Any changes that you make to the page name via Admin Panel need to be reflected in this config array.)

    PHP:
     $config = new Zend_Config(array('routePrefix' => 'pages','controllerClass' => 'XenForo_ControllerPublic_Page','params' => array('node_name' => 'lectus-pretium-consequat'),
     ));
    See my link above to shadabs helper.
     
    time likes this.
  18. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    time likes this.
  19. time

    time Active Member

    Hi @James
    I tried with the code
    Code:
    <?php
    
      class CustomIndex_addon6
      {
          public static function initDependencies(XenForo_Dependencies_Abstract $dependencies, array $data)
          {
              if (!$dependencies instanceof XenForo_Dependencies_Public)
              {
                  return;
              }
    
        $config = new Zend_Config(array('routePrefix' => 'pages','controllerClass' => 'XenForo_ControllerPublic_Page','params' => array('node_name' => '123'),
    ));
        GeekPoint_CustomIndex_Helper::setDefaultRoute($config, $data);
    }
      }
    
      ?>
    123 is the page name. but "The requested page could not be found"


    Thanks @Jake Bunce - I want to set a Page (name:123 -id 16) home page
     
  20. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    time likes this.

Share This Page