Search

Hi guys,

Well, I didn’t know how to call this topic. I’m new on Symphony and I’m a little lost on one thing.

Here’s the deal:

I have Racing League system with 2 Sections, one called Drivers and one called Series. The Drivers section has all the drivers of the league. On the Series section I need do select from all those drivers whose race in this specific series.

I.E.: Think about NASCAR. There’s a lot of drivers but some race only on SprintCup Series, some only on Nationwide Series and some race on both

Later I’ll need to show in a page all the Series and it’s drivers. Something like this XML:

<series>
    <drivers>
        <driver>
            <car-number></car-number>
            <first-name></first-name>
            <last-name></last-name>
        </driver>
    </drivers>
</series>

After this all said. I’ve tried to add a Select Box Link on the Series section that searches the a Reflection Field from the Drivers section. So far so good, but when I create a Datasource searching that Select Box Link the XML result is something like this:

<series>
    <drivers>
        <driver-full-name></driver-full-name>
    </drivers>
</series>

Any idea of how to achieve my objective?

Huge TIA!

You’ll need to chain your data sources. Have your datasource output the entries’ System ID as its output parameter, and then have a second data source for Drivers that filters by id = $ds-your-first-datasource. See the above link for details.

Certainly I’ll read this! Thank You!

I’ll post my progress (or troubles :P ) here later.

I guess I’m pretty lost! lol I rode that article, tried so many combinations here with no results. (pls be patient, work with DS is very new for me ;) )

I took some screenshots to illustrate better my wishes. Here are my sections: Section > Drivers and Section > Series

Before opening this thread I tried with this datasource: Datasource > Series : Drivers

I created a page with that DS attached and my XML result is: Page > XML

However I need a XML like this (mannualy edited in DW): Desired XML

I think it’s better to understand now, isn’t it? Where I’m getting lost is when I need to create the datasources (which one and it’s properties) and which DS to attach to the page.

You can’t get exactly that XML, but here’s what you could do:

  1. Edit your Series: Drivers data source. Rename it to just Series, and in the bottom left corner, where it says “Parameter Output,” select Drivers and click “Save.”

    Now, when this DS is executed, it’ll create a parameter called $ds-series that contains the IDs of all the drivers attached to the series that are being returned.

  2. Create a new data source called Series: Drivers, set the Source to Drivers. In the filter options, choose System ID from the dropdown and click “Add item.” In the input that appears, enter $ds-series. Configure the rest of the DS as desired and click “Create Data Source”

    So this data source is going to grab all the Drivers attached to the series returned from the first data source.

  3. Attach both DSes to your page.

Now your XML should look something like:

<series>
    ...
    <entry id="27">
        <drivers>
            <item id="21" ... />

and then…

<series-drivers>
    <entry id="21">
        All the driver data...
    </entry>

So then you can just use XSLT to iterate over each series’ drivers, and for each item grab the data from the series-drivers/entry whose ID matches the current item ID. Make sense?

Hey czheng, sorry to bother your (or someone else) again…

I did exactly what you said. The first part of tha XML is just like yours, but the second part isn’t finding entrys, it returns like this:

<series-drivers>
        <section id="16" handle="drivers">Drivers</section>
        <error>No records found.</error>
</series-drivers>

I guess something is missing on the Series : Drivers datasource, isn’t it?

are you filtering on id, by {$ds-INSERT_PARAM_HERE}?

(didn’t read the post above yours very well, sorry).

If you check the params that are beeing set (in the debug screen, the link above xml). What does it say for $ds-series?

If that list is empty, the problem is with the first ds, if it isn’t, you’ve probably done something wrong on the second ds.

BINGO!

Was missing the {} around $ds-series!

Guh. Sorry about that. Been a long couple of days…

Don’t worry! You helped me a lot, what is a { betweet this all!

And for you don’t get sad, sooner or later I’ll need some expert advices again! lol

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