Search

Hello, is it possible - and how - to use XPath Syntax on Datasources like Using it for DynamicXML ?

I’d like to filter my Datasource ‘Article’ by XPath Expressions.

(I know I could do it in my template later on, but if I could do it before a. debugging would be easier, b. the amount of XML data sent to the page is smaller).

Thanks for your Reply in advance.

Thomas.

Hi Thomas, welcome to the forum!

Unfortunately not, you can’t use XPath expressions in Data Source filters. I believe this is a planned feature one day but likely in Symphony 3 or beyond.

Is there something specific you’re trying to do? You should be able to achieve similar results using the Output Parameter option from another Data Source.

The plan to allow XPath expressions for data source filters has been around since mid last year and internally, it’s on the top of our list in terms of feature implementation.

However, this is a fairly big undertaking and we’ve decided to leave this out until we’ve done some other important structural changes such as swapping out Symphony’s underlying XML generation system before tackling it.

As Nick said, this is currently being looked at for Symphony 3.

Thanks for your reply. I did not see in deep how the combining of 2 or three datasources is working. I.e. if I create a structure like in Stephen Bau’s great tutorial, I need to filter all entries per section per entry per item.

My Question in detail:

I have 1 ore more datasources attached to my Page and I need to get the only XML for the section matching the title of the page and all subpages (=entries) with its items.

How would this be setup by X datasources and the output parameter?

How can I deal with the SelectBox Link?

Tirili: I’m not really following your question. Can you please elaborate on your particular set up and try to use real examples.

For example, “I am trying to set up a portfolio section. I want a page to display entries that are filtered by a field, called Portfolio Categories. On this page, I have an URL Parameter called categories that I want to use to filter the data source”.

I think there are some terms that need to be clarified since they have special meaning in Symphony. What do you mean by:

  • Page - A Symphony Page or a URL page on your website?
  • Subpages - A Symphony URL parameter or a physical Symphony page?
  • Title - HTML <title>, a field called title or the handle of a field called title?
  • Items - An entry in Symphony?

Thanks Allen and sorry for inconvenience. So I will ask with giving a example.

I’d like to setup a website with following structure and I get stuck in the creation of the Blueprints>Sections and the Blueprint>Components. So any help will be appreciated:

It’s a page about german schoolsystem with following structure.

[school] has children: [music], [languages], [science]

[music] has children: [piano], [choir], [orchestra]
[language] has children: [1st-lang], [2nd-lang], [3rd-lang]
- [1st-lang] has children [english], [french], [latin]
- [2nd-lang] has children (same as 1st lang) plus [russian]
- [3rd-lang] has children (same as 2nd lang) plus [spanish],[italian],[hebrew]
[science] has children: [biology], [chemistry], [physics]

I now need a hint how to setup the Blueprint>Sections with Select Box Links and so on to get it all in content. And how to define the corresponding datasources to get only the content concerning the top page. And, how can I define that 2nd-lang has all of 1st-lang plus … etc.

With XPath I will be able to setup my XSL Template to display the children if no child is defined by URL Parameter, and so on, there is no need to help, just to setup the structure and the filters.

Thanks for your help in advance.

Thomas.

How much information do you need to capture with all these sections? Is it just a name, or is there lots of other information attached to languages, sciences, and music classes?

To understand the structure, it is currently just name and a description. But could be extended lateron.

Unfortunately, what you are asking can be done in multitude of ways and without knowing more information, such as, what does each section hold? To me, children or children sections, as you put it, should actually be entries. I think you might be better off reading some tutorials first here and here to get a better idea on how you’d like to approach things.

But to help start you off, here’s a basic step-by-step on one way that you might want to take it:

  1. Create [School] section.
  2. Create each of the child sections. i.e [music] with 3 entries, [piano], [choir] and [orchestra].
  3. For every child section, add a “School” section link, linking it to the [School ID] section.
  4. Create a page, with the URL Param school.
  5. Create data sources for each of your child sections, filter the [School ID] field with {$school} URL Param.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details