Forum
Event additional fields - Showing in Admin area but not on webpage
Hi, I've followed the instructions to add a custom field (in my case a link to an external event page). For example if I have a singer who is playing at Wembley, I'd like him to be able to add the link to Wembley's site.
In events.html (i.e the master template) I have the following
`<perch:events label="Link to Event? (Optional)" type='input' id="eventLink">`
This shows up as expected in the Admin area when adding an event.
In the actual template for the page (a custom template), the following does not out the eventLink
`Event Link = <perch:events id="eventLink">`
So after the "=" is blank, i.e nothing is output to the page.
I can see in the database that the custom field has gone in OK within eventDynamicFields.
The official docs state: You can use any perch:content tags within events templates however instead of starting the field with perch:content you must start it with perch:event.
I assume this is a typo and should be perch:events?
Any pointers, sure it's a simple thing I'm missing. Thanks
Can we see
It's generally a good idea to include this with each post to the forum, as otherwise we typically end up asking for them!
Diagnostics Report:-
Installed apps: content (2.8.31), assets (2.8.31), categories (2.8.31), perch_events (1.9.3) App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_events', ); PERCH_LOGINPATH: /replaced/perch PERCH_PATH: /Applications/XAMPP/xamppfiles/htdocs/replaced/perch PERCH_CORE: /Applications/XAMPP/xamppfiles/htdocs/replaced/perch/core PERCH_RESFILEPATH: /Applications/XAMPP/xamppfiles/htdocs/replaced/perch/resources Image manipulation: GD PHP limits: Max upload 128M, Max POST 128M, Memory: 128M, Total max file upload: 128M F1: 2edba60ed1f613d6dd804feb202456a2 Resource folder writeable: Yes HTTP_HOST: localhost DOCUMENT_ROOT: /Applications/XAMPP/xamppfiles/htdocs REQUEST_URI: /replaced/perch/core/settings/diagnostics/ SCRIPT_NAME: /replaced/perch/core/settings/diagnostics/index.php
Master Template:
Custom Template
Also the custom_event_type in case you may need it!
So I can see your link to an event has an incorrect type - it needs to be text I think, and in double quotes.
Then you need to use the exact same tag, including the tag in the detail template.
Thanks Rachel, still no luck. The input thing I put in there to see if it would make it work. Trying it with text and double quotes doesn't work either. I've created a new field to test it all but still no luck in displaying the custom field. So the following does not display anything on the page. However the field is shown in the admin area when creating a new event:
In the events.html template:
In the custom template:
Still results in nothing being output after "Test Field = ". If I remove the label and type attribute in the custom template it still doesn't work. Is there anyway to bypass and use the normal perch:content tags?
As a sidenote the column header in the database is 'eventDynamicFields' if that has any relevance? Further to this if I include and pull in the image, then the image does show. Technically it seems the image field is a custom field but can't see why that's working yet the testField is not.
Thanks again.
Change this:
to this:
Oh dear! Yes that's sorted it, thought it might have been a blindingly obvious one. Many thanks for helping out.