Sidebar on event details pages

Home Forums Calendar Products Events Calendar PRO Sidebar on event details pages

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #66491
    Banafsheh
    Participant

    Hi, can you please let me know how I can use a sidebar on the events details page? I noticed that in the setting, I can choose to use a different template that uses side bar, but it will also affect the calendar’s main page. I want the calendar to use the full width with no side bar, specially with the new filter bar that goes to the left.

    #66705
    Barry
    Member

    So you want the sidebar on the single event pages only? The actual detail will vary according to whether you are using the Default Events Template, the Default Page Template or some other template for your events.

    In principle though if things are set up so that the calendar already shows in full width you could add some code to check if the current request relates to a single event and show the sidebar only then, something like:

    if (is_singular() && tribe_is_event()) { dynamic_sidebar(); }

    You’d may need to tweak this and other bits of the template, plus your stylesheet, to integrate it nicely, however.

    #67152
    Robert
    Participant

    Hi Shimatorabi and Barry,

    I just thought I’d jump in to help move this along.

    I also want the exact same request as Shimatorabi is asking for and am trying to work on a solution.

    I’m adding the following to my functions. It should be working but it’s not quite hooking. I don’t believe it’s an issue with the genesis declarations I’m making but the conditionals for the event single pages:

    add_filter(‘genesis_pre_get_option_site_layout’, ‘tribe_single_layout’);
    function tribe_single_layout($opt) {
    if (is_singular() && tribe_is_event())
    $opt = ‘content-sidebar’;
    return $opt;
    }

    Are you sure ” if (is_singular() && tribe_is_event())” is the right in this case?

    Thanks,

    Rob

    #67197
    Barry
    Member

    Hi Rob!

    Thanks for jumping in and trying to move this along – even so it’s generally better to create a new thread of your own, even if it seems on face value to be the same or a very similar problem.

    In this case you are using Genesis – we don’t yet know if that’s true for the original poster, Shimatorabi, and I don’t want to derail this thread which he created in order to receive support for his own specific problem by focusing on a Genesis-specific solution, nor do I want it to become overly confusing by potentially discussing two completely different themes simultaneously with two different users.

    For that reason please do go ahead and create a new thread 🙂

    Thanks!

    #67203
    Robert
    Participant

    Understood Barry,

    I shall open a new one.

    Thank you,

    Robert

    #67238
    Barry
    Member

    No problem. Shimatorabi how are you getting on here?

    #68239
    Banafsheh
    Participant

    Hi Barry! I’m still not able to get the side bar on all my single events pages. When I change the template, it also changes it on the all events calendar page. Please help!

    #68240
    Banafsheh
    Participant

    Also, I’m not a developer, so I can’t really tweak the code you sent me. If you tell me which file to open and add the code to what line, I will be able to do that. I wish there was something in the setting that would allow users to do that and assign a specific sidebar for the events pages only. Thanks a lot for your help.

    #68289
    Barry
    Member

    OK, so guiding you through this line-by-line would be a little challenging since I don’t even know what theme you are using 🙂 – but let’s look at a generic example where we are using the default Twenty Thirteen theme and have chosen to use the Default Page Template (you might make any such changes from within a child theme):

    1) Override and/or edit the page.php template

    2) Locate the code that loads the sidebar. In Twenty Thirteen’s page.php template it looks like:

    <?php get_sidebar(); ?>

    Change this to:

    <?php if ( false === (tribe_is_event_query() && tribe_is_month()) ) get_sidebar(); ?>

    Which basically means, “get the sidebar only if this is not month view.”

    3) This should dispose of the sidebar that otherwise runs down the side of the page – however, the page is still formatted as if a sidebar is still present and as with many themes that is due to a certain CSS class being applied to the body element. By adding a short snippet to our theme’s functions.php file we can remove this CSS class

    I do appreciate that you are not a programmer and that the above may not translate directly to your theme, but hopefully it will give you something to start with – you could even try running through this process with Twenty Thirteen simply as an exercise in learning the ropes.

    Hope that helps!

    #70249
    Banafsheh
    Participant

    Hi, I’m still struggling with this. I don’t have the code you specified. The theme I’m using is called Avada. I wish there was something in the setting that would allow the user to add side bar to the details pages.

    Here’s the code for my page.php page. Can you please see if you can help me?

    ID, ‘pyre_full_width’, true) == ‘yes’) {
    $content_css = ‘width:100%’;
    $sidebar_css = ‘display:none’;
    }
    elseif(get_post_meta($post->ID, ‘pyre_sidebar_position’, true) == ‘left’) {
    $content_css = ‘float:right;’;
    $sidebar_css = ‘float:left;’;
    } elseif(get_post_meta($post->ID, ‘pyre_sidebar_position’, true) == ‘right’) {
    $content_css = ‘float:left;’;
    $sidebar_css = ‘float:right;’;
    } elseif(get_post_meta($post->ID, ‘pyre_sidebar_position’, true) == ‘default’) {
    if($data[‘default_sidebar_pos’] == ‘Left’) {
    $content_css = ‘float:right;’;
    $sidebar_css = ‘float:left;’;
    } elseif($data[‘default_sidebar_pos’] == ‘Right’) {
    $content_css = ‘float:left;’;
    $sidebar_css = ‘float:right;’;
    }
    }
    if(class_exists(‘Woocommerce’)) {
    if(is_cart() || is_checkout() || is_account_page() || is_page(get_option(‘woocommerce_thanks_page_id’))) {
    $content_css = ‘width:100%’;
    $sidebar_css = ‘display:none’;
    }
    }
    ?>
    <div id="content" style="”>

    <div id="post-” >

    <div id="sidebar" style="”>

    #70281
    Barry
    Member

    Hi Shimatorabi,

    Just for future reference posting code directly into the forum isn’t always a great idea (as our forum doesn’t handle it very nicely and bits of code are often dropped). Instead, please share code using a service like Pastebin or Gist and drop the link in here.

    If you can do that I’ll be happy to take a quick look – but please do understand while we can point you in the right direction really you need to be prepared to make these changes and investigate any issues by yourself.

    Thanks!

    #71689
    Banafsheh
    Participant

    Thanks a lot Barry. I wish this was something we could control in the setting.
    I pasted the code here: https://gist.github.com/anonymous/7050531

    #71710
    Barry
    Member

    So it looks like in the case of Avada the preferred function for pulling in a sidebar is generated_dynamic_sidebar() – what I’d suggest is combining that with the conditional check I outlined above in your default events template.

    Putting the pieces together though is something we’ll need to leave to you to figure out, though. Do also remember to check out our Themer’s Guide (link on the right under Userful Resources) and also our technical docs if haven’t already done so 🙂

    Thanks – and good luck!

    #981477
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Sidebar on event details pages’ is closed to new replies.