Home › Forums › Calendar Products › Events Calendar PRO › Show All Categories for New Event
- This topic has 12 replies, 3 voices, and was last updated 10 years, 7 months ago by
Leah.
-
AuthorPosts
-
July 1, 2014 at 11:38 am #265039
persyst
ParticipantHow can I have the Event Categories default to “Show All Categories” for when a User (or myself) is creating/posting a New Event?
Thanks,
StefanJuly 1, 2014 at 7:03 pm #265717matthewdenton
MemberHi!
Thanks for taking the time to reach out to us with your question. To confirm your question you are talking about the “Events Category” meta-box on the admin page as shown in the below screen shot?
If so we utilize existing WordPress functionality for Categories and don’t modify their functionality. If you want to modify how categories work I would suggest reaching to in the wordpress.org forums as someone there may have some hints/tips on defaulting to show all.
If I am mistaken in what you are looking for please let me know so I can help you further.
Thanks again for reaching out to us.
– Matthew
July 3, 2014 at 5:59 am #270772persyst
ParticipantThanks for the reply. However, I am referring to the Event Category section on the front-end at events/community/add. I have more the 12 categories and it shows the first 9 all at once, then a tiny drop down arrow appears below that says “Show all categories ( 12 )”. I would like all categories to be shown by default.
Thanks,
StefanJuly 8, 2014 at 6:51 am #309636matthewdenton
MemberHi Stefan:
Thank you for clarifying the change you wanted to make. I took a look at the Community Events form and below are the details you are looking for. Unfortunately the 9 category limit is hard coded in the code base so you have 2 options for modifications:)
Easiest – However will be overwritten if you update plugin
- <span style=”line-height: 13px;”>Open the file /lib/tribe-community-events.class.php in plugins/events-community</span>
- Search for formCategoryDropdown and replace both instances of “9” with “20” or similar larger number
Full Method – won’t be over wrriten with updates to plugin
- Copy the function from following gist link to your themes function.php file
- Override the taxonomy template in your own theme by creating a file at
[your-theme]/tribe-events/community/modules/taxonomy.php - Modify the following line of code
<?php TribeCommunityEvents::instance()->formCategoryDropdown( null, $currently_selected_category_ids ); ?> - to :
<?php formCategoryDropdown__override( null, $currently_selected_category_ids ); ?>
Each of the above methods will increase the number of categories that are shown by default. Please let me know if any issues implementing the changes.
Thank you,
– Matthew
July 10, 2014 at 7:40 am #335010persyst
ParticipantHi Matthew,
I’m still having a problem:
I added the gist link text to the end of my themes function.php
and copied the taxonomy.php from
cypherspot.com/wp-content/plugins/the-events-calendar-community-events/views/community/taxonomy.phpthen pasted it to
/cypherspot.com/wp-content/themes/make/tribe-events/community/modules/taxonomy.php
and swapped the line
<?php TribeCommunityEvents::instance()->formCategoryDropdown( null, $currently_selected_category_ids ); ?>with the new one
<?php formCategoryDropdown__override( null, $currently_selected_category_ids ); ?>
but now the “Add Event Page” is almost completely blank. I only see this text and nothing else, no boxes, no nothing.
“My Events”
“Not admin? Log Out”
“Event Title:(required) ”
“Event Description:(required) ”
“Text Visual ”
“Event Categories: ”Please help!
Thanks,
StefanJuly 10, 2014 at 8:08 am #335252persyst
ParticipantTypo earlier, I copied the taxonomy.php from
cypherspot.com/wp-content/plugins/the-events-calendar-community-events/views/community/modules/taxonomy.phpJuly 10, 2014 at 8:34 am #335452persyst
ParticipantHi Matthew,
I tried option 1, changing the 9’s to 20’s in the /cypherspot.com/wp-content/plugins/the-events-calendar-community-events/lib/tribe-community-events.class.php below the formCategoryDropdown area
at :
// Show the first 9 categories.
if ( $i < 9 )
and
if ( count( $cats ) > 9 )but this ends up giving me an http 500 error and I then the only way to access the front-end of my site from is by re-uploading the original tribe-community-events.class.php file that I have locally. Because changing the 20’s back to 9’s would not undo the error.
Please Help!!
Thanks,
StefanJuly 10, 2014 at 10:05 pm #342296matthewdenton
MemberHi:
Changing the 9s to 20s would only cause the behavior you outline if another portion of the file was edited. Did you by chance delete a ) or similar character when making the edit?
I need to revert my test site and run the snippet I sent your way and will have an update for you shortly.
Thanks for your patience,
– Matthew
July 11, 2014 at 5:43 am #347379persyst
ParticipantHi Matthew,
Ok, thanks. I would prefer to use Option 1, since it will not be effected by a calendar upgrade. I’ll wait for your response regarding how to implement this, since I could not get it working as stated above.
For Option 2, I definitely only changed the “9” character to a “20” in the two locations, when I received the error.
Thanks for you help,
StefanJuly 11, 2014 at 6:24 pm #352250matthewdenton
MemberHi Stefan:
My apologies, I re-tested the code on my site and noticed I gave you a typo! Shame on me. Let me try this again.
- copy the function from original gist into your theme’s functions.php file
- Use this gist‘s code for the content of the taxonomy.php file.
The location you specified earlier was correct so shouldn’t need to make any modifications.
Let me know if this doesn’t work for you but you should be all set It currenlty is working on my site as shown in this quick screen capture: https://cloudup.com/iJBeWDdHmT6
Again my apologies for the original typo in the code,
– Matthew
July 14, 2014 at 11:07 am #380888persyst
ParticipantThanks! That update worked!!
July 15, 2014 at 5:37 am #393575matthewdenton
MemberStefan:
Exellent, Sorry again for my typo! I’m going to mark this thread as closed. If you have any additional questions on the plugins please feel free to create another thread!
Also if you have a minute or two we would love it if you could say a few words about our plugin here : http://m.tri.be/lo
Thank you,
– Matthew
September 3, 2015 at 3:30 pm #1001844Leah
MemberHi there,
I wanted to report back to you on the status of this issue. Your report is tracked in our internal system and a fix is on our to-do list, but we were not able to fit it into our upcoming 3.12 release. Please know that the issue is still very much on our radar and we will be working on it for a future release. We appreciate your patience while we work to improve our plugins. Thank you for using The Events Calendar!
Best,
Leah
and The Events Calendar team -
AuthorPosts
- The topic ‘Show All Categories for New Event’ is closed to new replies.
