Products in Category (hidden)

Mar 31, 2010 at 8:37 AM

We would like to display a minithumb of all products in same category.  When displaying a product. 
Here is the thing. 

We to group several colors of same T-Shirt we created a hidden group  (group no: 8) for example

we would like to create an array of all the different products in this group, so that the customer gets a display of all the other colors for the product

< a href="/tabid/38/ProdID/26/Default.aspx"><img src="/DesktopModules/NB_Store/makethumbnail.ashx?Image=26&w=20&tabid=38"/></a>

Can we use the something similar to   [TAG:MODELSTABLE]   only  [TAG:CATEGORYTABLE]

At the moment we created at special Template and are using the new 

[TEMPLATE:templatename]  tag ... 

but unfortunatly this leaves us with 2 problems. 

1. template is not automatic in the way new  procucts need to be added to the template manually
2. when a product is featured in several kategories.  the specail category that displays the product variations is not displayed 

one fix would be to be able to define.. Product view template.   That is .. each product could be defined to use specific TEMPLATE in any category list view or detail view.  

 

 

 

 

 

Mar 31, 2010 at 3:32 PM

I'M a bit unsure of exatly you want with the colour group thing...But the option I always look at when I want to add extra details to a product is to use the custom fields options and then display them using the xsl templateing option,

[TAGXML:xslfilename]

 

Regards,

Dave.

 

Mar 31, 2010 at 3:34 PM
Edited Mar 31, 2010 at 4:09 PM

HOw do I do that.. 

I havent looked into this yet.. 
.. 
could you show me . ?
I would really like to have a couple of more fields in the product detail
Med venlig hilsen



On 31 March 2010 16:32, leedavi <notifications@codeplex.com> wrote:

From: leedavi

I'M a bit unsure of exatly you want with the colour group thing...But the option I always look at when I want to add extra details to a product is to use the custom fields options and then display them using the xsl templateing option,

[TAGXML:xslfilename]

 

Regards,

Dave.

 

 

Mar 31, 2010 at 3:55 PM
Edited Mar 31, 2010 at 4:10 PM

is there some documentation about this.. XML  feature ?

I could not find anything about it in DOCUMENTATION or  DISCUSSIONS
I also wanted to ask you about..  the  PRINT addon .. 
do you think it would be best to use.. the  table in DB
NB_Store_CartItems
and add 2 columns to this table.. 
Print1 and Print2   
so the  print selection Logo and Placement could be registered here ?


Vera
Mar 31, 2010 at 4:04 PM
Edited Mar 31, 2010 at 4:07 PM

Hi Vera,

Here's an example of something we did for one of  our clients, it's not what you want, but I sure you'll be able to understand...

In the "productxmldata.template" settting

---------------------------------------------------------------------------------------------

<TABLE BORDER=1 CELLSPACING=3 CELLPADDING=4>
<TR>
<TD>[<tag id="dlAnimal" type="dropdownlist" cssclass="normal" data="Vache;Chèvre;Brebis;Buffle" />]&nbsp[<tag id="dlDrapeau" type="dropdownlist" cssclass="normal" data=";France;Italie;Suisse;Autriche;Grèce" />]</TD>
<TD>Lait</TD>
<TD>Mg/ms</TD>
<td>Mg/pds</td>
<td>Sel ~ %</td>
<td>Présure</td>
<td>Affinage</td>
<td>Marque</td>
</TR>
<TR>
<td>[<tag id="CkNew" type="checkbox" cssclass="normal" text=" Nouveau" />]</td>
<td>[<tag id="dlLait" type="dropdownlist" cssclass="normal" data="Pasteurisé;Cru;Thermisé" />]</td>
<td>[<tag id="txtBoxMgms" type="textbox" width="50" cssclass="normal" maxlength="20"  />]%</td>
<td>[<tag id="txtBoxMgpds" type="textbox" width="50" cssclass="normal" maxlength="20" />]%</td>
<td>[<tag id="txtBoxSel" type="textbox" width="50" cssclass="normal" maxlength="20" />]%</td>
<td>[<tag id="dlPresure" type="dropdownlist" cssclass="normal" data=";Animale;Microbienne" />]</td>
<td>[<tag id="txtAffinage" type="textbox" width="50" cssclass="normal" maxlength="20" />]&nbsp[<tag id="dlAffinage" type="dropdownlist" cssclass="normal" data=";Jours;Semaine;Mois" />]</td>
<td>[<tag id="dlnMarque" type="dropdownlist" cssclass="normal" data=";Demeter;Bioland;Naturland;Biokreis" />]</td>
</tr>
<tr>
<TD colspan=2 VALIGN=TOP>Croute comestible[<tag id="radCroute" cssclass="normal"   type="radiobuttonlist" RepeatColumns="2"  RepeatDirection="Horizontal" data="Oui;Non;Aucune"/>]</TD>
<TD colspan=3 VALIGN=TOP>Autres ingredients[<tag id="txtAuIng" textmode="MultiLine" height="55"  type="textbox"  width="100%" />]</TD>
<TD colspan=3 VALIGN=TOP>Emballage[<tag id="txtEmballage" textmode="MultiLine" height="55"  type="textbox" width="100%"  />]</TD>
</tr>
</TABLE>

