Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] BP Globals not setting up correctly in Custom Component


  • ripulkr
    Participant

    @ripulkr

    I am developing a custom BP component but have been unable to get the global variables right. I am developing over the skeleton component and following the groups component. It is really hard to explain everything, but I have zeroed in on following :

    Unfortunately the component is unable to assign variables like : $bp->current_component, $bp->is_single_item

    just like groups component I want to identify single group (single XXX) and all groups (all XXX) page. All XXX is working but when I click on single item it shows up in the all XXX template which is XXX -> index.php

    Can anyone shed some light here, what I may be doing incorrectly here…

Viewing 2 replies - 1 through 2 (of 2 total)

  • ripulkr
    Participant

    @ripulkr

    More…

    I found that the function responsible for setting up globals is bp_core_set_uri_globals, the strange thing is that it defines globals based on the URI values.

    The url of my custom component is like

    abc.com/component/single-slug

    But still BP is unable assign global variables correctly…

    How can I force BP to setup the global vars..


    ripulkr
    Participant

    @ripulkr

    Never mind, I found an alternate route.. A custom function which takes the url and assigns values to the global variables. Hook it to bp_setup_global action.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] BP Globals not setting up correctly in Custom Component’ is closed to new replies.
Skip to toolbar