Integrate template in app within minute

Hi everybody,

is it possible to integrate a template page in a formular created by App within minutes?

So I have a few fields (date, user, short text) and below that I would like to get a template with a table.
The filled template table could be saved within app within minutes entry or separately as an instanced template page.

Additional info: The modul “page” is only linking to an existing page. That would be only a workaround if my preferred solution wouldn’t work.

Thank you very much

I’m trying to understand what you need.

What is a template page?
What do you mean by “a template with a table”?
What is a “modul page”?

Thx

Hi Vincent,

I’ve made a screenshot:

My template page is a simple page with a table (created under XWiki.Template)
My modul page is the modul “page” named as “Hand”.

My goal could be reached at two ways:

  1. Insert my template page instead of “Hand”
  2. Using the modul “CONTENT” and get the content filled automatically with a predefined table as seen in screenshot.

I hope that it is clear enough now :slightly_smiling_face:

I’m still not sure I understand. Let me try to rephrase.

You’re looking for a way to create an AWM app and for some fields (e.g. the content field), you’d like to be able to provide some default values.

Is that correct?

If so, there’s currently no way to create an AWM entry based on a template page. I think you’ll need to modify the AWM app you’ve created to achieve this.

1 Like

I’m not sure what you’re looking for to put in the table, but if you put a Document content variable in your AWM like (put rows higher so that itll show bigger by default) ;

then you can change the AWM Sheet thats generated to show the page content by using $doc.display(‘Nameofpagevariable’)

 {{velocity}}
#set ($object = $doc.getObject('Main.Werkwijze.Formulieren.Code.FormulierenClass'))
#if (!$object)
  #set ($messageKey = 'formulieren.sheet.description')
  #set ($messageType = 'info')
  #if ($doc.documentReference.name != 'FormulierenSheet')
    #set ($messageKey = 'formulieren.sheet.noObject')
    #set ($messageType = 'warning')
  #end
  {{$messageType}}
  $services.localization.render($messageKey)
  {{/$messageType}}
  #stop
#end
#set ($discard = $xwiki.jsfx.use('uicomponents/edit/editableProperty.js', {
  'forceSkinAction': true,
  'language': $xcontext.locale
}))

#set ($discard = $doc.use($object))
#set ($editing = $xcontext.action == 'edit')
{{html wiki="true" clean="false"}}
<div class="xform">
 <dd>$doc.display('Pagina-inhoud')</dd>

etc.

You can then do table things however you like, either store it in page variables or centrally someplace else. Personally I’ve found generating tables based on other page content / page variables very powerfull … i.e. a product page generating a table of linked component pages … software page etc.