different content above/below event calendar and detail event page

Home Forums Calendar Products Community Events different content above/below event calendar and detail event page

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1311643

    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
    Philipp

    #1313763
    Jennifer
    Keymaster

    Hi 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

    #1313931

    Hi 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,
    Philipp

    #1314869
    Jennifer
    Keymaster

    Hi 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

    #1315499

    Hi 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
    Philipp

    #1315710
    Jennifer
    Keymaster

    Hi 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

    #1315757

    Hi 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/liste

    How can I hide the content on the two described pages?

    Thank you for your feedback

    Regards
    Philipp

    Here 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’ );

    #1316451
    Jennifer
    Keymaster

    Hi 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' );

    #1316726

    Hi 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
    Philipp

    #1317668
    Jennifer
    Keymaster

    Hi 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 &amp;&amp;). 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

    #1318077

    Hi Jennifer,

    Thank you for your support. It works fine.

    Regards
    Philipp

    #1318393
    Jennifer
    Keymaster

    Great! 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

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘different content above/below event calendar and detail event page’ is closed to new replies.