---------------------------------------------------------------------------------------------

This gives the extra deatils for the product edit page....

In the product detail template we placed a token to the xsl file:

[TAGXML:xsl\tableau_omabeer_v1.xsl]

 

Then on the portal root "\xml" folder we placed the xsl file to do the display....

---------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:lookup="uri:lookup" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
    <xsl:output method="html" indent="yes"/>

<xsl:template match="/root">

<table border="0" cellspacing="0" cellpadding="0" width="100%">
      <tr>
        <td valign="top">
          <table border="0" cellspacing="0" cellpadding="0" width="100%">
          <tr><td><img src="/Portals/omabeer/topfiche.png" /></td></tr>
          <tr><td height="48">
          <img align="absmiddle" hspace="10"><xsl:attribute name="src">/Portals/omabeer/xsl/<xsl:value-of select="./genxml/dropdownlist/dlanimal" />.gif</xsl:attribute></img>
            <xsl:if test="./genxml/dropdownlist/dldrapeau!=''">
              <img align="absmiddle">
                <xsl:attribute name="src">
                  /Portals/omabeer/xsl/<xsl:value-of select="./genxml/dropdownlist/dldrapeau" />.png
                </xsl:attribute>
              </img>
            </xsl:if>
          </td></tr>
          <tr><td height="248" align="center">
          <img  alt=""><xsl:attribute name="src">/DesktopModules/NB_Store/makethumbnail.ashx?Image=<xsl:value-of select="./ImageID" />&amp;w=200&amp;tabid=<xsl:value-of select="./TabID" /></xsl:attribute></img>
          </td></tr>
          </table>
        </td>
        <td valign="top" width="100%">
        <h1><xsl:value-of select="./ProductName" /></h1>
        <xsl:call-template name="break"><xsl:with-param name="textin" select="./Summary"/></xsl:call-template>
          <table border="0" cellspacing="0" cellpadding="3">
          <tr>
          <th>Lait</th>
          <th>mg/ms</th>
          <th>mg/pds </th>
          <th>Sel env.</th>
          <th>Présure</th>
          <th>Affinage</th>
          </tr>
          <tr>
          <td><xsl:call-template name="DisplayValue"><xsl:with-param name="DValue" select="./genxml/dropdownlist/dllait" /></xsl:call-template></td>
          <td><xsl:call-template name="DisplayValue"><xsl:with-param name="DValue" select="./genxml/textbox/txtboxmgms" /></xsl:call-template></td>
          <td><xsl:call-template name="DisplayValue"><xsl:with-param name="DValue" select="./genxml/textbox/txtboxmgpds" /></xsl:call-template></td>
          <td><xsl:call-template name="DisplayPercentValue"><xsl:with-param name="DValue" select="./genxml/textbox/txtboxsel" /></xsl:call-template></td>
          <td><xsl:call-template name="DisplayValue"><xsl:with-param name="DValue" select="./genxml/dropdownlist/dlpresure" /></xsl:call-template></td>
          <td><xsl:call-template name="DisplayValue"><xsl:with-param name="DValue" select="./genxml/textbox/txtaffinage" /></xsl:call-template></td>
          </tr>
          </table>
          <table border="0" cellspacing="0" cellpadding="3">
          <tr>
          <th>Croûte</th>
          <th>Autres ingrédients</th>
          <th>Emballage</th>
          </tr>
          <tr>
          <td><xsl:call-template name="DisplayValue"><xsl:with-param name="DValue" select="./genxml/radiobuttonlist/radcroute" /></xsl:call-template></td>
          <td>
            <xsl:call-template name="DisplayValueBreak">
              <xsl:with-param name="DValue" select="./genxml/textbox/txtauing" />
            </xsl:call-template>
          </td>
          <td>
            <xsl:call-template name="DisplayValueBreak">
              <xsl:with-param name="DValue" select="./genxml/textbox/txtemballage" />
            </xsl:call-template>
          </td>
          </tr>
          </table>
          <i>Organisme gestionnaire de marques : <xsl:value-of select="./genxml/dropdownlist/dlnmarque" /></i>
        </td>
      </tr>
</table>

</xsl:template>

