WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Show only full size calendar on location page (13 posts)

  1. heretiq
    Member
    Posted 1 year ago #

    Hello,

    Thanks for an awesome plug-in. I am experimenting with EM to see if it can perform as a work scheduling application. So far, so good; however, I have hit a roadblock trying to figure out the following two issues:

    1) How to replace the default event list for a location with an event calendar?

    I have added two test locations and added the following short codes to the respective pages:

    [events_calendar location="location1" full=1]
    [events_calendar location="location2" full=1]

    The event calendars are displayed on each page; however the default event list and list title (Upcoming Events) is shown beneath them.

    How can I disable the default event list and only show the event calendars on the dynamically generated location pages?

    2) How to set the individual location pages template to the Showcase Template?

    I am using the Twenty Eleven template and would like the event calendars on the individual location pages to be as big as possible. However, the Page Attributes options are not displayed on the dynamically generated location pages -- so the default template is used which limits the calendar width to just the content area and leaves the sidebar areas unused.

    How can I set the templates on the dynamically generated location page to the Showcase Template?

    Thanks again for a great plug in. Any guidance is appreciated.

    Thanks!

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 1 year ago #

    1. try shortcode [events_calendar location=6 full=1 long_events=1] where location attribute is the location id

    Settings > Pages > Event list/Archives > Display calendar in events page

    2. you can try this link http://wordpress.org/support/topic/events-manager-eventslocation-pages-cant-get-sidebar?replies=20 however use single-location.php instead

  3. heretiq
    Member
    Posted 1 year ago #

    Thanks agelonwl.

    I tried the suggestions and observed the following effects:

    1. Added long_events=1, Display calendar events in pages was already set

    -> Effect = nothing observable

    2. Added single-location.php with the following content:

    <?php
    /*
     * Remember that this file is only used if you have chosen to override location pages with formats in your events manager settings!
     * You can also override the single location page completely in any case (e.g. at a level where you can control sidebars etc.), as described here - http://codex.wordpress.org/Post_Types#Template_Files
     * Your file would be named single-location.php
     */
    /*
     * This page displays a single event, called during the em_content() if this is an event page.
     * You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need.
     * You can display events however you wish, there are a few variables made available to you:
     *
     * $args - the args passed onto EM_Events::output()
     */
    global $EM_Location;
    /* @var $EM_Location EM_Location */
    echo  $EM_Location->output_single();
    ?>

    -> Effect:

    Fatal error: Call to a member function output_single() on a non-object in /.../schedz/wp-content/themes/twentyeleven/single-location.php on line 16

    I suspect that the file contents are insufficient, but need some pointers on how to address it.

    Any suggestions are appreciated.

    Thanks!

  4. agelonwl
    Member
    Posted 1 year ago #

    you can try this snippet in your single-location.php - http://pastebin.com/Z2t2Ah2S

  5. heretiq
    Member
    Posted 1 year ago #

    Thanks again agelonwl.

    I tried the snippet. It eliminated the error, and shifted the event listing left; but the events are still output in a list, not the calendar format.

    In addition the [events_calendar location=6 full=1 long_events=1] shortcode is being output as literal text and is not being interpreted as instruction.

    Thoughts?

  6. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    Try adding quotations to the values e.g. location="6"

    if you're pasting that directly into the page code then that'd by why, as shortcodes only work on page/event/loc etc. content in your admin area.

    To do it in code, you'd use

    echo EM_Calendar::output(array('location=>"6", 'full'=>1, 'long_events'=>1));

  7. heretiq
    Member
    Posted 1 year ago #

    Thanks Marcus!

    I edited the single-location.php file with a modification of your suggested code. That solved the calendar display issue; however the code does not filter calendar events by location. I am sure that it's due to my less than elementary PHP coding skills.

    Here is the code that I am using in single-location.php:

    <?php get_header(); ?>
     <div id="primary" style="width: 50%">
             <div id="content" role="main">
                     <?php
                             global $post;
                             $EM_Location = em_get_location($post->ID, 'post_id');
                     ?>
    
                     <header class="entry-header">
                             <h1 class="entry-title"><?php echo $EM_Location->output('#_LOCATIONNAME'); ?></h1>
                     </header>
                     <div class="entry-content">
    						 <?php echo EM_Calendar::output(array('location'=>'$EM_Location', 'full'=>1, 'long_events'=>1)); ?>
                     </div>
             </div>
     </div>
     <?php get_footer(); ?>

    Any suggestions?

    Thanks again.

  8. agelonwl
    Member
    Posted 1 year ago #

    hi,

    try this snippets

    <?php get_header(); ?>
    <div id="primary" style="width: 50%">
     <div id="content" role="main">
      <?php
       global $post;
        $EM_Location = em_get_location($post->ID, 'post_id');
      ?>
      <header class="entry-header">
       <h1 class="entry-title"><?php echo $EM_Location->output('#_LOCATIONNAME'); ?></h1>
      </header>
      <div class="entry-content">
       <?php echo EM_Calendar::output(array('location'=>$EM_Location->location_id, 'full'=>1, 'long_events'=>1)); ?>
      </div>
     </div>
    </div>
    <?php get_footer(); ?>
  9. heretiq
    Member
    Posted 1 year ago #

    Thank you very much agelonwl. That worked perfectly.

    One last question: How do I make the calendar fit the entire width of the page?

    Thanks!

  10. agelonwl
    Member
    Posted 1 year ago #

    hi,

    try to add this in your theme style.css

    table.fullcalendar {
    width: 800px !important;
    height: 600px;
    }
  11. heretiq
    Member
    Posted 1 year ago #

    Thanks agelonwl. I tried the CSS snippet, but it made no difference in the calendar presentation on the location listing page. It looks like the page layout has a blank left sidebar, but the sidebar space is not available to make the content area larger.

    Marcus, I checked the "Using Template Files" documentation (http://wp-events-plugin.com/documentation/using-template-files/) to make sure I was putting the file in the correct path and now I believe the documentation is incorrect. The documentation says:

    We’ll give you a common example, using the above folder structures, which is overriding the large calendar. This file is located at wp-content/plugins/events-manager/templates/templates/calendar-full.php.
    Rather than editing this file directly, copy it to wp-content/themes/twentyten/plugins/events-manager/templates/calendar-full.php and edit it there, as it will not be overwritten when you update Events Manager.

    However, it seems like the override only occurs when the file (single-location.php in my case) is placed in wp-content/themes/twentyten/ -- it does NOT work when placed in wp-content/themes/twentyten/plugins/events-manager/templates/.

    Am I doing something wrong?

    Thanks.

  12. agelonwl
    Member
    Posted 1 year ago #

    Hi,

    You should copy templates within your current theme directory e.g. wp-content/themes/Your current theme name/plugins/events-manager/templates/calendar-full.php; Also, do you have a sample link for us to see?

  13. heretiq
    Member
    Posted 1 year ago #

    Thanks agelonwl.

    The problem was due to the template file naming: I placed the file in

    wp-content/themes/Your current theme name/plugins/events-manager/templates/
    but it was named "single-location.php" instead of "location-single.php". The override worked as soon as I made this change.

    However, the calendar still does not fill the entire page. The contents of "location-single.php" is as follows:

    <?php get_header(); ?>
      <div id="container">
       <?php
        global $post;
         $EM_Location = em_get_location($post->ID, 'post_id');
       ?>
       <div class="entry-content" style="width: 100%">
    	   <?php echo EM_Calendar::output(array('location'=>$EM_Location->location_id, 'full'=>1, 'long_events'=>1)); ?>
       </div>
      </div>
     <?php get_footer(); ?>

    The page can be viewed at this URL: http://netritus.com/locations/zenna-dallas/

    As you can see, the content area does not span the left sidebar, so the space is unusable.

    I think this is probably a simple page layout issue; but I am a wordpress newbie so I am not yet familiar with how to properly code the page.

    Thanks again for your help. I really appreciate it!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic