Home › Forums › Calendar Products › Events Calendar PRO › Community Events without a start or end date
- This topic has 8 replies, 3 voices, and was last updated 9 years, 11 months ago by
Support Droid.
-
AuthorPosts
-
May 11, 2016 at 1:41 pm #1113438
Tommy Stuvland
ParticipantHello!
First of all i want to thank you all for an excellent plugin! Im new to the event calendar so I’m not sure if its possible or not, but i sure would like to find out. =)Im running a small pro-bono community website that informs people in a small area of the city about culture events, concerts, festivals, sports and gatherings of all sorts, inside of this area. The idea with the site is to recruit people to join, and involve them self in the different activities and events in this area. Im using the Community Events plugin for people in the area.
I want to offer a section of my site like an online poster/cork board, where people can post “events” or messages (without a date) like “help wanted”, “giving away my whatever”, “Missing cat”, “Cat found” and so on.
Now to the question, is there a way to post an event witout a date, and list it on a seperate section on my site with the event calender?
Maybe trough an catagory and a widget?Thank you for your time on this. =)
Best regards from NorwayMay 11, 2016 at 10:11 pm #1113604Brook
ParticipantHowdy Tommy!
That is a cool idea. I am happy you thought of our plugin for this, but I am not sure it is quite suited for your needs. You say you want this to be a separate page/area of your site. Have you considered using a bulletin board plugin? Our plugin is designed for events, and events typically have to have a date. There are a lot of things in our plugin that would break if the event did not have a date, so we basically just assume they all do.
I just googled around and found a number of bulleting style plugins. One that seemed promising was Hoot Board. Do you think something like that might be better suited to your needs?
Cheers!
– Brook
May 12, 2016 at 9:35 am #1113855Tommy Stuvland
ParticipantHello Brook!
Thank you for your reply. =)
I actually considered the Hot Board, but Im not so keen on all to many plug-ins, and I dont think its as good as the Even Calander combined with the Community Event plug-in.The date part is not so important, it could be a fixed period like maybe 30 days from publishing date, triggered by a choice in the new event-form.
Can you see a solution, or do i have to resort to anoter plug-in?
Best regards
TommyMay 12, 2016 at 11:34 pm #1114136Brook
ParticipantHey I am stoked you like our plugins so much!
I could definitely see some solutions using Community Events. The simplest way to do this would be exactly what you say, have a category dedicated for this sort of thing and show that category using the list widget. Using a little bit of CSS you could hide the dates from displaying, so whatever they input as the date is mostly irrelevant. Further you can hide this category from the default calendar view by using a snippet like this:
https://gist.github.com/elimn/c47fb3e65d437c2479bd
That snippet may require a bit of customization. First of all you probably want to uncomment the line which shows single events. Second you will want to exit the function (return $wp_query) if the user is viewing the page with the widget on it, otherwise the widget will return no results since all of the events are hidden.
If you are up for customizing things you could take that simple idea a lot further. You could create a separate submission page that does not even have the date field and preselects the category. This would actually be fairly easy to do if you are versed in PHP. You could add a query var to the events add URL. Say your URL is example.com/events/community/add, then for the bulletin page maybe link to example.com/events/community/add?bulletin=submit . Now when someone clicks on your bulleting submission link they will still see the Community page, but you will know they intend to submit a bulletin. If you create a theme override for the Community Submit page (Themer’s Guide) then just check to see if the bulletin query var is present. If it is, hide the events module, which contains the date selector and such, and replace it with an <input type=hidden /> that contains your preferred value for the date. Maybe make it a month out like you said? You can further do the same thing with the category module, and anything else on the page not applicable to your use.
Further you can modify the Event List widget module by following our Themer’s Guide as well. You can again check to see if the page being shown is the one with your widget, and if so do any modification you want.
Please let me know if I can help with the above, especially getting the “basic” idea going. If you are not versed in PHP even the basic part might be a bit daunting. But the most complicated part is just hiding those events from the regular calendar views, any maybe you don’t need to do that.
Cheers!
– Brook
May 15, 2016 at 4:07 am #1114663Tommy Stuvland
ParticipantBrook, this is awesome!
And just what i was looking for. I must say that Im really impressed with your cutomer service. =D
I have a background in user interface and front-end system development so I know that everything is possible. But Im not versed in PHP, my skills are design, CSS and html, but I’m eager to learn. Any help getting the basic idea going would be much appreciated! =)
Best regards
TommyMay 16, 2016 at 9:01 am #1114973Brook
ParticipantFor sure. The only thing I can see that I did not fully explain above is how to detect if you are on a given page. There are many ways to do this in WordPress, but the most general one is using the variable $_SERVER[‘REQUEST_URI’] . If you are on example.com/events/ that will equal “/events/”. So something like this added at the top of that snippet should work:
if ( $_SERVER['REQUEST_URI'] === '/custom-page-name/' ) return $wp_query;We are only able to give overviews here, not always specific code. But hopefully the above overviews will prove quite helpful, I got very specific in a number of areas. On that topic if you are copy/pasting the above code you might need to swap out the curly quotes for regular ones. Our forums here are powered by WordPress, and WordPress replaces regular quotation marks with the angled ones. Which of course PHP requires regular quotation marks, so sometimes copy/pasting won’t work.
Please let me know if you have any specific questions as you go Tommy. I would love to help as much as our terms of service allow. 🙂
Cheers!
– Brook
May 16, 2016 at 11:39 am #1115058Tommy Stuvland
ParticipantThank you Brook, this is awesome! =)
I’ll wrap my head around this and dive in to PHP.
On last question (since i dont have a clue and want to try right now (and my motto is “learning by burning”)), how do you exit the function (return $wp_query)? =D
PHP for dummies is next on my list. =DThanks again for this specific explanation and support.
-Tommy
May 16, 2016 at 5:04 pm #1115177Brook
ParticipantYou are quite welcome!
On last question (since i dont have a clue and want to try right now (and my motto is “learning by burning”)), how do you exit the function (return $wp_query)
Exactly! return exits the function. Since this function is attached to a WP filter it should always return some type of data. In this case it should always return a WP_Query object, which the $wp_query variable is.
Hopefully that makes sense. Cheers!
– Brook
May 31, 2016 at 9:35 am #1120716Support Droid
KeymasterThis 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. -
AuthorPosts
- The topic ‘Community Events without a start or end date’ is closed to new replies.
