Home › Forums › Calendar Products › Events Calendar PRO › single event slug on events with the same
- This topic has 7 replies, 4 voices, and was last updated 9 years, 9 months ago by
Scott Morey.
-
AuthorPosts
-
July 7, 2016 at 11:27 am #1136745
Scott Morey
Participantedit: (the title of this post was truncated, it was originally “single event slug on events with the same title”)
I’ve had this working on another installation, but I am absolutely mystified as to what happened to the event-date-based slug on single event URLs of the same name.
Currently when I create an event with the same name as an existing event, I end up with ‘/event/event-name-2’ as the slug, and I would really prefer ‘/event/event-name/YYYY-MM-DD’ or even (preferably) ‘/event/YYYY/MM/DD/event-name’ like my permalinks are configured.
As I said, I have a site where this is (or was, perhaps, until I updated most recently) working just fine, but I’m setting up a new site and I can’t seem to reproduce this behavior, and searching the forums/knowledgebase/stackoverflow/internets are not providing useful results (which is alarming. Are people really okay with event-name-2 … event-name-38 and so on in their permalinks? Gross.)
I even installed the “custom post type permalinks” plugin, but that only lets me configure the slug to today’s date (or the post creation date) not the event date. I guess if I knew what the %keyword% was in that context to get the event date, that would be an adequate solution.
Thanks for any help you can offer. I can provide direct links to examples if desired
-
This topic was modified 9 years, 10 months ago by
Scott Morey. Reason: clarify original title after truncation
July 7, 2016 at 1:29 pm #1136876Brook
ParticipantHowdy tadl,
That’s awesome you got this setup before. I’m actually wondering how you did it as well. đ Messing with permalinks can be some pretty nasty business. In my experience altering the structure has all manner of unintended side-effects and breaks things like the iCal export. If you managed it on a different site I would love to know how. I have yet to come across any plugin or bit of code that could do it cleanly, but I definitely have not tried them all.
I wish I could be of more help here đ . If you can share the plugin list/configuration of relevant plugins, or any custom code run on the existing site, I might be able to help more.
- Brook
July 7, 2016 at 2:02 pm #1136910Scott Morey
ParticipantIt seems like this was at one time behavior-as-designed, rather than just appending ‘-(n+1)’ to the end of the title in the url, because I looked through functions.php in my (old) theme and I don’t see anything (other than some RSS feed trickery I put in place on the older site).
I’m also not sure the older site is still doing it, since I was running older versions of the plugins after my license expired last year.
Bought new licenses yesterday, applied to both sites and upgraded them. Haven’t actually tested the old site yet (though I did reach out to the person who creates events on that site, so I guess he’ll let me know when he creates new events and I can look at it then).
I just can’t believe slug behavior isn’t configurable other than a single path segment!
I am hopeful. My end users probably don’t care one way or the other and are perfectly fine sharing a /event/event-name-3985 link, but I do care. It looks bad, and having the event date in the url is a nice visual clue that you’re looking at the right thing prior to actually clicking on it.
July 8, 2016 at 8:59 am #1137259Brook
ParticipantI just canât believe slug behavior isnât configurable other than a single path segment!
You will find this is pretty common with WordPress plugins, and there is good reason why. Trying anything more complicated is prone to breakage and conflicts within the WordPress ecosystem. Making this configurable is likely never going to happen just due to the nature of the beast. I wish I had better news here.
I am hopeful. My end users probably donât care one way or the other and are perfectly fine sharing a /event/event-name-3985 link, but I do care. It looks bad, and having the event date in the url is a nice visual clue that youâre looking at the right thing prior to actually clicking on it.
What if you manually edited the individual event slugs. Instead of /event/example-2 you could set the event to /event/example-2016-07-08 . Would that work?
Cheers!
– Brook
July 12, 2016 at 7:13 am #1138620Scott Morey
ParticipantFiddling around with permalinks at create time (particularly on recurring events) isn’t something I’m comfortable relying on users to do. Whatever, doesn’t matter. The plugin works even if the urls are hideous, so I guess I should be grateful.
Thanks for the suggestions.
July 12, 2016 at 10:04 pm #1138999Brook
ParticipantYou are welcome! Thanks for getting back and marking the thread answered.
If the above would work but you want it to happen manually, that seems quite doable with a dash of programming. You should checkout the function wp_unique_post_slug() which has the following filter:
/** * Filter the unique post slug. * * @since 3.3.0 * * @param string $slug The post slug. * @param int $post_ID Post ID. * @param string $post_status The post status. * @param string $post_type Post type. * @param int $post_parent Post parent ID * @param string $original_slug The original post slug. */ return apply_filters( 'wp_unique_post_slug', $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug );
If you wrote a filter for that you could alter duplicates, or event all events, to append any thing you wanted include a date. This does just apply to the slug portion of the URL though:Â /event/example-2
Anyways, I just wanted to offer one more alternative in case it might work better.
Cheers!
– Brook
August 3, 2016 at 9:35 am #1147158Support 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. -
This topic was modified 9 years, 10 months ago by
-
AuthorPosts
- The topic ‘single event slug on events with the same’ is closed to new replies.
