Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan Higbie 11 posts 31 karma points
    Jul 16, 2010 @ 18:30
    Dan Higbie
    0

    Creating Portfolio Items

    I am using Repeatable Custom Content v2 to create a grid of portfolio items.

    However I am having trouble creating a few things. In Masoods example he shows a checkbox list, how do you populate that list with options?

    Also what is the best method to add images, I am guessing media picker, but that gives a weird numeric value that doesn't help me at all.

    Just need a little push in the right direction I suppose.

    Thanks

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jul 16, 2010 @ 18:55
    Matt Brailsford
    1

    Hi Dan,

    For the checkbox list, youll probably need to define your own data type in Umbraco using the checkbox list control, then define your prevalues within it.

    For the images, you are right with the media picker. The number you are getting is the media items ID which you'll then be able to use it either via the API to pull back a Media entity, or in XSLT using umbraco.library:GetMedia() to pull back an XML respresentation of the Media entity. From these you can pull back the actual media items url from the umbracoFile property.

    There are plenty of snippets dotted around the forums, so you shouldn't have any propblems finding out to how to do what you need, but let me know if you do hit any stumbling blocks.

    Matt

  • Dan Higbie 11 posts 31 karma points
    Jul 16, 2010 @ 19:55
    Dan Higbie
    0

    Matt, thanks. I have created a new data type with my own prevalues, my new issue is in the repeatableCustomContent.config it asks for a guid, I don't know how to determine the guid for my new datatype.

    Thanks for your help.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jul 16, 2010 @ 19:57
    Matt Brailsford
    0

    Hey Dan,

    What version of Umbraco are you using?

    Matt

  • Dan Higbie 11 posts 31 karma points
    Jul 16, 2010 @ 20:07
    Dan Higbie
    0

    4.0.4.2 according to the about box

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jul 16, 2010 @ 20:18
    Matt Brailsford
    0

    Ok, in that case, if you hover over you data type in the datatypes tree, you can find it's node id in the status bar, it should look something like this:

    javascript:openDataType(xxx);

    Where xxx is you data types id. Now, if you look in your database, and in the cmdDataType table and find the entry who's node id matches your data types id, the guid you need to add to repeatableCustomContent.config is in the controlId column.

    Matt

  • Dan Higbie 11 posts 31 karma points
    Jul 16, 2010 @ 20:20
    Dan Higbie
    0

    Thanks, will give it a try.

  • Dan Higbie 11 posts 31 karma points
    Jul 16, 2010 @ 23:32
    Dan Higbie
    0

    I have a entirely new issue now, I have the image thing worked out for the most part. However, when I add the following code the page only says:

    "Error parsing XSLT file: \xslt\Repeatable.xslt"

     

     

    <?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" 

      xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" 

      xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" 

      xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" 

      xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" 

      xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" 

      xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" 

    exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">

     

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

      <xsl:param name="currentPage"/>

     

      <!-- Input the repeatable custom contents property alias here -->

      <xsl:variable name="propertyAlias" select="string('portfolioItem')"/>

     

      <xsl:template match="/">

     

        <!-- The fun starts here -->

        <xsl:if test="$currentPage/data [@alias = $propertyAlias]/items/item">

          <xsl:for-each select="$currentPage/data [@alias = $propertyAlias]/items/item">

    <div class="portfolioItem grid_6">

           <h2><xsl:value-of select="./data [@alias = 'clientName']" disable-output-escaping="yes"/></h2>

     

    <xsl:variable name="mediaID" select="./data [@alias = 'clientImage']" />

     

    <xsl:variable name="media" select="umbraco.library:GetMedia(./data [@alias = 'clientImage'], 0)/data" />

     

     <xsl:if test="$media">

            <xsl:variable name="url" select="$media [@alias = 'umbracoFile']" />

            <xsl:variable name="width" select="$media [@alias = 'umbracoWidth']" />

            <xsl:variable name="height" select="$media [@alias = 'umbracoHeight']" />

            <img src="{$url}" width="{$width}" height="{$height}" />

     </xsl:if>

    <div class="projectDescription">

    <p><xsl:value-of select="./data [@alias = 'projSummary']" disable-output-escaping="yes"/></p>

    </div>

    </div>

     

          </xsl:for-each>

     

          <!-- Live Editing support for related links. -->

        <xsl:value-of select="umbraco.library:Item($currentPage/@id,$propertyAlias,'')" />

       </xsl:if>

     

      </xsl:template>

     

    </xsl:stylesheet>

     

    If I hard code the value, it works perfectly.

  • Jatin Gadhiya 11 posts 31 karma points
    Jan 08, 2014 @ 08:45
    Jatin Gadhiya
    0

    hello there, I want to create a filterable portfolio/Gallery...can you please help me......???

    and i was some try like...(http://www.diplo.co.uk/blog/2011/4/8/creating-a-simple-image-gallery-in-umbraco.aspx)

    first of all create Document type(e.g.. Name:-Album) and also create album master page.... second one create XSLT file and added some code... and after added macro and import macro in album master page... and after added some images in media folder.... and after create content... choose the folder... and now display all images proper...

    but i want to not display all images...i want to filterable like a portfolio...

    thanks in advance..

    I hope your reponse....

Please Sign in or register to post replies

Write your reply to:

Draft