Jahia DX > Jahia 6.5 Template

0 (0 Good)
0 (0 Bad)

Jahia 6.5 Template

by  hyc »  2011/06/07 18:05

Hi,

In my project I want to use Jahia 6.5 with spring and freemarker. Can you please point me any documentation that can help for this? It looks like there is very minimal documentation available for version 6.5. I've never used a CMS before so don't have much idea about how it works.

I am first trying to create a new small template set to see how templates work. It seems that I need to create a new Jahia module? Am I going in the right direction? I tried to look at the existing modules in jahia installation at /tomcat/webapps/ROOT/modules/templates-web-blue but it doesn't make much sense to me. Can someone please explain to me? It will be great help to me.

Secondly I tried to configure the achetype catalog for jahia in eclipse but my eclipse says that remote catalog is empty :( Any idea why is it happening? Although I can create new module from jahia archetype using command line. But eclipse doesn't work for some reason.

Thanks
  • Jahia 6.5 Template
    2011/06/07 18:05

    hyc Hi,<br/><br/>In my project I want to use Jahia 6.5 with spring and freemarker. Can you please point me any documentation that can help for this? It looks like there is very minimal documentation available for version 6.5. I've never used a CMS before so don't have much idea about how it works.<br/><br/>I am first trying to create a new small template set to see how templates work. It seems that I need to create a new Jahia module? Am I going in the right direction? I tried to look at the existing modules in jahia installation at /tomcat/webapps/ROOT/modules/templates-web-blue but it doesn't make much sense to me. Can someone please explain to me? It will be great help to me.<br/><br/>Secondly I tried to configure the achetype catalog for jahia in eclipse but my eclipse says that remote catalog is empty <!-- s:( --><img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Sad" /><!-- s:( --> Any idea why is it happening? Although I can create new module from jahia archetype using command line. But eclipse doesn't work for some reason.<br/><br/>Thanks

  • Number of messages  8
    Registration date Jun 7, 2011
    0 (0 Good)
    0 (0 Bad)

    Re: Jahia 6.5 Template

    by  maximelevesque »  2011/06/07 18:05

    I'm running into the same issues, and drawing the same conclusions,

    In an attempt to gain an understanding of how templating works, I looked at the predefined
    templates :

    /tomcat/webapps/ROOT/modules/templates

    And it doesn't speak to me very much.

    For our project it is essential that we can change the layout, so it seems
    that we need to write a custom template.
    So my questions are :
    1) Where are the built in templates located ?
    My first guess is here :
    D:\dev\jahia-demopack\Jahia_65_BETA3_DEMOPACK\tomcat\webapps\ROOT\modules\templates-web
    ?

    2) How does one create a template in Jahia 6.5 ?
  • Re: Jahia 6.5 Template
    2011/06/07 18:05

    maximelevesque I'm running into the same issues, and drawing the same conclusions,<br/><br/>In an attempt to gain an understanding of how templating works, I looked at the predefined<br/>templates :<br/><br/> /tomcat/webapps/ROOT/modules/templates<br/><br/>And it doesn't speak to me very much.<br/><br/>For our project it is essential that we can change the layout, so it seems <br/>that we need to write a custom template.<br/>So my questions are :<br/>1) Where are the built in templates located ?<br/>My first guess is here :<br/> D:\dev\jahia-demopack\Jahia_65_BETA3_DEMOPACK\tomcat\webapps\ROOT\modules\templates-web<br/>?<br/><br/>2) How does one create a template in Jahia 6.5 ?

  • Number of messages  2
    Registration date Jun 7, 2011
    0 (0 Good)
    0 (0 Bad)

    Re: Jahia 6.5 Template

    by  shuber »  2011/06/07 18:05

    Hello,

    Actually we have a new tool to create templates called the Template Studio. So the basic gist of it is that :

    - You create (or duplicate an existing) template set in the studio
    - You customize it, export it as a WAR
    - You can then make modifications to the JSPs if needed.

    If you want to use another technology such as Freemarker this will be a little more tricky so I suggest you get familiarized with the standard method first. Then, you can use the embedded multi-scripting language support to switch to other scripting technologies.

    Regards,
    Serge Huber.

    Serge Huber (shuber)

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

    Re: Jahia 6.5 Template

    by  hyc »  2011/06/07 18:05

    Hi Serge,

    Thanks for the reply. So it appears that we'll have to create a template using studio and then get the jSP out of that extracted war to make changes. Although its not a very good idea from source control perspective but anyway it will work for the time being. Can you please let me know how can i integrate spring with the cms? e.g. suppose I've a login form or some other form on my page and I want to submit it to a spring mvc or struts/jsf action to perform some backend fuctionality and then decide which page to show. Is it achievable using jahia?

    Thanks
  • Re: Jahia 6.5 Template
    2011/06/07 18:05

    hyc Hi Serge,<br/><br/>Thanks for the reply. So it appears that we'll have to create a template using studio and then get the jSP out of that extracted war to make changes. Although its not a very good idea from source control perspective but anyway it will work for the time being. Can you please let me know how can i integrate spring with the cms? e.g. suppose I've a login form or some other form on my page and I want to submit it to a spring mvc or struts/jsf action to perform some backend fuctionality and then decide which page to show. Is it achievable using jahia?<br/><br/>Thanks

  • Number of messages  8
    Registration date Jun 7, 2011
    0 (0 Good)
    0 (0 Bad)

    Re: Jahia 6.5 Template

    by  shuber »  2011/06/07 18:05

    Hello,

    Well we include the Spring Framework inside of Jahia, but I'm not sure if we have the web framework JARs in there. Anyway you could always include them.

    You could of course do what you describe, but the new way of doing extensions like these is to use modules that extend part of the page functionality. Submitting forms could also be done through custom actions, which can also be managed via Spring.

    For more information, please check the video called "Module Creation" here :http://beta65.jahia.org/cms/lang/en/product/demo-videos

    Regards,
    Serge Huber.

     

    Serge Huber (shuber)

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

    Re: Jahia 6.5 Template

    by  hyc »  2011/06/07 18:05

    Hi Serge,

    Thanks for reply. I am a bit confused here can you please let me know what is the difference between a template set and a module? Seems both have same directory structure and both are deployed as war? in same place?

    Thanks
  • Re: Jahia 6.5 Template
    2011/06/07 18:05

    hyc Hi Serge,<br/><br/>Thanks for reply. I am a bit confused here can you please let me know what is the difference between a template set and a module? Seems both have same directory structure and both are deployed as war? in same place?<br/><br/>Thanks

  • Number of messages  8
    Registration date Jun 7, 2011
    0 (0 Good)
    0 (0 Bad)

    Re: Jahia 6.5 Template

    by  shuber »  2011/06/07 18:05

    Yes they are both deployed in the same location and packaged the same way.

    A template-set defined the structure of pages, what their layout is.

    A module is a page element, and may be added to a page by end users and provides a specific functionality, such as a poll, a forum, etc...

    Regards,
    Serge Huber.

    Serge Huber (shuber)

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

    Re: Jahia 6.5 Template

    by  hyc »  2011/06/07 18:05

    Thanks, Is it a good practice to include both templates and modules within same war file?
  • Re: Jahia 6.5 Template
    2011/06/07 18:05

    hyc Thanks, Is it a good practice to include both templates and modules within same war file?

  • Number of messages  8
    Registration date Jun 7, 2011
    0 (0 Good)
    0 (0 Bad)

    Re: Jahia 6.5 Template

    by  hyc »  2011/06/07 18:05

    Also Can you please give me an example how to use freemarker within jahia? I've seen one of demo video about multiple scripting languages but it doesn't give much detail. Is there any example or documentation available? It will be great help.

    Thanks
  • Re: Jahia 6.5 Template
    2011/06/07 18:05

    hyc Also Can you please give me an example how to use freemarker within jahia? I've seen one of demo video about multiple scripting languages but it doesn't give much detail. Is there any example or documentation available? It will be great help.<br/><br/>Thanks

  • Number of messages  8
    Registration date Jun 7, 2011
    0 (0 Good)
    0 (0 Bad)

    Re: Jahia 6.5 Template

    by  shuber »  2011/06/07 18:05

    Actually I don't recommend packaging everything in one WAR although it is possible. Seperating them will allow for better re-use.

    For the multiple scripting languages basically it is a named-based convention. Basically we use the Java Scripting API (http://www.jcp.org/en/jsr/detail?id=223) to look for different scripting extensions, which are configured in the WEB-INF/etc/spring/applicationcontext-renderer.xml in the following section :

     

     

       <bean id="RenderService" class="org.jahia.services.render.RenderService" factory-method="getInstance">
    
          <property name="templateManagerService" ref="JahiaTemplateManagerService" />
    
          <property name="scriptResolvers">
    
             <list>
    
                <bean class="org.jahia.services.render.scripting.FileSystemScriptResolver">
    
                   <property name="scriptExtensionsOrdering">
    
                      <list>
    
                         <value>jsp</value>
    
                         <value>groovy</value>
    
                         <value>js</value>
    
                         <value>php</value>
    
                         <value>vm</value>
    
                         <value>fm</value>
    
                      </list>
    
                   </property>
    
                </bean>
    
             </list>
    
          </property>
    
            <property name="cacheKeyGenerator" ref="cacheKeyGenerator"/>
    
            <property name="cacheProvider" ref="ehCacheProvider"/>
    
       </bean>
    
    

    Hopefully this will help you get started.

    Regards,

    Serge Huber.

    Serge Huber (shuber)

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