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?
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.
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...
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).
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
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.
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?
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 " "> ]>
<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, '<hr />', '^')"/>
<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....
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...
Take a look at
http://old.kasperb.dk/2006/10/20/splitting-the-contents-of-one-umbraco-document-into-multiple-pages.aspx
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).
is working on a reply...