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

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
qwalk
Forum Members
Forum Members
Posts: 55
Joined: Mon Sep 13, 2010 9:27 am

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

Post 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>
Last edited by qwalk on Mon Mar 31, 2014 2:12 pm, edited 1 time in total.
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1978
Joined: Mon Jan 29, 2007 4:47 pm

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

Post 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.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
qwalk
Forum Members
Forum Members
Posts: 55
Joined: Mon Sep 13, 2010 9:27 am

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

Post 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!
Post Reply

Return to “Modules/Add-Ons”