Home › Forums › Calendar Products › Events Calendar PRO › HOW TO : Build a different Event SLUG structure as default
- This topic has 3 replies, 2 voices, and was last updated 12 years, 2 months ago by
Brook.
-
AuthorPosts
-
February 5, 2014 at 9:21 am #100987
bodin
ParticipantHi all,
I know I’ve asked this question before, but I need to reach out to the GURU’s here that might help me in some direction when it comes to solving my challenge.
I have ECP and Community Events. 99% of my users add new Events in the Calendar via the Community Events plugin.
I really would like to have the Event SLUG constructed in a different way. Many of the Event Titles are the same and I would like the structure to be like this:
domain/event_slug/year/month/date/EventTitle
Example would be:
mydomain.com/event/2014/02/05/Training-EventHow would I be able to accomplish this?
Today, the result Event slug increases with a number after the Event Title.
Thank you in advance!
Sincerely,
AndreasFebruary 6, 2014 at 11:26 am #101427Brook
ParticipantHowdy bodin,
That makes a lot of sense. It is easy to see why you would want to do this. Fair warning, this is going to be a bit involved for a modification.
First you would need to hook into the filter ‘tribe_events_rewrite_rules’. This will allow you to modify the rewrite rules to fit your needs. From there I think the easiest way to add your custom logic would be to hook into TribeEvents::getLink(), which also has a filter (‘tribe_events_getLink’). Although really you could add the logic almost anywhere in the wp_query filters chain.
Now for the fun part, once you have all your hooks setup you would need to program some extra logic to generate those pages. You are going to have to add a few listeners for the additional query_vars that you added in your custom reqrite rules. And then you will have to program in the logic, and modify $wp_query as needed.
Does that make sense? There is going to be a lot of programming to get this done. Please let me know if I can elaborate or clarify. Cheers!
– Brook
February 6, 2014 at 2:34 pm #101551bodin
ParticipantHi there Brook!
Thank you very much for taking the time to respond to my question.
Well, I am not a programming GURU, but I am though starting to understand bits and pieces. 🙂 But I will admit that I am not really grasping the reply that you so kindly have given me.
To put it in clear text: I don’t understand. 🙂
But since you write that it will create plenty of programming, maybe I shall let it be and instead put it as an “enhancement” request for the developers of The Events Calendar. 🙂
Or do you think there exists a fairly simple path to take?Sincerely,
AndreasFebruary 7, 2014 at 9:37 pm #102214Brook
ParticipantHowdy Andreas,
I totally understand. Plenty of us are self-taught, myself included. Personally, I think that this change would be waaaay beyond my capability when I was in the bits and pieces phase. I know it would have taken me many days, maybe weeks, to get it done, and a whole lot of googling.
I can not think of a simpler path. If you are anything like me, this is probably best left to a feature recommendation. Please throw it up on feature recommendation site! That would allow other users to easily voice their support for the idea, and for us to keep track of it.
Does that make sense and fully answer your question? I want to make sure you are squared away before marking this topic resolved. Please let me know, thanks!
– Brook
-
AuthorPosts
- The topic ‘HOW TO : Build a different Event SLUG structure as default’ is closed to new replies.
