Home › Forums › Calendar Products › Community Events › Different Verbage for Submission form AND for calendar view
- This topic has 12 replies, 2 voices, and was last updated 5 years, 7 months ago by gomauro.
-
AuthorPosts
-
August 13, 2018 at 12:56 pm #1596477gomauroParticipant
I started this inquirey before but wasnt able to follow up and proceed. Please forgive me for asking this twice.
We need the submission form to have one set of verbage in the ADVANCED TEMPLATE SETTINGS.
I believe there was some code that would help me with that?
attached is the area I am talking about….Need one of these for EACH submission and display to calendar viewers.
August 15, 2018 at 7:34 am #1597944AndrasKeymasterHi gomauro,
Thanks for reaching out!
I’m not sure I fully understand what you need.
Do you mean you want to have a separate / extra set of “HTML before event content” box, which you want to use on the Community Events submission form?
That might not be possible like that, but there are other options.
You could either create a template override for this file:
wp-content/plugins/the-events-calendar-community-events/src/views/community/edit-event.php
and hardcode it in that file.
Or you can use the following hook to add your required content there:
do_action( 'tribe_events_community_form_before_template', $tribe_event_id );
Does this help?
If you can share with me further details about what you need I might be able to help you further.
Also if you have a link to your previous inquiry that would be welcome.
Cheers,
AndrasAugust 15, 2018 at 9:25 am #1598083gomauroParticipantHi Andras,
THank You…i am relieved there are solutions. However I am a code moron. Do I put:1
do_action( ‘tribe_events_community_form_before_template’, $tribe_event_id );in the ADVANCED TEMPLATE SETTINGS before any verbiage?
Also, are we able to pay someone to there to set this up properly? And a guesstimate of how much?
Thank You
mauroAugust 16, 2018 at 7:37 am #1598953AndrasKeymasterHi Mauro,
Unfortunately our minimum budget for doing any kind of development starts at $20.000 so we cannot take on this custom development project.
If you still need help with this, then you could reach out to one of these independent developers who are not affiliated with us and are well known in our community.
To help you a bit further I found a bit better way to inject content before the community submission form. Copy this snippet in your functions.php file:
[code language=”php”]
add_filter( ‘tribe_events_before_html’, ‘agu_custom_before_html’ );function agu_custom_before_html( $content ) {
// If it’s Community Events Submission form, then inject this content.
// Otherwise use what’s under Events > Settings > Display tab
if ( tribe_is_community_edit_event_page () ) {
$content = "xxx";
}
return $content;
}
[/code]You need to change the ‘xxx’ to the content you want to appear. It also should accept html tags.
If you also need the content from the setting page to appear, then you will need to adjust the code like this:[code language=”php”]
$content .= "xxx";
[/code]Hope this helps you get started.
Cheers,
AndrasAugust 20, 2018 at 10:50 am #1601407gomauroParticipantAndrĂ¡s
Thank You for the options. I have backed up the functions.php file and made a copy for editing. You said inject the above content BEFORE the community submission form. Does that mean I will find an area in the functions.php that is SPECIFICALLY for the community submission form? And that BEFORE that verbage i should place the contect you wrote?
In other words i have to be really careful where i put that correct? Cant just paste it in anywhere…
I used a FIND search for the word “community” and only one time is the word in the file..attached is a screenshot of that.
Sorry….I am not used to code..
mauroAugust 21, 2018 at 2:39 am #1601860AndrasKeymasterHi Mauro,
You don’t need to look for anything in the functions.php file. And it’s good that you made a backup copy. đŸ˜‰
Let me explain in a bit more detail what you need to do.
Take the snippet I gave you and copy it into your functions.php file, at the end. (It should be before the closing “?>” tag, but probably there is no closing tag present which is good. So just copy it at the end.)
Change this line
[code language=”php”]$content .= "xxx";[/code]
to whatever you want your content to be that appears before the Community Events submission form. For example:
[code language=”php”]$content .= "<p><strong>Hi there,</strong></p><p>Please provide as much details as you can!</p>";[/code]
Then it will show up on your Community Events submission page like this (or similar): https://cloudup.com/cSUs5qaCtOn
So the code you will end up with is like this:
[code language=”php”]
add_filter( ‘tribe_events_before_html’, ‘agu_custom_before_html’ );function agu_custom_before_html( $content ) {
// If it’s Community Events Submission form, then inject this content.
// Otherwise use what’s under Events > Settings > Display tab
if ( tribe_is_community_edit_event_page () ) {
$content .= "<p><strong>Hi there,</strong></p><p>Please provide as much details as you can!</p>";
}
return $content;
}
[/code]Does this help?
Andras
August 21, 2018 at 2:43 am #1601862AndrasKeymasterAnother note, it is always recommended to use a child theme, in case you are not doing so already.
If you make changes to your / in your parent theme, then those changes will likely get lost when you install an update for that theme.
The changes in the child theme are safe, they will not be overwritten with a theme update.
Cheers,
AndrasAugust 21, 2018 at 12:31 pm #1602446gomauroParticipantThank You AndrĂ¡s,
Im almost ready to try this edit. One more precaution.
I found TWO funtion.php files.ONE INSIDE THE THEME FOLDER
ONE INSIDE THE “WP INCLUDES” folder
which should i use?
I will create the child theme as well. You may not see my response for a few days one i get the function.php folder correct….im away for a couple days then ill be on this.
THANKS AGAIN
mauroAugust 22, 2018 at 3:59 am #1602843AndrasKeymasterHi Mauro,
You should use the one in your child theme folder!
Anything that is in wp-includes and wp-admin are the core files of WordPress. Those are not to be touched under any circumstances. Also, they will be overwritten with the next WordPress update so your changes will be lost.
You could add the changes in the functions.php in your theme folder, but those changes would be lost when your theme gets an update.
This is why using a child theme and making modifications there is recommended.
When working with WordPress the changes and customizations will all happen within wp-contents.
Hope this helps.
Cheers,
AndrasAugust 22, 2018 at 10:42 am #1603214gomauroParticipantAndrĂ¡s
Hi and THANK YOU. I created the child theme using Child Theme Configurator version 2.3.0.4.THat made a folder called “editorialmag-pro-child”
in there was the functions.php and I made a safety copy and put it aside.
Here is the unedited functions.php in that folder:
<?php
// Exit if accessed directly
if ( !defined( ‘ABSPATH’ ) ) exit;// BEGIN ENQUEUE PARENT ACTION
// AUTO GENERATED – Do not modify or remove comment markers above or below:if ( !function_exists( ‘chld_thm_cfg_parent_css’ ) ):
function chld_thm_cfg_parent_css() {
wp_enqueue_style( ‘chld_thm_cfg_parent’, trailingslashit( get_template_directory_uri() ) . ‘style.css’, array( ‘font-awesome’,’lightslider’ ) );
}
endif;
add_action( ‘wp_enqueue_scripts’, ‘chld_thm_cfg_parent_css’, 10 );// END ENQUEUE PARENT ACTION
THEN I PUT IN YOUR VERBAGE to test …HERE
<?php
// Exit if accessed directly
if ( !defined( ‘ABSPATH’ ) ) exit;// BEGIN ENQUEUE PARENT ACTION
// AUTO GENERATED – Do not modify or remove comment markers above or below:if ( !function_exists( ‘chld_thm_cfg_parent_css’ ) ):
function chld_thm_cfg_parent_css() {
wp_enqueue_style( ‘chld_thm_cfg_parent’, trailingslashit( get_template_directory_uri() ) . ‘style.css’, array( ‘font-awesome’,’lightslider’ ) );
}
endif;
add_action( ‘wp_enqueue_scripts’, ‘chld_thm_cfg_parent_css’, 10 );// END ENQUEUE PARENT ACTION
[code language=”php”]
add_filter( ‘tribe_events_before_html’, ‘agu_custom_before_html’ );function agu_custom_before_html( $content ) {
// If it’s Community Events Submission form, then inject this content.
// Otherwise use what’s under Events > Settings > Display tab
if ( tribe_is_community_edit_event_page () ) {
$content .= "<p><strong>Hi there,</strong></p><p>Please provide as much details as you can!</p>";
}
return $content;
}
[/code]AND I SEE NO CHANGES TO THE SUBMISSION FORM
I also put the code here and tried it:
<?php
// Exit if accessed directly
if ( !defined( ‘ABSPATH’ ) ) exit;// BEGIN ENQUEUE PARENT ACTION
// AUTO GENERATED – Do not modify or remove comment markers above or below:if ( !function_exists( ‘chld_thm_cfg_parent_css’ ) ):
function chld_thm_cfg_parent_css() {
wp_enqueue_style( ‘chld_thm_cfg_parent’, trailingslashit( get_template_directory_uri() ) . ‘style.css’, array( ‘font-awesome’,’lightslider’ ) );
}
endif;
add_action( ‘wp_enqueue_scripts’, ‘chld_thm_cfg_parent_css’, 10 );[code language=”php”]
add_filter( ‘tribe_events_before_html’, ‘agu_custom_before_html’ );function agu_custom_before_html( $content ) {
// If it’s Community Events Submission form, then inject this content.
// Otherwise use what’s under Events > Settings > Display tab
if ( tribe_is_community_edit_event_page () ) {
$content .= "<p><strong>Hi there,</strong></p><p>Please provide as much details as you can!</p>";
}
return $content;
}
[/code]// END ENQUEUE PARENT ACTION
STILL NO CHANGES.
ANy idea what is wrong? Perhaps the child theme is not engaging?
SO grateful for your patience and help!
mauroAugust 22, 2018 at 1:42 pm #1603417AndrasKeymasterHi,
If you go to Appearance > Themes which theme is active? I took a peek at the code of you page and it looks like that the parent theme (Editorialmag Pro) is the active one.
The child theme needs to be active. It will take everything from the parent theme, and will add whatever you have in the child theme.
Try and let me know.
Cheers,
AndrasAugust 27, 2018 at 11:29 am #1606889gomauroParticipantAndrĂ¡s
I have the child theme working properly without the added code. I had to re-do backgrounds and header stuff but it all looks right now. Several times i tried adding the code and got a white screen. Reverted back and it was correct so today i tried it slightly different and the site looked okay until i went to the submission page.On the submission page i ended up with two KFOI logos and no background. NOTHING ELSE CHANGED.
Here is the childthem functions.php code AS IT IS RIGHT NOW (you can see the results):
<?php
//
// Recommended way to include parent theme styles.
// (Please see http://codex.wordpress.org/Child_Themes#How_to_Create_a_Child_Theme)
//
add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
function theme_enqueue_styles() {
wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );
wp_enqueue_style( ‘child-style’,
get_stylesheet_directory_uri() . ‘/style.css’,
array(‘parent-style’)
);
}
//
// Your code goes below
//add_filter( ‘tribe_events_before_html’, ‘agu_custom_before_html’ );
function agu_custom_before_html( $content ) {
// If it’s Community Events Submission form, then inject this content.
// Otherwise use what’s under Events > Settings > Display tab
if ( tribe_is_community_edit_event_page () ) {
$content .= “Hi there,
Please provide as much details as you can!
“;
}
return $content;
}August 28, 2018 at 4:43 am #1607412AndrasKeymasterHi Mauro,
I looked at the home page (https://www.kfoiradio.org/) and in the code the logo is present twice as well, it is just hidden with this css:
[code language=”css”]
.home #masthead .site-logo a {
background: none;
height: auto;
width: auto;
}
[/code]This is something that comes from your theme so you will need to look around there.
Another note, in the code where you call for the parent stylesheet / theme, you need to use the name (slug) of your parent theme, and not “parent-style”. So your code should look rather something like this:
[code language=”php”]
add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
function theme_enqueue_styles() {
wp_enqueue_style( ‘editorialmag-pro’, get_template_directory_uri() . ‘/style.css’ );
wp_enqueue_style( ‘child-style’,
get_stylesheet_directory_uri() . ‘/style.css’,
array(‘editorialmag-pro’)
);
[/code]A.
September 19, 2018 at 9:35 am #1625414Support 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 ‘Different Verbage for Submission form AND for calendar view’ is closed to new replies.