Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8027157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:43:53+00:00 2026-06-04T23:43:53+00:00

I am trying to re-using templates over multiple domains. Template looks like this: <div

  • 0

I am trying to re-using templates over multiple domains.
Template looks like this:

<div id="emailEntry">
    <Table>
        <tr class="prop">
        <td valign="top" class="name">
            <label for="email" id="email"><g:message code="default.email.label" default="Primary e-mail address* :" id="email" /></label>
        </td>
        <td valign="top" class="value ${hasErrors(bean: instanceToUse, field: 'email', 'errors')}">  
            <g:textField name="email" value="${instanceToUse?.email}"/> 
        </td>
    </tr>       
    </Table>
</div>

and my view calls this template like this:

<g:render template="/templates/frmEmailTableEntry" />

Both of my class “customer” and “employee” have email attributes.
so my question is, if I want to reuse template “frmEmailTableEntry” for class “customer” and “employee“, what should I put to “instanceToUse” in template.
I read about rendering with var declared, but I am not so sure how to pass this. Please help me with this.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T23:43:55+00:00Added an answer on June 4, 2026 at 11:43 pm

    It doesn’t really matter what you put in the template. If you leave it just as is you could use it in other gsp’s like this:

    //say the instance you wish to use is "customerInstance"
    <g:render template="/templates/frmEmailTableEntry" model="[instanceToUse: customerInstance]" />
    

    That passes the customerInstance into the ${instanceToUse} variable in the template.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to write a trivial Matrix class, using C++ templates in an
I'm trying to write some dimension-independent code for a template class in c++, using
I'm working on a Pyramid project using Mako templates, and I'm trying to display
Trying to reupload the DD4T.Templates.dll into Tridion 2011 SP1 using the TcmUploadAssembly in the
I'm trying to define a function using template template parameters (I just want to
I'm trying to populate a template with variables from a database. The data looks
In the master-detail application template (using ARC, storyboards) in XCode 4.3.2, I am trying
I'm trying to create a template for a button that I can use over
I am trying to load a django url into a div using the jquery
I'm triyng to use the view helper inside my {{#each}} template blocks without using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.