Breadcrumb master-detail

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
droogers
User
Posts: 72

Re: Breadcrumb master-detail

Post 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?


Adam
User
Posts: 480

Post 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 :)


Post Reply