markburton52
Forum Replies Created
-
Thanks – any guidance on the detail of how to do this would be welcome as we aren’t confident with PHP.
OK, we’ll check.
Many thanks @joneiseman unfortunately the new code (repeated twice) appears to be the same as that which you posted before, so the drop-down still doesn’t work. However, we can pull the artist image link through to the event post, but not using a drop-down. Is this a matter of formatting in the EM single event template?
Please ignore my last response (we are back to plan A)
@joneiseman Following your guidance, we done the following:
- created a role called Artists
- added that role to some user accounts
- added the code to functions.php for add_filter(’em_event_output_placeholder’,’my_em_styles_placeholders’,1,3);
function my_em_styles_placeholders($replace, $EM_Event, $result)
add_filter(’em_get_attributes’, ‘my_add_attributes’, 11, 1), function my_add_attributes($attributes) and function get_user_id_by_display_name( $display_name ) - created wp-content/plugin-templates/events-manager/forms/event directory
- copied the original template, modified it and placed the new php file here
- Added #_ARTISTIMAGE to the Single event page format
My code editor flagged an error on this line in functions.php: $artists = get_users( [ ‘roles__in’ => [ ‘artist’ ] );
It causes a critical error on the site.
I changed that to: $artists = get_users( array( ‘role__in’ => array( ‘artist’ ) ) );
… based on what I see here: https://developer.www.ads-software.com/reference/functions/get_users/ in crmunro’s comment, down the pageNow, in the editor, I can see an ARTIST attribute in the Event’s “Attributes” section, but there’s no drop down.
In the Event on the front-end, It displays the User placeholder image.Also, do we need to grant any particular Capabilities to the Artist role?
Thanks.
We’ve put a corresponding support request (https://www.ads-software.com/support/topic/displaying-user-meta-on-event-posts/#post-18131546 see today’s date response from me) on the Events Manager support forum.
As an interim method (given timescales), we are pursuing our plan B at the moment: to pull the user meta data directly from Ultimate Member to add to the EM events using EM attributes.
We’ve asked the question on the UM support forum, https://www.ads-software.com/support/topic/making-user-meta-data-available-to-events-manager-posts/, and await a response. Assuming that we get one, we’ll need to know how would we pull that in to a EM attribute and to display in the event via the Single Event template using the #_ATT placeholders.That’s great, many thanks. We’ll work through all that and let you know if we still have difficulties.
Mark
Many thanks again Jon,
However, I think we really do need a method that works with Pods as there are several fields we will need to add to the event posts, to the location posts, and possibly others.
Thanks
Mark
Hi Jon, a belated thank you for these replies.
We’ve tried to follow this but are stuck. Here’s what we have done:
1) used Pods to extend the User table
Pod name: User
Field names (label, field name, field type):
User id, user_id, relationship>>users
Show name, show_name, text
Artist image, artist_image, File/Image/Video
Pod name: Artist
User id, user_id, relationship>>users
Bring Show Name, dbem_caf_bring_show_name, felationship>>users
2) we then tried to use these values, a) using your example for a filter in functions.php and b) in the EM single event template.
We weren’t successful: the custom field / attribute didn’t appear in the event post.Could you advise on how we would modify the code snippet already supplied and also what to put in to the ‘Single’ EM template, so that the Artist image becomes available as a placeholder in the event posts (which we’d then fill manually via drop-down, or via a bulk CVC upload)? If we had that, I think we could then adapt it ourselves for the other user meta fields we’d want to display. Also, are there are any other changes that need to be made (eg adding to the ATTRIBUTES section it EM general settings etc – we assume not since attributes can be defined in the template)?
Many thanks for any help you can offer.
Update: I’ve now solved the problem. I had two custom fields ‘Discipline’ with the same name but different meta codes. One was a legacy one from a previous year. I simply renamed the legacy field ‘Discipline old’. You do this by adding a new form field, selecting the duplicate (in my case legacy) field. Then open its edit pane again and rename its title. Then you can delete it from the form.
Thank you. I tried that but even with all the other plugins disabled I still get the problem.
I’m now going to try setting up another profile form to see if the problem persists with that. Successive iterations mean that there are a lot of fields, not all in use, so there might be a conflict there??
Well, no replies but I’ve thought of a way of doing it.
To recap, the problem is how to display event categories hierarchically for a listing of events by category. Ideally the end user would select, say music, and then click the type of music they are interested in e.g. music-jazz.
There seems to be no way to do that ‘out of the box’ but it can be done via a series of pages, hierarchically accessed by in page menus (links). That uses shortcodes of this format to list events by category.
[events_list scope=’future’ category=’music-folk’]
in this case ‘music-folk’ is the category slug.
It’s a bit laborious but will work.
Then it would be possible to display a page-specific menu to simplify the job of subcategory selection (e.g. using the ‘conditional menus’ plugin – which I haven’t tried yet. Cleverer would be to make the subcategory itself only appear when there is data in it – I’m not sure how that might be done.
My experience too. Very puzzling that the developer appears to have simply disappeared. A pity as it was a great plugin that avoided the grief with using google – and much better maps too!
Ah, brilliant, I didn’t see the shortcode field option despite looking for it!
It works perfectly – thank you very much.
Thank you. I’ve added the snippet using the code snippets plugin. I tried adding the new shortcode to a non-editable text box in the profile form but it didn’t appear on the profile. Should I be doing something else?