diff --git a/core/components/breadcrumbs/model/breadcrumbs/breadcrumbs.class.php b/core/components/breadcrumbs/model/breadcrumbs/breadcrumbs.class.php index 8ec1b92..90dc7b2 100644 --- a/core/components/breadcrumbs/model/breadcrumbs/breadcrumbs.class.php +++ b/core/components/breadcrumbs/model/breadcrumbs/breadcrumbs.class.php @@ -42,6 +42,12 @@ function __construct(modX &$modx,array $config = array()) { $this->modx =& $modx; $this->config = array_merge(array( + /** + * Document ID for which to generate Crumbs + * + * @var integer $docId + */ + 'docId' => $modx->resource->get('id'), /** * Max number of elements to have in a path. 100 is an arbitrary * high number. If you make it smaller, like say 2, but you are 5 @@ -262,7 +268,10 @@ public function pullResource($resourceId){ public function run() { /* get current resource parent info */ - $resource =& $this->modx->resource; + $resource = $this->config['docId'] == $this->modx->resource->get('id') + ? $this->modx->resource; + : $this->pullResource($this->config['docId']); + $this->showCurrentPage($resource->get('id')); /* assemble intermediate crumbs */ @@ -327,4 +336,4 @@ public function getChunk($name,array $properties = array()) { } return $o; } -} \ No newline at end of file +}