Jahia Dev Forum > Render the HTML...

0 (0 Good)
0 (0 Bad)

Render the HTML of a node

by  rvt »  2014/02/01 23:18

Hey All,

is it possible to let Jahia render a node (page, element etc...) from within a other module?
I have been toying around with RenderService  But so far I keep getting 'no render set for node : <some node type....>'

Ries

  • Render the HTML of a node
    2014/02/01 23:18

    rvt <p> Hey All,</p> <p> is it possible to let Jahia render a node (page, element etc...) from within a other module?<br /> I have been toying around with RenderService &nbsp;But so far I keep getting <em>&#39;<span style="color: rgb(68, 68, 68); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px;">no render set for node : &lt;some node type....&gt;&#39;</span></em></p> <p> Ries</p>

  • Number of messages  185
    Registration date Feb 1, 2014
    0 (0 Good)
    0 (0 Bad)

    Re: Render the HTML of a node

    by  qlamerand »  2014/02/03 09:01

    Hey Ries,

    To render a node from a view of another node, you can use the tag template:module (with this namespace declaration <%@ taglib prefix="template" uri="http://www.jahia.org/tags/templateLib" %>).
    Use the 'node' and 'view' attributes to set the node you want to render in the specified view.

    Best regards,
    Quentin

  • Re: Render the HTML of a node
    2014/02/03 09:01

    qlamerand <p> Hey Ries,</p> <p> To render a node from a view of another node, you can use the tag&nbsp;template:module (with this namespace declaration &lt;%@ taglib prefix=&quot;template&quot; uri=&quot;http://www.jahia.org/tags/templateLib&quot; %&gt;).<br /> Use the &#39;node&#39; and &#39;view&#39; attributes to set the node you want to render in the specified view.</p> <p> Best regards,<br /> Quentin</p>

  • Number of messages  28
    Registration date Feb 3, 2014
    0 (0 Good)
    0 (0 Bad)

    Re: Re: Render the HTML of a node

    by  rvt »  2014/02/03 20:33

    hello Quentin,

    thanks you for your response. I have looked at templateLib and I essentially do the same trick by using the RenderService like this:

    String result = RenderService.getInstance().render(newResource, context);

    However, I wanted to keep rendering the page, rendering a page node seems to fail, any other content (as so far tested) seems to work fine. Do you happen to know if RenderService.getInstance().render(newResource, context); is capable of rendering a page?

  • Re: Re: Render the HTML of a node
    2014/02/03 20:33

    rvt <p> hello Quentin,</p> <p> thanks you for your response. I have looked at templateLib and I essentially do the same trick by using the RenderService like this:</p> <p> <em>String result = RenderService.getInstance().render(newResource, context);</em></p> <p> However, I wanted to keep rendering the page, rendering a page node seems to fail, any other content (as so far tested) seems to work fine. Do you happen to know if&nbsp;<em>RenderService.getInstance().render(newResource, context); </em>is capable of rendering a page?</p>

  • Number of messages  185
    Registration date Feb 3, 2014
    0 (0 Good)
    0 (0 Bad)

    Re: Re: Re: Render the HTML of a node

    by  dgriffon »  2014/02/20 09:26

    Hello,

    Yes you should be able to render a page from the RenderService

    If it does not work, maybe some informations (like the site in the renderContext or the contextConfiguration of the resource set to "page") are missing from your rendercontext or resource 

    best regards

    David

    David Griffon (dgriffon)

    Number of messages  76
    Registration date
    0 (0 Good)
    0 (0 Bad)

    Possible issue at nodeType definition at Studio

    by  losalo@unavarra.es »  2018/02/22 17:55

    I think there is an issue at Studio when defining nodeTypes. After deleting them at Studio interface them they actualy remain at JCR. If you have a typo and correct it renaming the nodeType, you will end with two different nodeTypes at JCR. You can test it creating an basic nodeType and deleting it without using it anywhere. You can still see it at JCR using JCR Browser and you cannot delete it there because it tells that node is protected.

    It is a really big issue, for example, if you create a nodeType that extends virtualsite and later you want to delete it. Even though you have never used it, you still see its properties when editing site root properties in Edit mode.

     

     

      (losalo@unavarra.es)

    Number of messages  2
    Registration date
    Contact
    Share
    Feedback

    Get in touch

    Whether you are a current user or if you are just evaluating Jahia, we are here to help.

    Contact us

    Share this page