Copied to clipboard

Flag this post as spam?

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


  • Jag Matharu 3 posts 24 karma points
    Aug 12, 2009 @ 17:17
    Jag Matharu
    0

    How can you split a long article into smaller chunks without using child nodes?

    Hi

     

    Is there a way of splitting a long article into smaller pages but without resorting to using child nodes? The kind of thing would allow for a page turner (1, 2, 3, etc) at the bottom of the content area? I have tried it using child node content from a main page but this isn't how the editor finds it comfortable to work as you can lose track of which paragraph is on which page.

    There is an old post on the old forum which I have also tried in umbraco v4 but I can get it to work without an error? Anybody out there who can advise?

     

    Thanks

  • Sjors Pals 617 posts 270 karma points
    Aug 12, 2009 @ 17:23
    Sjors Pals
    0

    What you can do is do is write a component which returns only a part of a data section from the content, you can either base that on characters, but maybe also on some kind of seperator inserted by the editor ie: ####

    In your component you can split the data on the seperator and return the part you want, by using a parameter.

     

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Aug 12, 2009 @ 18:30
    Dirk De Grave
    1

    How about adding a bunch of rte's to the doc type, so editor can split the pages himself/herself? Could that be a workaround to you?

  • bob baty-barr 1180 posts 1294 karma points MVP
    Aug 14, 2009 @ 00:44
    bob baty-barr
    0

    i wrote some xslt that did a split on an HR insert for a client a while back and used some jquery to paginate...

    http://www.webinventif.fr/wp-content/uploads/projets/wslide/

    my doc ready call

    $(document).ready(function(){
      
    $('#parent2').wslide({
        width: 380,
        height: 500,
        horiz: true
    });

    });

    and my 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"
        exclude-result-prefixes="msxml umbraco.library">


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

     

    <xsl:param name="currentPage"/>
    <xsl:template match="/">

    <!-- The fun starts here -->

    <xsl:variable name="articleText" select="$currentPage/data[@alias='bodyText']"/>
    <xsl:variable name="repText" select="umbraco.library:Replace($articleText, '&lt;hr /&gt;', '^')"/>
    <xsl:variable name="splitText" select="umbraco.library:Split($repText, '^')"/>
    <xsl:choose>
    <xsl:when test="count($splitText/value) > 1">
    <ul id ="parent2">
    <xsl:for-each select="$splitText/value">
    <li>
    <xsl:value-of select="." disable-output-escaping="yes"/>
    </li>
    </xsl:for-each>
    </ul>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$splitText" disable-output-escaping="yes"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    </xsl:stylesheet>

    hope that is helpful....

  • bob baty-barr 1180 posts 1294 karma points MVP
    Aug 14, 2009 @ 00:46
    bob baty-barr
    0

    oh, hey... just dawned on me that you could use jquery cycle as well... man, i love that plugin... and just remembered it has a navigation hook built into it already as well... very flexible jquery plugin...

  • Petr Snobelt 923 posts 1535 karma points
    Aug 14, 2009 @ 08:43
  • Jag Matharu 3 posts 24 karma points
    Aug 17, 2009 @ 10:54
    Jag Matharu
    0

    Note to self: don't post a question a day before you have a week off.

    Thanks to all who have replied, especially bob. I have a look through your links and that led me to using jquery but a different plugin, pager. See http://rikrikrik.com/jquery/pager. You can specify what to use as pagebreaks for the javascript (div, p, etc).

Please Sign in or register to post replies

Write your reply to:

Draft