There are a few ways to achieve this, but would require custom code to do so.
My suggestion would be to make use of a uComponents XSLT extension to parse the XHTML from the rich-text editor into XML and use XSLT to format it accordingly.
I've made some changes and am now using the uComponents "Get First Words" string.
Still wondering whether it's possible to restrict it just to the first paragraph.
Haven't figured out how to display any of the child page images. The images are added into the RTE.
Thus far here is the result:
<div class="sub_page_list"> <ul> <li> <h3>Electricity Industry Framework</h3> <p>Ut aliquat lobore commy nullan velent lam velis doloreet, quat, vel ulluptatie faci tet, sequate consequatue conseniamet nisim vullamcor se commy nis nibh eu feu feummy nonsenit, suscilit del dignibh exero erit iriliquipisi eu faciliqui blan ver sit, quis at. Idui blaorem aliquat aut in henisi. Lorem Ipsum Delor Oborper ipis aciliquis dolortio dit adit aliquam, vent iure magnis am zzrit, vullaore del dunt laore verostrud ea facil ut ver sumsan utat. Ut praesequis aci ero endre feuismo lessis et, quam zzriliquamet la faccum quisl utem augait ad modo consed digna faci et utpatin et voluptat. Hent aut iurem alit <a href="/about-us/regulatory-framework/electricity-industry-framework.aspx" class="arrow">More information</a></p> </li> <li> <h3>Gas Industry Framework</h3> <p>Ut aliquat lobore commy nullan velent lam velis doloreet, quat, vel ulluptatie faci tet, sequate consequatue conseniamet nisim vullamcor se commy nis nibh eu feu feummy nonsenit, suscilit del dignibh exero erit iriliquipisi eu faciliqui blan ver sit, quis at. Idui blaorem aliquat aut in henisi. Lorem Ipsum Delor Oborper ipis aciliquis dolortio dit adit aliquam, vent iure magnis am zzrit, vullaore del dunt laore verostrud ea facil ut ver sumsan utat. Ut praesequis aci ero endre feuismo lessis et, quam zzriliquamet la faccum quisl utem augait ad modo consed digna faci et utpatin et voluptat. Con vulputpat nibh exero <a href="/about-us/regulatory-framework/gas-industry-framework.aspx" class="arrow">More information</a></p> </li> </ul> </div>
Retrieve first paragraph and first image from child node?
Is it possible to retrieve the first paragraph and first image from a child node?
The image will be in the rich text editor, from the Media section.
Any ideas?
Cheers, JV
Hi JV,
There are a few ways to achieve this, but would require custom code to do so.
My suggestion would be to make use of a uComponents XSLT extension to parse the XHTML from the rich-text editor into XML and use XSLT to format it accordingly.
Rough example code would be like this...
Cheers, Lee.
Hi Lee,
I've added uComponents and have added the code to my XSLT without any joy. It doesn't show any of the bodyText from the child node.
Here's my XSLT:
Hi JV,
You'll need to bring the "html" variable inside the <xsl:template> and modify it to...
That is, if your property alias for the rich-text editor is called "bodyText", otherwise change it to whatever you are using.
Cheers, Lee.
Hi Lee,
I've added the variable inside the template, however it only pulls in the current page HTML not the child nodes.
How can I get it to display the child nodes?
Cheers, JV
Hi JV,
You would need to the move the "html" variable inside the for-each loop, as at the moment it is only getting from the current page.
Cheers, Lee.
Hi Lee,
I've tried that but it doesn't pull in the child page, it pulls in the required two LI's but none of content.
Here's the result:
Here's what I've got so far:
The following XSLT results in this error on the live page:
This is the XSLT:
Notice that I'm using select="$html" not "$html/p[1]"
I've made some changes and am now using the uComponents "Get First Words" string.
Still wondering whether it's possible to restrict it just to the first paragraph.
Haven't figured out how to display any of the child page images. The images are added into the RTE.
Thus far here is the result:
Here is the XSLT:
Cheers, JV
Got it working, here's the final XSLT:
is working on a reply...