Page 1 of 1

Re: Breadcrumb master-detail

Posted: Sat Aug 19, 2017 3:43 pm
by droogers

Hello,

when I am using breadcrumbs with master-detail relation I want to have the possibility to show the value of the master record in the breadcrumb when I am in the detail record. This value comes instead of the the name of the table.

Is this possible?


Re: Breadcrumb master-detail

Posted: Sun Aug 20, 2017 11:26 pm
by Adam

In PHPM 2017, we used code like this in the relevant Page_Render server events:

global $Breadcrumb, $Language;

$Language->setTablePhrase($this->TableVar, 'TblCaption', $Language->Phrase('Profile'));

$Breadcrumb = new cBreadcrumb();
$url = substr(ew_CurrentUrl(), strrpos(ew_CurrentUrl(), '/') + 1);
$Breadcrumb->Add('view', $this->TableVar, $this->AddMasterUrl('user_profilesview.php'), '', $this->TableVar, TRUE);

$PageId = 'edit';
$Breadcrumb->Add('edit', $PageId, $url);

Haven't tried PHPM 2018 yet so can't confirm if the same approach will work, but it might give you a start :)