Page 1 of 1

[SOLVED] Adding a {Gallery} in a custom field EventsManager

Posted: Mon Mar 31, 2014 1:26 pm
by qwalk
Hi.

How come I can't seem to implement a gallery (using the Gallery module) in a user created field definition in EventsManager? The field definition is simple text (tried text area too), and when adding the {Gallery dir='test'} tag in the field, it is not showing the gallery but just the "{Gallery dir='test'}" text.

I think it's because I'm asking for the value of the field gallery ( {$entry->fields.gallery->value} ) and that's why it's showing the exact value of what has been typed in, and not the actual gallery. What can I write here? I've tried just {$entry->fields.gallery}, but that doesn't seem to work.

Here is my code from the Events Manager details template. The Gallery user created field definition is simple text.

Code: Select all

<table width="100%" cellpadding="10" cellspacing="0">
<tr valign="top">
<td width="50%">
<h1>{$entry->name}</h1>
<p>{$entry->description}</p>
<p>{$entry->fields.price->value}</p>
<p>{$entry->fields.availablefrom->value}</p>
</td>
<td width="50%">{$entry->fields.gallery->value}</td>
</tr>
<tr valign="top">
<td width="50%"><div style="border: solid 1px #ccc; width: 400px; height: 226px;">{$entry->fields.youtubelink->value}</div>
</td>
<td width="50%"><div style="border: solid 1px #ccc; width: 400px; height: 226px;">{$entry->fields.googlemapslink->value}</div></td>
</tr>

<tr>
<td colspan="2">
<h2>Want to know more?</h2>
{FormBuilder form='contactform-office'}
</td>
</tr>

<p><a href="#">Back to home page</a></p>
</table>

Re: Adding a {Gallery} in a custom field in EventsManager

Posted: Mon Mar 31, 2014 1:30 pm
by Jo Morg
Not sure but using this in your template might work:

Code: Select all

{eval var=$entry->fields.gallery->value}
That way smarty will treat the field as a template.

Re: Adding a {Gallery} in a custom field in EventsManager

Posted: Mon Mar 31, 2014 1:51 pm
by qwalk
Jo Morg wrote:Not sure but using this in your template might work:

Code: Select all

{eval var=$entry->fields.gallery->value}
That way smarty will treat the field as a template.
That helped - thanks a lot!