Home › Forums › Calendar Products › Events Calendar PRO › making extra field predefined
- This topic has 9 replies, 2 voices, and was last updated 6 years, 11 months ago by Simone.
-
AuthorPosts
-
April 27, 2017 at 1:59 am #1275113SimoneParticipant
Hi,
I added an extra field in the single event, which is the opening hour of the club.
You can see that in:
http://www.stonescafe.it/evento/23-and-beyonde-the-infinite/
(on right sidebar, labeled ALTRO).
Two questions about that:
– could it be possible to have this text a predefined value, so when I input new events, it’s already filled in (such as happens for LOCATION…)
– I’d like to change the ALTRO label with ORARI LOCALE, how can I do that?Thanks in advance for your support!
Cheers
SimoneApril 28, 2017 at 6:03 am #1275732CliffMemberHi, Simone.
1)
To clarify, please let me know if all this is correct:
- You have a PRO Additional Field — text field type — called ORARI LOCALE
- When you create a new event, you want this Additional Field to have a default value of “APERTURA LOCALE (GIO-VEN-SAB ORE 19.30 / DOM ORE 18.00)INIZIO LIVE 22.00”
- Therefore, it’ll display that text unless otherwise entered/customized.
2)
The ALTRO text is the translated “Other” text from /wp-content/plugins/events-calendar-pro/src/views/pro/modules/meta/additional-fields.php but in your case it’s likely from /wp-content/themes/[your-theme-or-child-theme]/tribe-events/pro/modules/meta/additional-fields.php
We have this information regarding customizing translations:
- How to Override Plugin Language Files (custom language files on your own site)
- Customizing/Changing any bit of text (actual code snippet is at the very bottom) — or using the Say what? plugin (third-party, not guaranteed or supported by us) might be easier to setup and use to do the same thing as our provided code snippet
Please let me know about question #1.
May 2, 2017 at 12:19 am #1277097SimoneParticipantHi Cliff,
thanks for your answer, about #1, yes you’re absolutely right about what I’d like to obtain..
About the translation, thanks for the tip 😉
Waiting your reply,
cheers
SimoneMay 2, 2017 at 12:19 pm #1277582CliffMemberHere’s a code snippet that you can customize to insert a default value for your PRO Additional Fields:
https://gist.github.com/cliffordp/447bc4c3a3e8c9f4c3c5c3fbc1a1a9c6
Customize it to your needs and then please let me know how it worked for you.
May 3, 2017 at 9:12 am #1278030SimoneParticipantHi Cliff, thank you so much for your help,
since I’m not so familiar customizing plugins, please could you tell me where I should paste this snippet of code? Is this going to be lost in the next updates or I can create a separate file under the main theme folder such as for CSS customizations ?Thank you again,
SimoneMay 3, 2017 at 1:58 pm #1278244CliffMemberWelcome to WordPress customizing!
Best practice for adding custom code (like to implement a PHP snippet to modify The Events Calendar) is to create a functionality plugin, unless it’s something specific to your theme, in which case best practice is to make sure you’re using a child theme, then add the customization to your child theme’s functions.php file.
I hope this information helps!
May 4, 2017 at 12:46 am #1278428SimoneParticipantThat’s great!
I didn’t know that ability to create functionality plugins, thanks so much for sharing this info!About my issue, I did the functionality plugin and activated it. Now when entering a new event, in backend the custom field is not precompiled, but when I publish that event, in frontend it displays correctly.
Any ideas about how to display the precompiled text field in the backend so the data entry user can also modify the text before publishing?
Have a great day,
SimoneMay 4, 2017 at 7:38 am #1278531CliffMemberI’m glad to have helped thus far toward this customization for your site. I provided the solution I thought would be most appropriate and useful for you and other users, which is why I was able to go a bit above-and-beyond here. However, we’re limited in how much customization help we can provide, per our Scope of Support / Terms.
There are a variety of ways your desired implementation could be accomplished. If there’s a code snippet you’d like me to put some eyes on or something else I can help you with, please update this ticket or create a new ticket if it’s a separate issue.
Thank you very much for your understanding.
If you need some coding help, you may want to ask your developer or reference our documentation and list of known customizers.
May 26, 2017 at 9:35 am #1289472Support DroidKeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘making extra field predefined’ is closed to new replies.