4 users online. Create an account or sign in to join them.Users

Search

Hi there, been trying to figure how to get data from another DS and be able to filter the data from 2 language entries.

What I have is a section called languages which spits out XML with translations of key bits of text for me... i.e Full Time, Part Time.

Behind these entries in Langauge section I have translations of Full Time and Part Time etc..

What I'm trying to do is filter the input data in another section based on a drop down check box for Full Time or Part time...

Question how do I target the other data source from with in a template match if I'm already at the "entry" level in the datasource?

Here's what I have so far:

<?xml version="1.0" encoding="UTF-8" ?>

d/n/Y

?

As you can see above in caps, I'm not sure how to include the data from this data source:

<xsl:variable name="labels" select="/data/languages/language/entry[language/@handle = $current-language]"/>

Any pointers would be greatly appreciated.

Ahh bugger it didn't output my code!

<xsl:template match="data">
<jobs>
<xsl:apply-templates select="full-time-welsh-jobs/entry" mode="job"/>
</jobs>
</xsl:template>

<xsl:template match="entry" mode="job">
<job>
<jobtitle><xsl:value-of select="cymraeg-job-title"/></jobtitle>
<company><xsl:value-of select="cymraeg-company-name"/></company>
<salary><xsl:value-of select="cymraeg-salary"/></salary>
<term><xsl:value-of select="term"/></term>
<reference><xsl:value-of select="cymraeg-reference"/></reference>
<location><xsl:value-of select="cymraeg-location"/></location>
<description><xsl:value-of select="cymraeg-description"/></description>
<apply><xsl:value-of select="cymraeg-how-to-apply"/></apply>
<contactname><xsl:value-of select="contact-name"/></contactname>
<telephone><xsl:value-of select="telephone"/></telephone>
<email><xsl:value-of select="email"/></email>
<address><xsl:value-of select="cymraeg-address"/></address>

  <xsl:variable name="current-hours" select="hours"/>
  <xsl:variable name="current-language" select="cymraeg"/>
  <xsl:variable name="languages" select="/data/languages/entry"/>
  <xsl:variable name="language" select="/data/languages/language/entry[language/@handle = $current-language]"/>

  <hours><xsl:value-of select="WHAT DATA DO I PUT HERE TO GET DS FROM LANGUAGES"/></hours>
<closing><xsl:call-template name="format-date">
<xsl:with-param name="date" select="to-date"/>
<xsl:with-param name="format">d/n/Y</xsl:with-param>
</xsl:call-template></closing>
<weburl><xsl:value-of select="cymraeg-website-url"/></weburl>
<negotiable><xsl:value-of select="negotiable"/></negotiable>
<weekhours><xsl:value-of select="cymraeg-normal-hours-per-week"/></weekhours>
<duration><xsl:value-of select="cymraeg-duration-dates-for-temporary-fixed-term-jo"/></duration>
<jobid><xsl:value-of select="company-logo/item/@id"/></jobid>
<xsl:variable name="current-logo-id" select="company-logo/item/@id"/>
<image><xsl:value-of select="concat($root, '/image/1/80/0', /data/cyft/entry[@id = $current-logo-id]/company-logo/@path, '/', /data/cyft/entry[@id = $current-logo-id]/company-logo/filename)"/></image>
<sitelink><xsl:value-of select="concat($root, '/jobs/view/', company-logo/item/@id, '/?language=cymraeg')"/></sitelink>
</job>
</xsl:template>

</xsl:stylesheet>

Figured it out.. found the variable weren't in the template so it wasn't finding the language sections var $labels.

<hours><xsl:value-of select="$labels/*[name()=current()/hours/item/@handle]" /></hours>

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.2 or above
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.0 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details