Job Board Sub Categories

Permalink Browser Info Environment
I'm working with a client who has sub-categories for his jobs. We're putting them in the page structure but have come across a slight tweak we need and i'm not familiar enough with c5 to figure it out - i hoping someone on here can help.

eg

We have

Architecture
- Architects
- Technologist
- Graduates
Engineers
- Civil
- Structural

What we can do is use the search/list function to list jobs under the lowest levels (sub categories), eg, civil, but would like the search/list function to be able to list all jobs under the main categories, eg, if you were in engineers, list jobs in civil AND structural (and engineers for that matter).

I'm guessing it's in the view.php file but i'm not familiar enough to figure out what i need to change.

Any help would be welcome - a vague pointer would at least be a start :)

THanks

Stuart

Type: Discussion
Status: New
droomltd
View Replies:
droomltd replied on at Permalink Reply
droomltd
Had a bit more of a dig around and i guess this is the line(s) I need to modify - out of the controller.php file

if($this->cParentID==-1){
$pagelist->filterByParentID(intval($c->getCollectionID()));
}elseif(intval($this->cParentID)>=1){
$pagelist->filterByParentID(intval($this->cParentID));
}



So I think the question is how to get this bit

$pagelist->filterByParentID(intval($this->cParentID));

to select pages from the parent page and the child pages - if that makes any sense at all :)
droomltd replied on at Permalink Reply
droomltd
Hehe - answering my own question here :)

After a bit of searching I've come up with the answer.

Line 169 of controller.php
if($this->cParentID==-1){ 
   // OLD LINE $pagelist->filterByParentID(intval($c->getCollectionID()));   
$pagelist->filterByPath($c->getCollectionPath(),$includeAllChildren=true);
   }elseif(intval($this->cParentID)>=1){ 
      $pagelist->filterByParentID(intval($this->cParentID));
   }

ie, use filterByPath rather than filterByParentID so you can 'grab' the child pages.

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.