1

Solved See my solution in the answer below.

I am having an issue with the 7.x-3.4 Calendar, and would like to know if anyone has a solution, or suggested solution, to this issue.

Background: I have created a new content type of "Booking", and have created a new Calendar View that displays only dates of this content type. The Calendar works fine, and if I add new content through my Administrator option of "Add content", I can define my date, taxonomy terms and specific information (such as the Point of Contact (POC) name and email address) without an issue. These display perfectly on my newly created calendar, with a coloured stripe dependant on the taxonomy term selected (just for interest, the taxonomy term defines which room they would like to book). From here however, I have this issue:

In the page to edit the view for the calendar, I select Format > Show > Settings, and get the "Month: Row style options" page. When I select a content type in the "Add new date link" dropdown box, I do not get an "Add" link on my Calendar. (I have tried all the different types of content, including a content type that all authenticated users are able to, and actively do, create new content within. I have edited the permissions to allow all authenticated users to create content of content type "Booking". As a point of interest, I also use OG, however have not defined an OG "Group" to this content type, and do not plan to align this content type or calendar with any form of OG functionality in the future. I thought it pertinent to mention this in case here is where my problem lies)

I would greatly appreciate any feedback or thoughts anyone has, please do not hesitate to ask for any more information that you feel you may need!

1

OK, so I have fixed this with a custom work around. There are many modules that I am using that may be interfering with the permissions to add a new date, and be limiting what can be displayed in the view. No matter, here is how I solved it:

First of all, set up the modules and permissions as following:

Go to admin > modules, and find the PHP Filter module, ensure it is enabled:

enter image description here Next, go into the permissions and find the following: enter image description here

Ensure that the last option, "Administrator", is selected.

Next, go to the view where you would like to add the "Create Booking" (or whatever content type it is you are after.) From here, create a new header of type "Global: Text area" enter image description here

What I chose to do next was create a link to a new view, and on this view I expose the form to add the new date/event. If you want to embed the create form here, then skip the next step, however I find doing it this way leaves the current calendar in it's original state, and by clicking the about to be created "+ Add Event" link, you will be taken to a new view that contains the calendar and the exposed form.

Now, select "Full HTML" as the Text format, and place the following code in the text box. This will create a link to a new view, which we will make next. The two lines below are simply coloured text that I will use as a legend for the calendar. enter image description here

<a href="/calendar/create_booking">+ Create Booking</a>

When we next create the view containing the form to add the new date/event, if you chose to use a different path, come back here and change "/calendar/create_booking" to your preferred path.

Now, apply changes and save the view. Go back to your Admin > Structure > Views page, and locate the view of your current calendar. Now, on the "Operations" dropdown, select "Clone View"

enter image description here

Rename the newly created view (I called mine "Create {Your Old View Name Here}"). Now, open up the "Edit" option for this view and create a new Header of type "Global Text Area" as before. This time, we want the Text Format to be "PHP Code" and to place the following code in your text area:

enter image description here

<?php 
  module_load_include('inc', 'node', 'node.pages');
  $node_form = node_add('node_type');
  print drupal_render($node_form);
?>

Remember to change 'node_type' to your desired content type. Save the Header, and return to the last screen. Now simply change your path to what you wish:

enter image description here

And now finally, go back to your original Calendar view, edit the header to contain the correct path in the link we made, and you're finished! The form is now exposed for users to create a new event/date. Ensure that you set the appropriate permissions for users to be able to create this content type, and remember that their view of the create form will be much simpler than yours.

Hope this helped you if you had the same issue as me!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.