cancel
Showing results for 
Search instead for 
Did you mean: 

Custom regions in webquick start

abbeydom
Champ in-the-making
Champ in-the-making
Newbie to freemarker/webscript.I would like to specify custom regions within a custom template. The regions are marked with custom_region1 and custom_region2 as below. Is there a list of default regions to pick from within webquick start or I would have to do some webscripting to create addtional regions such as middle-left or middle-right?

—-
<#include "/common/page.ftl"/>

<@templateBody>
<div id="left">
<@region id="left1" scope="page"/>
<@region id="left2" scope="page"/>

<div class="h-box-1">
<@region id="bottom-left" scope="page"/>
</div>
<div class="h-box-2">
<@region id="custom_region1" scope="page"/>
</div>

<div class="h-box-3">
<@region id="custom_region2" scope="page"/>
</div>
<div class="h-box-4">
<@region id="bottom-right" scope="page"/>
</div>

</div>

<div id="right">
<@region id="right1" scope="page"/>
<@region id="right2" scope="page"/>
</div>
</@>

Thanks for your help.
Dominic
8 REPLIES 8

amandaluniz_z
Champ on-the-rise
Champ on-the-rise
Hi Dominic,

You can define whichever regions you want in the freemarker template, but to fill them up with something you'll need to link them to a webscript.

So if you have:

<@region id="custom_region2" scope="page"/>

You will need to link that custom_region2 to a webscript in the page definition XML:


<components>
     <component>
             <region-id>custom_region2</region-id>
             <url>your/webscript/url</url>
             <properties>
                         <your_property_name>whatever value you want</your_property_name>
             </properties>
     </component>
</components>


Once you've defined what the region will be pointing to you need to create the webscript (just if it doesn't exist) inside the webscripts folder with the url you have given to it above.

Hope this helps you.
Adei

abbeydom
Champ in-the-making
Champ in-the-making
Hello Adei,

I could create news regions in a template, linked the template in a new page definition with the url pointing to an existing quick start webscript e.g:/list/detailed and assigned the page definitiion in share e.g. ws:indexPage=newpage4. However, the custom site does not render pages based on the new template. Is there something I have missed?

Many thanks
Dominic

amandaluniz_z
Champ on-the-rise
Champ on-the-rise
Hi Dominic,

Sorry for the late reply, been on Christmas holidays… Smiley Happy

If you create a new page definition, in quick start you need to tell which page will the article be rendered with. Check out this: http://www.alfresco.com/help/34/community/wcmqs/user/

abbeydom
Champ in-the-making
Champ in-the-making
Hi Adei,

Hope you had a good holiday.
I did assign the new page definition to a section landing page in webquick start, that's what I meant by ws:indexPage=newpage4 in the last post.

Specifically, in web quick start I have :

Parent section : root > news
ws:indexPage=newpage3, ws:article=newpage4

Subsection : root > news > markets
ws:indexPage=newpage4

So I expect the markets subsection  landing page to render using the newpage4 template, which it does, buy without the new region i.e custom_region1 that I have just defined. The new region is simply left out during rendering. Any pointers?

Regards,
Dominic

amandaluniz_z
Champ on-the-rise
Champ on-the-rise
Can you hardcode anything in the template and make sure it turns up in the page?

What are you passing to the region as property (parameters) when linking the region to the webscript?

abbeydom
Champ in-the-making
Champ in-the-making
Hi,

The issue was because of a naming mismatch between the template-type tag in my template-instance definition and the template :
<template-type>my template</template-type>

The app server output has a warning : unable to find a valid template path for uri : my template.This gives away the root cause for the non-display of the custom region as expected.

Thanks

amandaluniz_z
Champ on-the-rise
Champ on-the-rise
Hope it's working now!!

abbeydom
Champ in-the-making
Champ in-the-making
Hi Adei,

I did a few tests and permutations, and can confirm that it's working.
Thanks for helping.

Cheers,
Dominic
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.