There really isn't that much "magic" involved - but you need to know what the HTML to feed the browser should look like. When you have a static HTML page where it works, you're ready to render that with XSLT.
XSLT just makes it possible to build the HTML dynamically, using bits and pieces from the complete Umbraco solution, e.g. you can create a very simple macro that just renders a <div> tag with an id you've specified somewhere else:
Create a new XSLT file - choose the "Clean" template and leave the "Create macro" checkbox checked
Paste this into the editor, replacing everything:
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:umb="urn:umbraco.library"
exclude-result-prefixes="umb"
>
<xsl:output method="html" indent="yes" omit-xml-declaration="yes" />
<xsl:param name="currentPage" />
<xsl:variable name="siteRoot" select="$currentPage/ancestor-or-self::*[@level = 1]" />
<xsl:template match="/">
<div id="{$siteRoot/@urlName}">
Check my ID - it should be "<xsl:value-of select="$siteRoot/@urlName" />".
</div>
</xsl:template>
</xsl:stylesheet>
Now add the macro to the template that renders your form - then start putting the tinymce code into the XSLT file and see what happens.
As I see it, the solution is still the same — you need to find the docs for whichever editor (TinyMCE, Ace etc.) you choose and find out what you need to render to the browser for it to work, which could be as simple as adding a simple textarea with an ID, which a JAvaScript will then take over upon rendering.
How to render tinymce or equal in xslt
Hey everybody,
I am trying to figure out how I in xslt insert some html that will then eventually render a tinymce or simple editor.
So what I want is create a form in xslt and in that form have an editor tinymce/simple that then posts back to itself so to say and save a document.
I have a current form that saves and publishes perfectly but I am not sure how to add the editor to the from in the xslt file.
Anyone?
Thanks, Scott
Hi Scott,
There really isn't that much "magic" involved - but you need to know what the HTML to feed the browser should look like. When you have a static HTML page where it works, you're ready to render that with XSLT.
XSLT just makes it possible to build the HTML dynamically, using bits and pieces from the complete Umbraco solution, e.g. you can create a very simple macro that just renders a <div> tag with an id you've specified somewhere else:
Create a new XSLT file - choose the "Clean" template and leave the "Create macro" checkbox checked
Paste this into the editor, replacing everything:
Now add the macro to the template that renders your form - then start putting the tinymce code into the XSLT file and see what happens.
Come back here with questions that pop up !
/Chriztian
Hi Chriztian,
I am not sure if I explained myself well enought.
I am trying to create a form with input field in xslt. I have a form right now see below:
Now instead of the textarea I would like to have a tinymce editor or at least a simple richtexteditor (like this one I am writing in right now)
Thanks
Hi Scott,
As I see it, the solution is still the same — you need to find the docs for whichever editor (TinyMCE, Ace etc.) you choose and find out what you need to render to the browser for it to work, which could be as simple as adding a simple textarea with an ID, which a JAvaScript will then take over upon rendering.
/Chriztian
Okay, I get it, thanks!
is working on a reply...