Copied to clipboard

Flag this post as spam?

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


  • Touhid 97 posts 117 karma points
    Dec 01, 2010 @ 12:28
    Touhid
    0

    content page

    hi, i want a page which like as-

    I have create a template (employee template) and a document type for name, mobile, email etc, which can add a single employee info.

    and using this template how can i add many employee info.

    pls help me any one.

    touhid

     

  • Rich Green 2246 posts 4008 karma points
    Dec 01, 2010 @ 12:35
    Rich Green
    0

    Hey,

    You can add an employee DocType and then loop through them.

    So your structure might be

    Content

    Home

    Employees (Display all Employees listed below here)

    - Employee 1

    - Employee 2

    - Employee 3

    Rich

     

     

  • Tom Hare 49 posts 81 karma points
    Dec 01, 2010 @ 12:56
    Tom Hare
    0

    I'd agree with Rich's approach to the content node structure. In addition, you could use the 'List Subpages from Current Page' XSLT template (with a little tweaking) to create the list you need.

    Tom

  • Touhid 97 posts 117 karma points
    Dec 01, 2010 @ 13:01
    Touhid
    0

    thnks for quick reply. i have add a employee DocType and content section as -

    Employee

    - Employee 1

    - Employee 2

    - Employee 3

     But i cant understand looping them and what ill do?

     

     

  • Barry Fogarty 493 posts 1129 karma points
    Dec 01, 2010 @ 13:04
    Barry Fogarty
    0

    Hi Touhid,

     

    Following on from Rich's post, you will need to create a template for your Employees list which uses an XSLT macro to loop through all child employee nodes.  You can use the Runway faqListCategories macro as a stating point:

    version="1.0" encoding="UTF-8"?>
    DOCTYPE xsl:stylesheet [
        ENTITY nbsp " ">
    ]>
    <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:variable name="title" select="/macro/title"/>
        <xsl:output method="xml" omit-xml-declaration="yes"/>

        <xsl:param name="currentPage"/>

        <xsl:template match="/">

            <xsl:choose>
                <xsl:when test="count($currentPage/employee)<=0">
                    <div id="NoComments">
                        There are no  child nodes of doctype 'employee' ...
                    div>
                xsl:when>
                <xsl:otherwise>

                   
                    <xsl:for-each select="$currentPage/employee">
                         <h3>
                            <xsl:value-of select="employeeName"/>
                        h3>
                       

    <

    xsl:value-of select="jobTitle" disable-output-escaping="yes"/>


                    xsl:for-each>


                xsl:otherwise>
            xsl:choose>


        xsl:template>

    xsl:stylesheet>

     

     

    Hopefully that will get you started.  There are some useful videos at umbraco.tv that discuss creating these type of XSLT's

    http://umbraco.org/help-and-support/video-tutorials/introduction-to-umbraco/sitebuilder-introduction/creating-your-first-xslt-macro

  • Barry Fogarty 493 posts 1129 karma points
    Dec 01, 2010 @ 13:09
    Barry Fogarty
    0

    FYI post has trashed some of the leading "<" brackets from some of the tags - if you have Runway installed you can make a copy of faqListCategories and modify accordingly.. Alternatively you can start from fresh and use one of the built in starter fils - in this case "List all sub pages by document type


    <!-- Input the documenttype you want here -->
    <xsl:variable name="documentTypeAlias" select="string('employee')"/>

    <xsl:template match="/">

    <!-- The fun starts here -->
    <ul>
    <xsl:for-each select="$currentPage/* [name() = $documentTypeAlias and string(umbracoNaviHide) != '1']">

      <h3><xsl:value-of select="@nodeName"/></h3>
      <p>Other employee node properties go here</p>

    </xsl:for-each>
    </ul>

    </xsl:template>

  • Touhid 97 posts 117 karma points
    Dec 02, 2010 @ 06:30
    Touhid
    0

    sory, i cant do it. please help me in details.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies