Display node add form in popup
First, I would say dont put this logic in a .tpl if you can put it somewhere else, for maintainability.

Second, as with many drupal solutions, there is more than one way and they differ in some aspects.  Let me try a few for you:

Solution A: https://www.drupal.org/project/colorbox  This adds a checkbox to the views field controls that says "Open link in Colorbox", and you use the Output as a Link controls to make this link point to /node/add.  Verify necessary permissions are set.

Solution B: Ctools modal link conversion.  In your calendar view add a nid field and use the 'Rewrite Field' options to replace it's value with your Create anchor tag.  Make sure this tag has the class "ctools-use-modal".  The reason for doing this so early is that links tagged with that class, when passed through the render process, get converted into a modal link.  Since this is on a calendar display, I am guessing that you are wanting people to make events for the calendar, and it would be really cool to have the event creation form pre-populate with the day they clicked?  Look at https://www.drupal.org/project/prepopulate and alter your anchor path to include the token from the date field that is already in your view.  Now the hard part, you will need to write a hook, so you will need a custom module.  I havent tried https://www.drupal.org/node/1312770 but it looks like it can make a skeleton for you.

You will need to implement this:

function hook_views_pre_build(&amp;$view) {
  if ($view-&gt;name == [your_view_here]) {
    $current = $view-&gt;current_display;
    // Include the CTools tools that we need.
    ctools_include('ajax');
    ctools_include('modal');
    // Add CTools' javascript to the page.
    ctools_modal_add_js();
  }
}


That will make sure the view is processed by ctools looking for modal pop-ups.  I just used this the other month in a slightly more complicated use case, where path in the view is a custom registered callback and anonymous user gets a sign-up form in modal, and logged in user gets the requested resource.  Using what I have explained above, you should have a site where everybody gets the modal.  Make sure you have the appropriate Node Create permissions checked.

Solution C: There is an Overlay module that ships with Drupal 7, has been in there from the begining.  This is less popular than colorbox and ctools, and bit more limited.  Enable the module, give anon user permission to use it, and add "#overlay=" to the beginning of your link path in the view.  I dont recall at the moment if they solved some security issue involved with anonymous access to this module, so I caution against using it.  I am really only including it here as an example of how many solutions are available in drupal.

Good luck, and please do say how this worked for you.