When used with the Buying Buddy PHP class, the OfficeRoster widget can create permalinks for Agent Profile pages.

This method will require requires the Buying Buddy PHP API, htaccess file modifications and rewrite rules.

See the OfficeRoster widget for complete details on how this widget can be used - especially initial view and permalink options.
See Buying Buddy PHP Class and API for details on PHP support.

You must use the latest Buying Buddy Plugin Script (multi-line). If you are adding the Buying Buddy Plugin script with just a single-line <script> (old version) then this method will not work.
See installation instructions for details.

Overview

You will need to parse the Request URI in order to create the slug so the widget calls the correct URL to retrieve the right information.

Use a rewrite rule to send everything to one php page.

Instructions

NOTE: These URLs are built into links on the widget and must be followed

/team  (this page will show Offices but can be overwritten to show roster by default)
/team/office (this will show the Roster of users)
/team/ProfileName (this will show the User Profile)

1. Create a page for the OfficeRoster widget

This should be /team

2. Add Code to Designated Page

// Strip out "/team" to get remaining URI string
// You may need to remove trailing "/" or ".php" depending on your site URL structure
$str = str_replace("/team","",$_SERVER['REQUEST_URI']);

// If there is noting remaining, show the offices or roster as desired
if ( empty($str) ){

$slug = "index"; // use roster instead of index if you want to show the user roster instead of the map with office locations by default

// If the slug contains the word "office" then the page will be showing the office roster (list of offices)
// Because of searching by name, first letter of last name and office_id you want to be sure to append everything after the word office
// examples of what the $slug should look like: roster, roster/last/c, roster/search/xxxx, roster/id/7
} else if ( strpos($str,"office") !== false ){
$slug = str_replace("/office","roster",$str);

// Otherwise it is an agent profile
// example of $slug : agent/name/UserName
} else {
$slug = "agent/name".$str;
}

// Add the optional $slug to the getWidget call
$brokersObj = $mbbObj->getWidget("MBBv3_OfficeRoster", array("filter" => "office:on+mapPin:blue"), $slug );

// Output the widget HTML
<div id="MBBv3_OfficeRoster" filter="office:on+mapPin:blue"><?=$brokersObj->html?></div>

Please contact us via the Help Desk if you need support for this function.

Admin