Forum

Thread tagged as: Problem, Events

File Field Type not pulling through on template

Hi,

I have added a file field type to an event template like so:

<a href="<perch:events id="eventFile" type="file" label="Add File to Event">">download</a>

I have to use the event's namespace for the field to show in the backend, which it does. However, the file path is not being pulled through to the href, I have used the tag as the attribute as per the instructions here

https://docs.grabaperch.com/templates/field-types/file/

Any help would be much appreciated.

Many thanks

Lee

Lee Goodman

Lee Goodman 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

If it's showing up in the control panel, presumably you've added it to event.html. Is that the same template you're using to display? Or is there a second template involved?

What does the tag look like for both cases?

Hi Drew

I'm using event.html in a folder called events in my templates folder, to override the default app event.html. My page function is below, the tag is as above

  <?php                       
              $opts = array(                                                                                                          
                                'filter' => 'eventSlug', //filter by our event slug (date)
                                'match' => 'eq',
                                'value' => $_GET['event'],//in URL query string
                                'template' => 'events/event.html' // template
                          );
   perch_events_custom($opts);                                             
?>

Thanks

Drew McLellan

Drew McLellan 2638 points
Perch Support

That should be fine in that case. Are you able to make other changes to the template and see them reflected?

I can make changes and see them reflected, I've added the link in a text filed for now.

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Hello Lee,

What do you get when you add <perch:showall> to your template?

https://docs.grabaperch.com/templates/show-all/