Get profile id for person menu
I've replace the view profile menu with custom menu i created. now when i hover on info its looks like this: person-profile-info?id={profile_id}
How can i get the profile id? URL in studio is page.php?i=persons-profile-info&id={profile_id}
-
-
·
LeonidS
- ·
Hello Hodor Hodor !
For the person menu, this variable is replaced with the current profile id like you may see in the modules\base\profile\classes\BxBaseModProfileMenuView.php
$this->addMarkers(array(
'profile_id' => $this->_oProfile->id()
));
-
·
LeonidS
-
I did not understand. I need to add this code somewhere?
-
- · Hodor Hodor
- ·
I dont care to keep it but the design of it dont fit my site concept
-
Yes, because the profile links like
page.php?i=persons-profile-info&id={profile_id}
depend from the profile identification. As this part is variable we introduced for the Menu builder similar constants which will be replaced for every profile with actual profile id. Please specify your way with custom menu with more details.
-
- · Hodor Hodor
- ·
I've created custom menu with same items but i've imported using the tool, and set the design to "Site Navigation Submenu", because i want it to scroll and have icons
-
- · Hodor Hodor
- ·
LeonidS u got this?
-
Yes, Hodor Hodor , in this case you need to add the mentioned code to your template site menu. You need to find the file modules\boonex\[your template name]\data\template\system\scripts\BxTemplMenuSite.php
and add the right after the following line:
parent::__construct ($aObject, $oTemplate);
this code:
$this->addMarkers(array(
'profile_id' => bx_get_logged_profile_id()
));
-
- · Hodor Hodor
- ·
its getting into my profile but when I click on different profile
-
-
·
LeonidS
- ·
Please specify the examples with URLs because before it was looking like your made this menu not for profile pages.
-
·
LeonidS
-
- · Hodor Hodor
- ·
It's like i want to see your profile info (https://una.io/page/persons-profile-info?id=895) but it shows mine https://una.io/page/persons-profile-info?id=526
this code:
$this->addMarkers(array(
'profile_id' => bx_get_logged_profile_id() -> get my p_id
));
i dont know php well but if u can pull the id from the url and put it there it should work
for example
$this->addMarkers(array(
var x = getIdFromUrl()
'profile_id' => x
));