Skip to:

Adding Component to Groups Tab results in 404

  • Profile photo of bludragon


    I have created a custom component using the latest skeleton framework that needs to have its URLs as part of the current group. I have accomplished this is in my component’s setup_nav() function, but when I try to access the URL I get a 404 error. I have been trying to solve this issue for the last couple of day with no luck. Could someone kindly point me in the right direction?

    Here is my component’s setup_nav method:

    `function setup_nav()
    $link = trailingslashit(bp_get_root_domain().’/’.bp_get_groups_root_slug().’/’.bp_get_current_group_slug().’/’.bp_get_announcements_slug());
    $slug = bp_get_announcements_slug();

    $main_nav = array(‘name’ => __(‘Announcements’, ‘bp-announcements’),
    ‘slug’ => bp_get_current_group_slug(),
    ‘position’ => -1,
    ‘screen_function’ => ‘bp_announcements_screen_list’,
    ‘default_subnav_slug’ => ‘all’);
    $sub_nav[] = array(‘name’ => __(‘All Announcements’, ‘bp-announcements’),
    ‘slug’ => ‘all’,
    ‘parent_url’ => $link,
    ‘parent_slug’ => bp_get_current_group_slug(),
    ‘screen_function’ => ‘bp_announcements_screen_list’,
    ‘position’ => 10);

Viewing 1 replies (of 1 total)
  • Profile photo of bludragon


    I think I’ve figured out the issue. Even though my screens.php file is listed in my includes method, for some reason the function “bp_announcements_screen_list” does not work (perhaps it isn’t being loaded?) If I change the value to a method in the component class (`’screen_function’ => aray(&$this,’ bp_announcements_screen_list’)`), I can echo a string and have it show up on the 404 page (at least I get one – before I got nothing). Now I just need to figure out where to go from here.

    Edit: I figured out what was wrong with my screens.php – I had to copy my template files over to my current theme.

Viewing 1 replies (of 1 total)
  • The topic ‘Adding Component to Groups Tab results in 404’ is closed to new replies.
Skip to toolbar