Multi To Multi Relationship Options
elroy
Posted: Monday, May 07, 2007 9:23:04 AM
Rank: Enthusiast

Joined: 3/18/2007
Posts: 20
Hey Umbraco'ins,

just wonder if anyone has come across this error, I am wanting to create a multi to multi relationship with certain pages. I am currently using cplams multi content picker. I have a bunch of products with pages about fish, i a have managed to link the products with the fish, but not the fish with the products. [Need the relationship to be stored with the product only]

I am currently using xslt to do this, heres my code as follows for the product, but unsure what to write for the fish.

Code:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library"
    exclude-result-prefixes="msxml umbraco.library">


<xsl:output method="xml" omit-xml-declaration="yes"/>

<xsl:param name="currentPage"/>

<xsl:template match="/">
<xsl:variable name="collectionLinks" select="$currentPage/data [@alias = 'relatedfish']" />
<xsl:variable name="linkArray" select="umbraco.library:Split($collectionLinks, ',')" />


<xsl:for-each select="$linkArray/value">
    <xsl:if test=". != ''">
    <xsl:variable name="mediaItem" select="umbraco.library:GetMedia(., true())" />
    <div class="tblproducts">
    <div class="border"><img src="{$mediaItem/data [@alias = 'pthumbnail']}" width="166" height="80" alt="{$mediaItem/@nodeName}" /></div>
            <a href="{umbraco.library:NiceUrl($mediaItem/@id)}"><xsl:value-of select="$mediaItem/@nodeName" /></a>
    </div>
    </xsl:if>
</xsl:for-each>
<div style="clear: both;"></div>
</xsl:template>

</xsl:stylesheet>


Thanks In Advance.
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.