Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Document DataSource Content Path "/{0}/%" returns no results View modes: 
User avatar
Member
Member
_charleswesley - 8/9/2013 5:58:48 PM
   
Document DataSource Content Path "/{0}/%" returns no results
I would like to have a Document DataSource web part return all documents of a specified Document Type that exist under the parent document.

For example, say you have the following documents:

Root
- Foo
---- Foo1
---- Foo2
- Bar
---- Bar1
---- Bar2

Both Foo and Bar use the same page template with a Document Data Source web part.

I can always return [Foo1, Foo2] if I set the Document Data Source control's Content Path property to "/Foo/%"

I can get the control to return [Foo1, Foo2, Bar1, Bar2] if I set the path to "/%".

What I need is to only return [Foo1, Foo2] or [Bar1, Bar2] depending on which page is using the template.

I am doing this already with a CSS List Menu web part which uses the path "/{0}/%".

What I can't figure out is why a content path of "/{0}/%" returns zero records for the Document Data Source web part but does return records for the CSS List Menu web part.

Any suggestions?

User avatar
Member
Member
Accepted solutionAccepted solution
_charleswesley - 8/9/2013 6:12:54 PM
   
RE:Document DataSource Content Path "/{0}/%" returns no results
Of course after you take the time to post a question you find the answer :)

I was reading through the documentation on Path Expressions and found the following, which solved my problem:

Using relative paths

You can use relative paths expressions to specify sub-documents or parent documents:

Examples:

. - current path
.. - parent document of the current path
./Product - document Product under the current path
../Product - document Product under the parent document of the current path
./% - all documents under the current path
../% - all documents under the parent document of the current path

User avatar
Member
Member
kentico_sandroj - 8/9/2013 9:30:21 PM
   
RE:Document DataSource Content Path "/{0}/%" returns no results
Hello,

Thank you for sharing the solution which may help others facing this issue. Path Expressions can get tricky so it's good to familiarize with this document or bookmark it :)