I am trying to reuse some content from a page, on another page.
My tree looks like this
Contact (The page with the Richtext editor with the text that i want to reuse) -- Denmark (The page where the text from the richtext editor (on the contact page) should show)
I have almost gotten this to work: It outputs the text, but it does not output the text like it should. It does for instance not show links og image. But it should be able to, right? (Just like when you insert an item in a template.)
Sure you can restrict that, just a matter of adjusting your for-each select, altho it doesn't make sense anymore to have that for-each in that case, does it? You'll only be selecting a single rte from a single child node...
Show output from Richtext Editor on subpage
Hi,
I am trying to reuse some content from a page, on another page.
My tree looks like this
Contact (The page with the Richtext editor with the text that i want to reuse)
-- Denmark (The page where the text from the richtext editor (on the contact page) should show)
I have almost gotten this to work: It outputs the text, but it does not output the text like it should. It does for instance not show links og image. But it should be able to, right? (Just like when you insert an item in a template.)
My XSLT looks like this:
Hope that someone can point me in the right direction.
Best regards,
Brian
Hi Brian,
I'm not sure what StripHtml() really does, but I always use
Have you tried that one?
Cheers,
/Dirk
Hi Dirk,
That worked. Can't believe i hadn't just tried that one! Da#n.
A new problem arised though - i finds text and pictures from ALL the pages on the 1st level.
Can i restrict to only the page it is supposed to get it from. (in this case Contact)
br,
Brian
Sure you can restrict that, just a matter of adjusting your for-each select, altho it doesn't make sense anymore to have that for-each in that case, does it? You'll only be selecting a single rte from a single child node...
In above snippet, I've added an extra restriction on type of page (assuming your Contact page is of 'contact' document type)
But, as said, a for-each would become useless, and I think you'd better declare a variable first:
and use that variable in the xsl:value-of statement to get the text
Cheers,
/Dirk
Hi Dirk,
With a little tweaking of your code it worked.
My final code looks like this: (I changed the $currentPage/node in the variable to my own $currentPage/ancestor-or-self::node, from my old for-each)
Thanks for your help!
best regards,
Brian
is working on a reply...