"Si tú no trabajas por tus sueños, alguien te contratará para que trabajes por los suyos”

Steve Jobs

Afiliado
Dominios3Euros

El template xsl de VCARD es el que se utiliza para mostrar las entradas de SOBI PRO de una categoria.

Publico este fichero por el problema que me surgió al crear una plantilla.

También lo podeís descargar en Google Drive

<?xml version="1.0" encoding="UTF-8"?>
<!--
 @version: $Id: vcard.xsl 3924 2013-12-17 08:01:19Z Radek Suski $
 @package: SobiPro Component for Joomla!  @author
 Name: Sigrid Suski & Radek Suski, Sigsiu.NET GmbH
 Email: sobi[at]sigsiu.net
 Url: http://www.Sigsiu.NET
 @copyright Copyright (C) 2006 - 2013 Sigsiu.NET GmbH (http://www.sigsiu.net). All rights reserved.
 @license GNU/GPL Version 3
 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3
 as published by the Free Software Foundation, and under the additional terms according section 7 of GPL v3.
 See http://www.gnu.org/licenses/gpl.html and http://sobipro.sigsiu.net/licenses.
 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 $Date: 2013-12-17 09:01:19 +0100 (Tue, 17 Dec 2013) $
 $Revision: 3924 $
 $Author: Radek Suski $
 File location: components/com_sobipro/usr/templates/default2/common/vcard.xsl $
 
 Esta es la vista de una categoria...
 
 Tengo que hacer la carga e los campos 3 veces  
 
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" encoding="UTF-8"/>
    <xsl:template name="vcard">
        
        <xsl:variable name="Clase">
        <xsl:text>sobi-vcard</xsl:text>
        </xsl:variable>
        
        <!-- No podemos definir una variable dentro de un bucle o if por eso lo pongo al principio -->
        <xsl:variable name="OpcDestacado">
        <xsl:for-each select="fields/*">
            <xsl:if test="(@id) = 38">
                    <xsl:if test="string-length(options/option/@selected)">
                    <xsl:text> Destacado</xsl:text>
                    </xsl:if>    
            </xsl:if>    
        </xsl:for-each>
        </xsl:variable>
        
                
    
        
        
        <!-- Generamos la clase sobi-vcard Destacado -->
        <div>
            <xsl:attribute name="class">
                <xsl:value-of select='concat($Clase,$OpcDestacado)'/>
            </xsl:attribute>
            
        
                        
            
    
        
        <div class="sobi-columna1">
            <xsl:for-each select="fields/*">
            <!-- Aqui filtramos solo id 23 que es imagen logo -->
            <xsl:if test="(@id) = 23">
                <xsl:if test="string-length(data/@thumbnail)">
                <img>
                <xsl:attribute name="src">
                <xsl:value-of select="data/@thumbnail"/>;
                </xsl:attribute>
                </img>
                </xsl:if>
                <xsl:if test="string-length(data/@thumbnail) = 0">
                <img>
                <xsl:attribute name="src">
                <xsl:text>/images/imagenes/iconos/no_photo-thumb.gif</xsl:text>
                </xsl:attribute>
                </img>
                </xsl:if>
            </xsl:if>
            </xsl:for-each>
        </div>
        <div class="sobi-columna2">
            <div class="Sobi-Categoria-Titulo">
            <h2>
                <a href="/{url}">
                    <xsl:value-of select="name" />
                    <xsl:call-template name="status">
                        <xsl:with-param name="entry" select="." />
                    </xsl:call-template>
                </a>
            </h2>
            </div>
            
            
                <xsl:for-each select="fields/*">
                    <xsl:if test="(@id) != 23 and string-length(@itemprop) = 0">
                    <div class="{@css_class}">;
                        
                        <xsl:if test="string-length(@itemprop)">
                            <xsl:attribute name="itemprop"><xsl:value-of select="@itemprop"/></xsl:attribute>
                        </xsl:if>
                        <xsl:if test="count(data/*) or string-length(data)">
                            <xsl:if test="label/@show = 1">
                                <strong><xsl:value-of select="label" />: </strong>
                            </xsl:if>
                        </xsl:if>
                        <xsl:choose>
                            <xsl:when test="count(data/*)">
                                <xsl:if test="(@id) != 38">
                                <xsl:copy-of select="data/*"/>
                                </xsl:if>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:if test="string-length(data)">
                                    <xsl:value-of select="data" disable-output-escaping="yes" />
                                </xsl:if>
                            </xsl:otherwise>
                        </xsl:choose>
                        <xsl:if test="count(data/*) or string-length(data)">
                            <xsl:if test="string-length(@suffix)">
                                <xsl:text> </xsl:text>
                                <xsl:value-of select="@suffix"/>
                            </xsl:if>
                        </xsl:if>
                    </div>
                    </xsl:if>
                    <!-- Aqui meto los campos que tenga propiedad con span -->
                    <xsl:if test="(@id) != 23 and string-length(@itemprop) != 0">
                    
                        <span>
                            <xsl:attribute name="itemprop"><xsl:value-of select="@itemprop"/></xsl:attribute>
                            <xsl:attribute name="class"><xsl:value-of select="@itemprop"/></xsl:attribute>
                            <xsl:value-of select="data"/>
                        </span>
                    
                    </xsl:if>
                    
                    
                    
                    
                </xsl:for-each>
                <div class="SPBottones">
                    <!-- La url del link de tiene que se decoficada ya que sino da un error -->
                    <div class="link-button SPPresupuestos">
                    <a>
                        <xsl:attribute name="href">
                            <xsl:text>index.php?option=com_contact&amp;view=contact&amp;id=1&amp;Itemid=116</xsl:text>
                        </xsl:attribute>
                        <xsl:text>Solicita Presupuesto</xsl:text>
                    </a>
                    </div>
                    <div class="link-button SPLeerMas">
                    <a href="/{url}">
                            <xsl:text>Leer Más</xsl:text>
                    </a>
                    </div>
            </div>
            </div>
            <!-- Cierra columna 2 -->
            <div class="separador"></div>
            
            
        </div>
    </xsl:template>
</xsl:stylesheet>