Home › Forums › Calendar Products › Community Events › different content above/below event calendar and detail event page
- This topic has 11 replies, 2 voices, and was last updated 6 years, 9 months ago by Jennifer.
-
AuthorPosts
-
June 29, 2017 at 4:36 am #1311643Philipp von SchulthessParticipant
Hi,
– I would like to post some content above and below the event calendar, but something else above and below on an event detail page. At the moment, the content above the event page will also displayed above a detail event page. How can I do this?
Event page: https://www.soldoona.com/events/
example Detail event page: https://www.soldoona.com/event/wqeqwe/– Where can I edit the page „event“ (https://www.soldoona.com/events/)
Thank you for your feedback
Regards
PhilippJune 30, 2017 at 12:55 am #1313763JenniferKeymasterHi Philipp,
Thanks for reaching out!
To edit the default events page, you can follow these instructions to copy the template (wp-content/plugins/the-events-calendar/src/views/default-template.php) into your child theme and edit it from there.
To make sure I understand correctly are you trying to add two different blocks of content: 1 for the calendar view, and 1 for the single view? Or, are you trying to add 1 block for the calendar view, and then you want to be able to put something custom for each single event?
You can hook into ‘tribe_events_single_event_before_the_content’ to add content to single events only (I can help you out with this), but this will get tricky if you are trying to display something different for each event.
If you can clarify, I will be happy to help you figure out the best way to go about this!
Thanks,
Jennifer
June 30, 2017 at 2:40 am #1313931Philipp von SchulthessParticipantHi Jennifer
Thank you for your feedback. I could copy/paste the default template and edit in the theme. Great.
“To make sure I understand correctly are you trying to add two different blocks of content: 1 for the calendar view, and 1 for the single view?”
> Yes. Correct. Two different kind of blocks on content. One will be shown at the calendar view, the other to all single views. In total will be 4 different blocks of content (above & below calendar view, above & below single event pages)
“You can hook into ‘tribe_events_single_event_before_the_content’ to add content to single events only (I can help you out with this),…”
> can you tell me how that works. I would like to show on single event pages some copy above and some below the calendar content.
Thank you
Regards,
PhilippJune 30, 2017 at 10:14 pm #1314869JenniferKeymasterHi Philipp,
Thanks for clarifying!
I wrote a snippet for you that you can copy and paste into the functions.php file of your child theme. Just replace “Your content here” with whatever you would like in that section.
function tribe_custom_content_before() {
//Before content (all views except single)
if( ! is_single() ) {
echo 'Your content here';
}//Before content (single event)
if ( is_single() ) {
echo 'Your content here';
}}
add_filter( 'tribe_events_before_html', 'tribe_custom_content_before' );function tribe_custom_content_after() {
//After content (all views except single)
if( ! is_single() ) {
echo 'Your content here';
}//After content (single event)
if( is_single() ) {
echo 'Your content here';
}}
add_filter( 'tribe_events_after_html', 'tribe_custom_content_after' );Note that you will not need to make any changes to the template you copied over to get these four content blocks.
Let me know if that works for you and if you need any help making other changes to that template!
Thanks,
Jennifer
July 3, 2017 at 8:18 am #1315499Philipp von SchulthessParticipantHi Jennifer,
Thank you for your feedback. I implemented it and it works. Great.
– On the add event page, it shows the content above and below the form as well. How can I hide the two content blocks there? Please see https://www.soldoona.com/events/community/hinzufuegen as well as print screen.
– How can I hide on the add event page the button “Meine eingetragenen Ausstellungen anzeigen”? I use this link in the navigation
– How can I hide on the event page the first link/button which goes to the next event? There is a second link at the bottom of the page. This one I like to continue using. See print screen
Thank you for your feedback
Regards
PhilippJuly 3, 2017 at 9:29 pm #1315710JenniferKeymasterHi Phillipp,
I’m glad that worked for you! To exclude the community events page, you can add ! tribe_is_community_edit_event_page() to the conditions where you want to exclude it. For example:
//Before content (all views except single)
if( ! is_single() && ! tribe_is_community_edit_event_page() ) {
echo 'Your content here';
}//After content (all views except single)
if( ! is_single() && ! tribe_is_community_edit_event_page() ) {
echo ‘Your content here’;
}You can remove that button and top navigation by adding the following CSS to the Additional CSS area under Appearance > Customize (if you have one), or to the style.css file of your child theme:
.my-events-header .tribe-button, #tribe-events-header .tribe-events-sub-nav {
display: none !important;
}Let me know if that works!
Thanks,
Jennifer
July 4, 2017 at 1:53 am #1315757Philipp von SchulthessParticipantHi Jennifer
Concerning displaying content above and below pages of the event calendar, I still struggle. Although I tried varies codes in the editor, I do not get the desired result.
On the calendar page https://www.soldoona.com/events/, I would like to post content A and B above and below the table. (works)
On single event pages such as https://www.soldoona.com/event/hidden-voices/, I would like to post content C and D above an below the table. (works)
On all other pages, I do not like to show any content above and below default plugin content. Like here https://www.soldoona.com/events/community/hinzufuegen or here https://www.soldoona.com/events/community/listeHow can I hide the content on the two described pages?
Thank you for your feedback
Regards
PhilippHere my current lines in the CSS editor:
// Text über/unter Ausstellungskalender (The Event Calendar)
function tribe_custom_content_before() {
//Before content (all views except single)
if( ! is_single() ) {
echo ‘Ausstellungskalender
Finde hier Angaben zu Kunstausstellungen und Vernissagen einzelner Künstler oder Künstlergruppen, welche Bildern, Gemälden, Grafiken, Fotografien oder Skulpturen öffentlich ausstellen. Der Eintrag in den Ausstellungskalender ist kostenfrei und kann von Künstlern, Galerien, Kunstvereinen oder anderen Personen / Gemeinschaften vorgenommen werden. Neben einer Beschreibung können auch Bilder sowie Links zur jeweiligen Webseite eingetragen werden. Soldoona unterstützt Aktivitäten rund um Kunst.<br>’;
}//Before content (single event)
if ( is_single() ) {
echo ‘ ‘;
}}
add_filter( ‘tribe_events_before_html’, ‘tribe_custom_content_before’ );function tribe_custom_content_after() {
//After content (all views except single)
if( ! is_single() ) {
echo ‘Fehlt im Ausstellungskalender deine Ausstellung?
Trage deine Ausstellung jetzt kostenlos im Kalender ein. Profitiere von:
- einem kostenlosem Ausstellungseintrag
- einer Verlinkung zu deiner Ausstellungsinternetseite
- der Steigerung der Bekanntheit deiner Ausstellung
- der Steigerung der Besucher deiner Ausstellung
- einer Beschreibung deiner Ausstellung in Text und Bild
- einem jederzeit editierbaren Eintrag
Jetzt Ausstellung kostenlos eintragen‘;
}//After content (single event)
if( is_single() ) {
echo ‘Fehlt im Ausstellungskalender deine Ausstellung?
Trage deine Ausstellung jetzt kostenlos im Kalender ein. Profitiere von:
- einem kostenlosem Ausstellungseintrag
- einer Verlinkung zu deiner Ausstellungsinternetseite
- der Steigerung der Bekanntheit deiner Ausstellung
- der Steigerung der Besucher deiner Ausstellung
- einer Beschreibung deiner Ausstellung in Text und Bild
- einem jederzeit editierbaren Eintrag
Jetzt Ausstellung kostenlos eintragen‘;
}}
add_filter( ‘tribe_events_after_html’, ‘tribe_custom_content_after’ );July 5, 2017 at 12:55 pm #1316451JenniferKeymasterHi Philipp,
It sounds like you only want the custom text to appear on single events and on the month view (not other views like map, list, etc.), so I changed the code to reflect this. Let me know if you would like it on other views as well.
I modified the code you sent…can you paste it into your functions.php file (your message said that you were putting it into your CSS editor – this will not work there).
I added “A”, “B”, “C”, and “D” to the comments so it is clearer which section is which. To change any of these blocks, just change the content after the word “echo” and between the single quotation marks.
A – Above the content on the calendar page (month view)
B – Below the content on the calendar page (month view)
C – Above the content on single pages
D – Below the content on single pages
I wanted to link to this page as well with some functions to check conditions that might be useful to you. Let me know if this works better for you!
// Text über/unter Ausstellungskalender (The Event Calendar)
function tribe_custom_content_before() {
if( ! tribe_is_community_edit_event_page() && ! tribe_is_community_my_events_page() ) {
//Before content (Month view) A
if( tribe_is_month() ) {
echo 'Ausstellungskalender
Finde hier Angaben zu Kunstausstellungen und Vernissagen einzelner Künstler oder Künstlergruppen, welche Bildern, Gemälden, Grafiken, Fotografien oder Skulpturen öffentlich ausstellen. Der Eintrag in den Ausstellungskalender ist kostenfrei und kann von Künstlern, Galerien, Kunstvereinen oder anderen Personen / Gemeinschaften vorgenommen werden. Neben einer Beschreibung können auch Bilder sowie Links zur jeweiligen Webseite eingetragen werden. Soldoona unterstützt Aktivitäten rund um Kunst.
';
}//Before content (single event) C
if( is_single() ) {
echo 'Ausstellungskalender
Finde hier Angaben zu Kunstausstellungen und Vernissagen einzelner Künstler oder Künstlergruppen, welche Bildern, Gemälden, Grafiken, Fotografien oder Skulpturen öffentlich ausstellen. Der Eintrag in den Ausstellungskalender ist kostenfrei und kann von Künstlern, Galerien, Kunstvereinen oder anderen Personen / Gemeinschaften vorgenommen werden. Neben einer Beschreibung können auch Bilder sowie Links zur jeweiligen Webseite eingetragen werden. Soldoona unterstützt Aktivitäten rund um Kunst.
';
}}
}
add_filter( 'tribe_events_before_html', 'tribe_custom_content_before' );function tribe_custom_content_after() {
if( ! tribe_is_community_edit_event_page() && ! tribe_is_community_my_events_page() ) {
//After content (Month view) B
if( tribe_is_month() ) {
echo 'Fehlt im Ausstellungskalender deine Ausstellung?
Trage deine Ausstellung jetzt kostenlos im Kalender ein. Profitiere von:
- eineem kostenlosem Ausstellungseintrag
- einer Verlinkung zu deiner Ausstellungsinternetseite
- der Steigerung der Bekanntheit deiner Ausstellung
- der Steigerung der Besucher deiner Ausstellung
- einer Beschreibung deiner Ausstellung in Text und Bild
- einem jederzeit editierbaren Eintrag
Jetzt Ausstellung kostenlos eintragen
';
}//After content (single event) D
if( is_single() ) {
echo 'Fehlt im Ausstellungskalender deine Ausstellung?
Trage deine Ausstellung jetzt kostenlos im Kalender ein. Profitiere von:
- eineem kostenlosem Ausstellungseintrag
- einer Verlinkung zu deiner Ausstellungsinternetseite
- der Steigerung der Bekanntheit deiner Ausstellung
- der Steigerung der Besucher deiner Ausstellung
- einer Beschreibung deiner Ausstellung in Text und Bild
- einem jederzeit editierbaren Eintrag
Jetzt Ausstellung kostenlos eintragen
';
}
}
}
add_filter( 'tribe_events_after_html', 'tribe_custom_content_after' );July 6, 2017 at 2:28 am #1316726Philipp von SchulthessParticipantHi Jennifer,
Thank you for your feedback. You understand my need correctly.
I copy/pasted your code in the function.php file as described and as a result, the whole platform goes down. I cannot access to any page of Soldoona any more. Even click on the back button as an administrator in the backend and delete or undo the copy and save, is not possible to bring back the platform. As a result, we had to restore Soldoona with a backup.
I had this with your first codes as well. I saw that it is something because of missing of two characters && at some places.
But with the new code, I do not know where is the error and what needs to be changed.
Thank you for your help
Regards
PhilippJuly 7, 2017 at 2:16 pm #1317668JenniferKeymasterHi Philipp,
Sorry that happened…I copied and pasted the above into my functions.php file and got the same thing…the issue was some formatting that was added (the && was changed to &&). I tried updating the code to fix it, but couldn’t get the formatting correct here in the WordPress post – so I created a gist for you instead. I copied and pasted it directly from my code editor, where it is working, so hopefully this one will work for you. Just make sure not to copy over the <?php at the top of the page.
Let me know how it goes!
Thanks,
Jennifer
July 8, 2017 at 11:33 pm #1318077Philipp von SchulthessParticipantHi Jennifer,
Thank you for your support. It works fine.
Regards
PhilippJuly 10, 2017 at 7:53 am #1318393JenniferKeymasterGreat! I’m glad to hear it’s working for you!
Since this thread has been marked “resolved”, I’ll go ahead and close it out. Please feel free to open a new one if you have any further questions.
Thanks,
Jennifer
-
AuthorPosts
- The topic ‘different content above/below event calendar and detail event page’ is closed to new replies.