Data Source Chaining multiple sections
This is an open discussion with 2 replies, filed under General.
Search
Settings for RSS Locations
data source:
- in
Output parameters
select$ds-rss-locations.area
(needed to filter next chained data source) - in
Included elements
select anything you wish andarea
(needed to cross-match in XSLT)
Chained data source for Areas
:
- set
Name
toAreas by ID
- set
Section
toAreas
- set a filter on
System ID
with value-1, {$ds-rss-locations.area}
. This is what makes the chain. You filter this DS based on another DS value. - uncheck the
Paginate results ...
checkbox (not needed) - in
Output parameters
select$ds-areas-by-id.city
(needed to filter next chained data source) - in
Included Elements
, select select anything you wish andcity
(needed to cross-match in XSLT)
Chained data source for Cities
:
- set
Name
toCities by ID
- set
Section
toCities
- set a filter on
System ID
with value-1, {$ds-areas-by-id.city}
. This is what makes the chain. You filter this DS based on another DS value. - uncheck the
Paginate results ...
checkbox (not needed) - in
Output parameters
select$ds-cities-by-id.region
(needed to filter next chained data source) - in
Included Elements
, select select anything you wish andregion
(needed to cross-match in XSLT)
... and apply the same process to Regions by ID
and Countries by ID
data sources.
Here's a demo XSLT:
<xsl:variable name="countries" select="/data/countries-by-id/entry"/> <xsl:variable name="regions" select="/data/regions-by-id/entry"/> <xsl:variable name="cities" select="/data/cities-by-id/entry"/> <xsl:variable name="areas" select="/data/areas-by-id/entry"/> <xsl:for-each select="/data/rss-locations/entry"> <xsl:variable name="location" select="."/> <xsl:variable name="area" select="$areas[ @id = $location/area/item/@id ]"/> <xsl:variable name="city" select="$cities[ @id = $area/city/item/@id ]"/> <xsl:variable name="region" select="$regions[ @id = $city/region/item/@id ]"/> <xsl:variable name="country" select="$countries[ @id = $region/country/item/@id ]"/> <dl> <dt>Country</dt> <dd> <xsl:value-of select="$country/country"/> </dd> <dt>Region</dt> <dd> <xsl:value-of select="$region/region"/> </dd> <dt>City</dt> <dd> <xsl:value-of select="$city/city"/> </dd> <dt>Area</dt> <dd> <xsl:value-of select="$area/area"/> </dd> <dt>Location</dt> <dd> <xsl:value-of select="$location/title"/> </dd> </dl> </xsl:for-each>
Thank you so much for the clear and detailed instructions!
I managed to get it working exactly as I wanted using your code.
Thanks again.
Create an account or sign in to comment.
Hi All
I appreciate any help with this issue. I know it is related to Data Source Chaining but not matter how much I read about it I just couldn't wrap my head around the concept.
I want to display a list of "Locations" in an RSS feed. I have the feed setup already.
Each Location belongs to an Area, which belongs to a City, which belongs to a Region, which belongs to a Country.
So I have 5 sections set up with Select Box Links which look like this:
Here is what my XML looks like now to display all Locations. My data source "RSS Locations" uses the Location section as a source.
How can I also add the City, Region, and Country of each location to this output?
As a first step, I tried creating a new Data Source called "RSS Areas" which uses the section "Areas" as a source, but couldn't figure out how the filtering works or the syntax to use it in my output.
Appreciate your help in advance.