<xsl:template name="break">
   <xsl:param name="textin" select="."/>
   <xsl:choose>
     <xsl:when test="contains($textin, '&#xa;')">
      <xsl:value-of select="substring-before($textin, '&#xa;')"/>
      <br/>
      <xsl:call-template name="break">
          <xsl:with-param name="textin" select="substring-after($textin,'&#xa;')"/>
      </xsl:call-template>
   </xsl:when>
   <xsl:otherwise>
     <xsl:value-of select="$textin" disable-output-escaping="yes" />
   </xsl:otherwise>
   </xsl:choose>
</xsl:template>

  <xsl:template name="DisplayValueBreak">
    <!--Display Value or  dash   if  blank-->
    <xsl:param name="DValue" select="''" />
    <xsl:if test="$DValue!=''">
      <xsl:call-template name="break"><xsl:with-param name="textin" select="$DValue"/></xsl:call-template>
    </xsl:if>
    <xsl:if test="$DValue=''">--</xsl:if>
  </xsl:template>
 
<xsl:template name="DisplayValue">
    <!--Display Value or  dash   if  blank-->
    <xsl:param name="DValue" select="''" />
    <xsl:if test="$DValue!=''">
        <xsl:value-of select="$DValue" disable-output-escaping="yes" />
    </xsl:if>
    <xsl:if test="$DValue=''">--</xsl:if>
</xsl:template>

<xsl:template name="DisplayPercentValue">
    <!--Display Value and % only if not blank-->
    <xsl:param name="DValue" select="''" />
    <xsl:if test="$DValue!=''">
        <xsl:value-of select="$DValue" disable-output-escaping="yes" />%
    </xsl:if>
    <xsl:if test="$DValue=''">--</xsl:if>
</xsl:template>


</xsl:stylesheet>

---------------------------------------------------------------------------------------------

As you can see (if you have a basic understanding of xsl) the images and values can be displayed based on the selection of the dropdownlists, radio buttons, textboxs, etc....

 

Regards,

Dave.

 

 

Apr 1, 2010 at 10:41 AM

Hi David, 

This is FANTASTIC. 

I have been trying to test it a little, and it works very  easilly, and using it makes the  NB store module VERY VERY powerfull, I am amazed. 

Im not good in using XSL code, so that is a showstopper for me in the more advanced department, but for more simple funktions this is marvelous.

I have a question ..  lets take example

[<tag id="dlAffinage" type="dropdownlist" cssclass="normal" data=";Jours;Semaine;Mois" />]

here you only have data=";value1;value2; and so forth, and this is the visible text also in dropdown. 

how would I create a  text visible in drowpdown and  value that actually gets saved as data , like we know from

<SELECT name=Day> 
<OPTION value="" selected>- Select -</OPTION> 
<OPTION value=Sunday>Sunday</OPTION> 
<OPTION value=Monday>Monday</OPTION> 
<OPTION value=Tuesday>Tuesday</OPTION> 
<OPTION value=Wednesday>Wednesday</OPTION> 
<OPTION value=Thursday>Thursday</OPTION>
<OPTION value=Friday>Friday</OPTION>
<OPTION value=Saturday>Saturday</OPTION>
</SELECT>

or could we possible use the new  [TEMPLATE:templatename] as values  like

[<tag id="SomeID" type="dropdownlist" cssclass="normal" data=";[TEMPLATE:templatename1];[TEMPLATE:templatename3];[TEMPLATE:templatename3]" />]

This would be very neat, and also help me avoid the  XSL  ;)

Vera

 

 

 

Apr 1, 2010 at 3:14 PM
Hi Vera, The current stable release only allows for the single data value, however after reading your post I decided to take some code from another project with a more sophisticated templating system and give support for a datavlue attrivute in NB_Store. So in the latest beta version v2.0.11 beta4 you'll be able to do something like this: [<tag id="dlAffinage" type="dropdownlist" cssclass="normal" datavalue="0;1;2;3" data=";Jours;Semaine;Mois" />] The datavalue is the value that will be saved into the custom field, the data attribute is what will be displayed in the dropdown. The template idea is perhaps a step to far without giving it some thought. Regards, Dave.
Apr 1, 2010 at 5:24 PM

Thanks David.. this is really great. :)

only problem is that it is not possible to use html code  like  < or >  in datavalue="<img src='some.gif' />"

becouse then we will get the "System.Xml.XmlException: '<', hexadecimal value 0x3C, is an invalid attribute character

using  & lt;  vill not help

 is there a way around this.  

Apr 2, 2010 at 9:14 AM

Hi,

There's always a way!!, the problem is that it's a long road!!....I can;t think of a way do do this with the code that exists in NB_Store.

You could try some kind of jQuery solution, where the contents of the dropdown gets replace/enhanced, but I'm unsure if this would work!!

Regards,

Dave.