Relate 2 Sections and generate a XML
This is an open discussion with 9 replies, filed under General.
Search
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:
Edit your
Series: Drivers
data source. Rename it to justSeries
, 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.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.
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.
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 calledSeries
. TheDrivers
section has all the drivers of the league. On theSeries
section I need do select from all those drivers whose race in this specific series.Later I’ll need to show in a page all the
Series
and it’s drivers. Something like this XML:After this all said. I’ve tried to add a
Select Box Link
on theSeries
section that searches the aReflection Field
from theDrivers
section. So far so good, but when I create aDatasource
searching thatSelect Box Link
the XML result is something like this:Any idea of how to achieve my objective?
Huge TIA!