Jahia in English > page template without...

0 (0 Good)
0 (0 Bad)

page template without doctype?

by  jahio »  2012/03/29 09:34

 

Hello,

I would like to access to some jahia content using the REST API.

This content could be composed by 2 images and 1 text area for exemple, on 2 different columns.

What kind of template should I use? page template or content template?

When I create a content template in Jahia Studio, this template is not available in the "edit mode".

So I tried to create a page template. This one appears in the edit mode, but the HTML code I get back contains the doctype, html, head and body tags.

I don't want to get those tags, because the HTML code is injected in an other web page which already have those tags.

Is it possible to get back the HTML code without those tags?

Thanks!

  • page template without doctype?
    2012/03/29 09:34

    jahio <p> &nbsp;</p> <p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; color: rgb(102, 102, 102); font-family: 'Trebuchet MS', Trebuchet, 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; font-size: 13px; line-height: 18px; "> Hello,</p> <p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; color: rgb(102, 102, 102); font-family: 'Trebuchet MS', Trebuchet, 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; font-size: 13px; line-height: 18px; "> I would like to access to some jahia content using the REST API.</p> <p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; color: rgb(102, 102, 102); font-family: 'Trebuchet MS', Trebuchet, 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; font-size: 13px; line-height: 18px; "> This content could be composed by 2 images and 1 text area for exemple, on 2 different columns.</p> <p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; color: rgb(102, 102, 102); font-family: 'Trebuchet MS', Trebuchet, 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; font-size: 13px; line-height: 18px; "> What kind of template should I use? page template or content template?</p> <p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; color: rgb(102, 102, 102); font-family: 'Trebuchet MS', Trebuchet, 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; font-size: 13px; line-height: 18px; "> When I create a content template in Jahia Studio, this template is not available in the &quot;edit mode&quot;.</p> <p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; color: rgb(102, 102, 102); font-family: 'Trebuchet MS', Trebuchet, 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; font-size: 13px; line-height: 18px; "> So I tried to create a page template. This one appears in the edit mode, but the HTML code I get back contains the doctype, html, head and body tags.</p> <p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; color: rgb(102, 102, 102); font-family: 'Trebuchet MS', Trebuchet, 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; font-size: 13px; line-height: 18px; "> I don&#39;t want to get those tags, because the HTML code is injected in an other web page which already have those tags.</p> <p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; color: rgb(102, 102, 102); font-family: 'Trebuchet MS', Trebuchet, 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; font-size: 13px; line-height: 18px; "> Is it possible to get back the HTML code without those tags?</p> <p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; color: rgb(102, 102, 102); font-family: 'Trebuchet MS', Trebuchet, 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; font-size: 13px; line-height: 18px; "> Thanks!</p>

  • Number of messages  2
    Registration date Mar 29, 2012

    by  faissah »  2012/04/13 21:46

    Hello,

    In order to better understand the difference between content template versus page template, you should take a look at those docs:

    Also, if you need to retrieve some content without the HTML tag, i suggest that you retrieve it as a JSON object. In order to do so, simply replace .html with .json.

    Regards,

    Fabrice

    Fabrice  (faissah)

    Number of messages  264
    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