0

I have the following Wayfinder call:

[[Wayfinder? &startId=`0` &level=`0` &includeDocs=`5,6,7,11,12`]]

This should show the links to the listed resources, which are kept in a parent resource. However, they do not. They only way I can get it to work is to include the parent resource as the startId:

[[Wayfinder? &startId=`3` &level=`0` &includeDocs=`5,6,7,11,12`]]

This is ok if the resources are all under one parent, but I have a variety of resources on a variety of levels and parents that I can not display.

Does anyone know what I am doing wrong?

MeltingDog
  • 14,310
  • 43
  • 165
  • 295

2 Answers2

1

If you specify includeDocs it will only list those docs, so you'll need to either set startId to your parent or include the neccessary parents in the includeDocs call.

(Line 539 in wayfinder.class.php: )

/* if set, limit results to specific resources */
if (!empty($this->_config['includeDocs'])) {
    $c->where(array('modResource.id:IN' => explode(',',$this->_config['includeDocs'])));
}
0

http://rtfm.modx.com/extras/revo/wayfinder - did you see docs?

&level - Depth (number of levels) to build the menu from. '0' goes through all levels. 

if you wanna exclude some documents - just use &excludeDocs property or filter &where, as

&where=`[{"template:!=": "4"}]` 

( get all docs except with template "4"). Docs of where condition - http://rtfm.modx.com/xpdo/2.x/class-reference/xpdoquery/xpdoquery.where

Vasis
  • 2,281
  • 1
  • 16
  • 23
  • Yeah I did read that. If it was working properly then my first example should work as the startId and Level are both set to 0 – MeltingDog Apr 05 '14 at 10:36
  • thanks but I dont want to exclude (there's heaps), only include the ones I have listed. I would have thought I wouldnt even need &startId or &level to do this, but I can only get it to work by setting it up like the 2nd example. In other words, &level and &includeDocs dont seem to work together. – MeltingDog Apr 05 '14 at 10:39
  • With `&where` you can not be only excluded but may filtering results. `&where=\`[{"template": "4"}]\`` - only docs with template "4" – Vasis Apr 05 '14 at 11:01