Events Made Easy › Forums › Bug fixed or feature request implemented › Support for Friendly URLs (Permalinks) of Events
Tagged: 404, Fixed somewhat, friendly, permalink, slug, url, wp_rewrite
- This topic has 72 replies, 9 voices, and was last updated 13 years, 4 months ago by Franky.
-
AuthorPosts
-
Thu 21 Oct 2010 at 20:04 #42189AnonymousInactive
While looking through the forums, I noticed that some people had asked for friendly URLs (permalinks) to be implemented into EME. liedekef mentions that Permalinks are working with his plugin, but I think there might be a little misunderstanding.
Currently, when you create an event, it can be accessed at http://www.domain.com/events/?event_id=1. This isn’t a very friendly name. I think what we’d like to see is a more friendly URL, such as http://www.domain.com/events/event-title, where “event-title” is a slug created upon the creation of the event.
Now, keep in mind we’re not talking about the permalink structure of a site overall. What we’re talking about is having EME create these permalinks specific to the plugin and the events it creates.
After quickly glancing at the plugin’s code and database structure, I don’t think permalink support is implemented yet in EME. (Please correct me if I’m wrong in assuming this.)
While looking at the wp_dbem_events table, I don’t see any slugs created or associated with events. Slugs, like on your posts and pages, are important identifiers used in creating permalinks.
I then did a quick run through of the plugin’s code. From what I can see, I don’t see any references to $wp_rewrite, which is a global variable used to start the creation of permalinks (as talked about on http://codex.wordpress.org/Function_Reference/WP_Rewrite ).
Keep in mind that I’m really not a WordPress developer but am just coming to this conclusion by trying to put the pieces together as to why I couldn’t get Permalinks to work with EME.
I hope this helps a little bit and I really hope we can see Permalinks in a future release of EME. Thank you.
Thu 21 Oct 2010 at 21:45 #45147FrankyKeymasterYes indeed, you’re right: I haven’t implemented permalinks in the plugin yet. But using some Rewrite-voodoo in apache gets you there 🙂
Of course if you really want the events in permalink without any extra manual action: nope, not done yet. But you have me an important hint here, so now I can go and make something of it 🙂
Edit: adding this for reference later on: http://shibashake.com/wordpress-theme/wordpress-permalink-add
Edit 2: adding this for reference: A way to check if the blog has a permalink structure is:
if ( get_option('permalink_structure') != '' ) { echo 'permalinks enabled' }
Sat 23 Oct 2010 at 21:00 #45148AnonymousInactiveVoodoo? Black magic like that does not belong in these hands. It’ll only lead to trouble. 😉
Glad I can give you a hint in what needs to be done to implement that feature. I’m sure a lot of us will be very thankful for that. 🙂
Sat 23 Oct 2010 at 22:44 #45149FrankyKeymasterWell, any help is appreciated in this area … I’ll do my best, but it will take some time and experimenting before I get this right.
Sun 13 Feb 2011 at 16:26 #45150FrankyKeymastergood news: I managed to get basic SEO urls to work as expected, so now it’s just trying to tie everything together and making it work.
I plan to have:
/events/<eventID>/<eventNAME>
(and similar for locations). For now it works ok without the ID, adding the name is in fact irrelevant to the functionality and should be easy to do.
Sun 13 Feb 2011 at 22:21 #45151FrankyKeymasterok, basic single event and location permalinks work ok now
Sun 13 Feb 2011 at 22:44 #45152AnonymousInactiveGreat! I am anxious to try them.
Sun 13 Feb 2011 at 22:59 #45153FrankyKeymasterwell, it’s in trunk so if you test it out, let me know the results …
Don’t forget to deactivate/activate the plugin and *maybe* you need to visit the permalinks setting page and press “save” there (although that shouldn’t be needed any more, I flish the rewrite rules upon activation/deactivation)
Sun 13 Feb 2011 at 23:41 #45154AnonymousInactiveOK, I will do all that and let you know what happens.
Mon 14 Feb 2011 at 01:01 #45155AnonymousInactiveI wasn’t sure whether you meant to re-save the permalinks setting before or after EME activation, so I did both. I deactivated EME, swapped to the new EME files, saved permalinks, activated EME, and saved permalinks. Then I cleared my web browser cache to be sure of using only newly-served pages.
EME single-event permalinks work with some issues, but single-location permalinks do not. For example, I went to a location named ‘Finlandia-Talo’ and the URL was:
http://www.mydomain.com/events/?location_id=15
Even though single-event permalinks work there are three issues demonstrated by this ‘Paco Peña’ event example:
http://www.mydomain.com/events/4/Paco%20Pe%C3%B1a/
1) URL’s should not contain space characters. Even though they generally work in actual practice, they are not reliably processed throughout all internet systems and should be replaced by dashes.
2) URL’s should be composed of only lower-case characters, because some systems are case sensitive and others are not providing the potential for ambiguities and conflicts.
3) Accented characters like ‘ñ’ should be changed to ASCII ‘n’ according to IDNA, because accented characters are not compatible with some internet systems.
Mon 14 Feb 2011 at 08:47 #45156FrankyKeymasterYes, I forgot to generate the location seo url’s 🙂 The code is there, just … forgotten. I thought about it at 3am though 🙂
Spaces and lower case: consider it done. But is there a function somewhere to “convert” characters to their ascii equivalent?
Mon 14 Feb 2011 at 09:05 #45157FrankyKeymasterlocations permalinks are in now, as well as spaces and lowercase, and WP seems to provide a nice function to convert accents: http://codex.wordpress.org/Function_Reference/remove_accents
It’s all in trunk now
Mon 14 Feb 2011 at 15:23 #45158AnonymousInactiveGood, I will test it later this morning.
Mon 14 Feb 2011 at 18:23 #45159AnonymousInactiveEME single-event and single-location permalinks both work correctly in the latest trunk version. Those changes are significant improvements in applications where website traffic from search engines is important.
Mon 14 Feb 2011 at 18:39 #45160AnonymousInactiveAfter posting my comment above I noticed a simple issue that will result in search engine duplicate-content penalties. EME’s link URL’s do not include trailing slash characters, but actual URL’s do. They need to be same, because search engines consider URL’s with and without trailing slashes to be different addresses. For example, this link URL:
http://www.mydomain.com/locations/6/rose-theatre
goes to this actual URL:
http://www.mydomain.com/locations/6/rose-theatre/
Search engines will index both addresses for the same content and will impose duplicate content penalties for every such instance.
Mon 14 Feb 2011 at 18:49 #45161AnonymousInactiveStatic web pages are generally ranked higher by search engines than dynamic pages, because dynamic page content can change at any time and invalidate search engine indexing. Because of that, EME pages generally will rank better in search results if they are made to appear static by appending ‘.html’ like this:
http://www.mydomain.com/locations/6/rose-theatre.html
Mon 14 Feb 2011 at 19:01 #45162FrankyKeymasterThe trailing slash will not result in double search engine results: without the trailing slash it’s your webserver that redirects you (or not) to the same page with trailing slash. A redirection doesn’t get indexed by search engines. And I intend to stick a bit to the WP standards here, where no slash is added by default as well in the mentioned examples. Also: in my tests, I don’t get redirected (I saw it in the past though, but not with the current rewriting rules).
Also, the addition of “.html” is not something I like very much. I will not add it, but in a future version I hope to provide a way to customize the rewriting pattern. But even then: I worked with google search engines before and never saw a difference between static/dynamic page content. A search engine can’t detect that it’s a dynamic page anyway, because there’s no indication of that in the url.
Mon 14 Feb 2011 at 20:19 #45163AnonymousInactiveGoogle and other major search engines continue requesting both old and new URL’s from web servers many years after they have been permanently redirected if they continue finding the old URL’s in incoming links. URL links should not be redirected whether or not there are WordPress coding examples that result in redirection.
The Firefox “Live HTTP headers 0.16” Extension reports EME link 301 redirects.
This recommendation is from Google’s “Firebug 1.6.2” Extension:
Remove the following redirect chain if possible:
* http://www.mydomain.com/locations/6/rose-theatre
* http://www.mydomain.com/locations/6/rose-theatre/However, EME is your project. I will create my own private fork and won’t have any more to say about it.
Mon 14 Feb 2011 at 21:35 #45164FrankyKeymasterThe following has been added in trunk: “trailing slash to avoid redirection and speed up browsing”
However, in my own defense, I would like to stipulate some things here: it took me about a whole Sunday afternoon just to get the permalinks working ok (not taken into account my many reading about that as well, WP is poorly documented). I’ve already shown my willingness to implement many features, and this one is not even released. So please try to keep an open mind here and keep the discussion friendly and alive, so everybody benefits from it.
Mon 14 Feb 2011 at 23:31 #45165AnonymousInactiveFranky, I have never been involved in an open source project where anyone has been more responsive to bug and feature requests. Your general willingness and ability to quickly implement them is extraordinary and appreciated,
Even so, different opinions about the need for trivial code additions wastes time with every upgrade, because each time I have to manually apply patches. For example, even though you like Google map scroll-wheel zooming and I might like it too using your computer to visit a site where you use EME, I have no doubt that if you were to visit one of my sites with a Windows computer equipped with a standard Microsoft mouse with default settings you would agree that scroll-wheel zooming is ridiculously frustrating. It is trivial to disable that feature in the code, except that has to be done in four places located in three different files with every upgrade. The addition of a simple selection option on the Event Manager Option page would eliminate that problem, but you haven’t wanted to add it. It is not my position that you should add it. EME is your project and you should do whatever you think is best.
However, I also should do whatever I think is best. If you hadn’t added trailing slashes to URL links that would be one more thing I would have to patch each time to make EME usable in my applications. At some point patching becomes impractical and it is better to create a fork.
I apologize for seeming unfriendly or unappreciative for all the time you spend developing and supporting EME. That wasn’t my intention. I was merely stating my realization that having to apply yet another patch to each release was one too many.
Tue 15 Feb 2011 at 18:06 #45166AnonymousInactiveAs a newcomer to WP I want to thank you both for this informative discussion. Little or no acronyms and well constructed sentences have made it very easy to follow. So many topics in WP forums seem written in shorthand which I don’t understand and thus can’t learn from.
Franky, your responsiveness is wonderful and I’m grateful for it. You were most patient with my earlier(very basic) questions and got me going with this plug-in. Our website, http://www.firstparishbeverly.org has an events list on every page. The designated authors post timely information using EME-extended.
Thanks again for all your work.
Tue 15 Feb 2011 at 18:59 #45167FrankyKeymaster@admintiger: if it can be easily implemented, I’ll consider it. Mail me the changes if you please.
Mon 21 Feb 2011 at 09:41 #45168AnonymousInactivei have WP permalinks set to /%category%/%postname%/, EME v 3.3.1. can anyone post a step-by-step guide how to change ‘http://www.mydomain.com/events/?event_id=5’ for ‘http://www.mydomain.com/events/eventNAME’ ?
i try almost everything from this post but i don’t really know what i am doing wrong.
Thank you for your effort.
Mon 21 Feb 2011 at 10:44 #45169FrankyKeymasterIt’s in the trunk version, not in the released one
Mon 21 Feb 2011 at 13:24 #45170AnonymousInactiveWhen are you going to release this trunk version:-)?
Mon 21 Feb 2011 at 14:39 #45171FrankyKeymasternice try 🙂
There’s one small open bug report. When I finish that one, I’ll release.
Mon 21 Feb 2011 at 22:07 #45172AnonymousInactiveAnd how long will it take :)? week, month :)? I look forward so much.
Mon 21 Feb 2011 at 23:11 #45173FrankyKeymasterWell … the bug is fixed …
You might want to try out the latest trunk already, the code is stable:
http://downloads.wordpress.org/plugin/events-manager-extended.zip
If you do: please report back with your results!
Tue 22 Feb 2011 at 11:47 #45174AnonymousInactivei tried to install trunk, but an error was occured: “Fatal error: Only variables can be passed by reference in /home/pnky.ftp/public_html/wp-content/plugins/events-manager-extended/events-manager.php on line 173”.
what’s wrong?
Thank you, Franky!
Tue 22 Feb 2011 at 12:18 #45175FrankyKeymasterI’m guessing you didn’t replace all files … it runs just fine here
And of course: deactivate/activate is needed, and also check the setting “Events page”
Tue 22 Feb 2011 at 12:37 #45176AnonymousInactiveThat error displays, when i try to activate plugin.
First i deactivate plugin, delete all files, upload new ones and try activate.
The second try was: delete all files from server, upload trunk version, deactivate plugin (there was a note that i have to do it) and when i try to activate plugin, the same error.
i really don’t know what’s going on.
Tue 22 Feb 2011 at 13:14 #45177FrankyKeymasterHmmm … weird. Can you mail me an admin account? My mail: liedekef [at] telenet.be
Also: what version of php and WP are you using?
Wed 23 Feb 2011 at 19:10 #45178AnonymousInactiveIt works! i have WP 3.0.5! Thank you for czech language:)!! But i have problems. I have page “Udalosti” – “mydomain.com/udalosti” in original “Events” and when I go through this page on single event it make url like this “mydomain.com/events/1/event-name”. And another one problem is with widget calenar. When i go to single event through this calendar widget i make url like this “mydomain.com/udalosti/?calendar_day2011-02-23/. Is possible make url like “mydomain.com/udalosti/event-name” or “mydomain.com/udalosti/2011-02-23/event-name”?
Wed 23 Feb 2011 at 19:44 #45179FrankyKeymasterI’ll try to add the calendar_day thing (but without the name, because you can have more than one event on a day). But for now it’s “events” and “locations” as initial part … I’ll look into that later on.
Wed 23 Feb 2011 at 22:34 #45180FrankyKeymasterThe calendar thing is in trunk, and I’ve changed the code to use the translated word for “events” and “locations”. Please test out the latest trunk for this:
http://downloads.wordpress.org/plugin/events-manager-extended.zip
Thu 24 Feb 2011 at 13:36 #45181AnonymousInactiveNice, man:)! But still bugy in czech language:(. I have page “udalosti” (czech) = “events”. When I go to the single event through calendar widget it makes URL “mydomain.cz/udalosti/2011-02-24/ but it is 404 error page and when i rewrote “udalosti” in this url to “events” = “mydomain.cz/events/2011-02-24/ it worked! And next bug: when i go to single event through page Udalosti it makes URL “mydomain.cz/udalosti/1/event-name/” and appear 404 error page. If I rewrote “udalosti” to “events” = “mydomain.cz/events/1/event-name/” it worked again.
doesn’t help even if I rewrite the url of event page Udalosti from “mydomain.cz/udalosti” to “mydomain.cz/events”
Thu 24 Feb 2011 at 15:23 #45182FrankyKeymasterHmmm … I think I know where this problem is located, I”l try to fix it asap
Thu 24 Feb 2011 at 15:25 #45183FrankyKeymasterCould you try this change in events-manager.php:
Thu 24 Feb 2011 at 15:44 #45184AnonymousInactiveSUPER 🙂 thanks man! It works!!
Fri 25 Feb 2011 at 09:19 #45185AnonymousInactiveI have one question Frank. Is possible show page of locations? I mean page with only names of locations.
Fri 25 Feb 2011 at 09:23 #45186FrankyKeymasterSee [locations_map] shortcode (it adds the map though)
Fri 25 Feb 2011 at 10:28 #45187AnonymousInactiveThanks, sorry my mistake :)!
Sun 27 Feb 2011 at 12:16 #45188AnonymousInactiveFranky I have the problem with url again. I updated to newest version of EME and when I go to the single event through calendar widget it makes URL “mydomain.cz/udalosti/2011-02-24/ but it is 404 error page and when i rewrote “udalosti” in this url to “events” = “mydomain.cz/events/2011-02-24/ it worked! And next bug: when i go to single event through page Udalosti it makes URL “mydomain.cz/udalosti/1/event-name/” and appear 404 error page. If I rewrote “udalosti” to “events” = “mydomain.cz/events/1/event-name/” it worked again.
I tried to fix it again with this stuff -> http://plugins.trac.wordpress.org/changeset/350487 but it doesn’t work :(! I have to use NOPERMALINKS settings, that works.
I tried to downgrade to older version but it doesn’t work too :(!
Can you help me?
Sun 27 Feb 2011 at 17:10 #45189FrankyKeymasterThe your version is wrong, because this change is now in released 3.3.2 code (not in older versions)
Also: try disable/enable the plugin or go into the SEO settings, change SEO settings to default, press “save”, change SEO settings back and press “save” again.
Sun 27 Feb 2011 at 17:36 #45190AnonymousInactiveI have the most newest version:-D! But it works only with nopermalinks urls… When i switch the permalinks on it is buggy – plugin generate url “mydomain.cz/udalosti/1/event-name/ but it is 404 error page, if i rewrote “udalosti” to “events” it worked. Which SEO settings do you mean? I tried disable/enable 20x.
But i can’t understand why it didn’t work when i uploaded on server older version of EME which worked before.
Sun 27 Feb 2011 at 18:06 #45191FrankyKeymasterTry the trunk version (and disable/enable the plugin):
http://downloads.wordpress.org/plugin/events-manager-extended.zip
With SEO settings I mean the permalinks settings in WordPress itself.
Sun 27 Feb 2011 at 18:18 #45192AnonymousInactiveto mettzed,
i think, the problem is, that you need to “save settings” in “settings > permalinks” in wordpress again.
[skus znova ulozit zmeny pod “natavenia > trvale odkazy” v samotnom wordpresse. mne to v tomto pripade pomohlo].
Sun 27 Feb 2011 at 18:45 #45193FrankyKeymasterIt seems WP is very confusing. In the WP general settings page, you have:
WordPress address (URL)
Site address (URL)
but “Site address” corresponds to the function “home_url()” and “WordPress address (URL)” to the “site_url()” function. I was under the wrong assumption that I needed to use “site_url()”, but it needs to be “home_url()” as base for generating pretty links. Most of the time these two are the same, but not always. So I updated the code to use “home_url()” and advise those with permalink problems to update to trunk and try again:
http://downloads.wordpress.org/plugin/events-manager-extended.zip
Sun 27 Feb 2011 at 20:47 #45194AnonymousInactiveI’m at college and i can’t join to my ftp:( but i tried “save” permalink in wordpress and it works :)!
Sun 27 Feb 2011 at 21:52 #45195AnonymousInactiveFranky, thank you for the great plugin and all your time and efforts. After spending half of my Sunday trying to figure out why it wasn’t working for me and perhaps a few others is because I had my “events page” as a child page versus setting it as (no parent) to follow your new permalink setup which is http://www.domain.com/events/(id)/(name).
Mon 28 Feb 2011 at 01:43 #45196AnonymousInactiveI have downloaded and uploaded to revert to the trunk as suggested by Franky but now instead of going to /?event_id=7 (as it did originally) it is going to /events/7/masterclass-on-survey-design-%E2%80%93-customer-feedback-for-small-business-sydney/
How can I get it to either do both or to revert to doing what it used to do?
Mon 28 Feb 2011 at 02:58 #45197AnonymousInactiveAnd now it is not showing up anywhere….
Currently neither http://events.triberesearch.com.au/?event_id=7
nor
work… They both return to the event calendar page…
Mon 28 Feb 2011 at 05:02 #45198AnonymousInactiveHaving played with the settings so that the static page is different to the page used by the Events Cal with an auto redirect, the event does show at http://events.triberesearch.com.au/?page_id=3&event_id=7 but not at http://events.triberesearch.com.au/?event_id=7
It is very important to get to original link working. Would love some suggestions please.
Cheers
Mon 28 Feb 2011 at 08:10 #45199AnonymousInactiveand there seems to be no way to use the static home as the events page any more. Look forward to a solution….
Cheers in advance
Mon 28 Feb 2011 at 08:21 #45200FrankyKeymasterVery weird … can you mail me an admin account so I can check things out? My mail: liedekef [at] telenet.be
Mon 28 Feb 2011 at 09:20 #45201AnonymousInactivedone
Mon 28 Feb 2011 at 10:57 #45202AnonymousInactive1/2 happy that it is taking time, as otherwise I would have thought it was a simple setting I missed…
Let me know if you have any questions Franky. Cheers for the assist
Mon 28 Feb 2011 at 11:07 #45203FrankyKeymasterMailed some stuff already: the special events page should not be used as home/front page, that’s the first of it. It seems to be working just fine now, but you need to adjust your theme so the homepage shows something sensible as well.
Mon 28 Feb 2011 at 12:00 #45204AnonymousInactiveThanks for the emails. I have looked at a few of the options, but the calendar was working fine as the home/front page until Friday last week. hoping to get it back to that state….
Shall let you know if I succeed…
Mon 28 Feb 2011 at 22:51 #45205AnonymousInactiveFound a patchwork solution. Ended up changing the events page to /events/ and then getting the start page to auto redirect to it, and then installed an app to redirect all of the old links to the new location. Very janky…. but it works….
Annoying that the old system doesn’t work, as it was much cleaner, but such is life I guess…
If you ever do upgrade it again and put back in that you can use the events cal as your start/home page, please let me know.
Regards
Mon 28 Feb 2011 at 23:05 #45206FrankyKeymasterI’m not quite sure when that (special page as home page) changed (according to me, it should’ve never worked so for). I always advise people to never directly use the special events page (in their menu, as home page, etc …)
Fri 25 Mar 2011 at 12:40 #45207AnonymousInactiveHi, Franky!
Thanks for a great plugin!
I have a question about permalinks.
My site is in russian language and permalinks in EME now look like this:
This is not very nice to see such URLs and I’m deciding what to do:
1. Try cutting event name from the permalink and make following structure:
Is it possible?
2. Suggest you to make custom permalink field for every event. This will help people like me to translate russian urls into english manually.
Is it possible?
Sorry for my English 🙂
For information:
I have following permalink structure configuration in WordPress:
Fri 25 Mar 2011 at 12:44 #45208FrankyKeymasterIn fact, everything after the ID-number is ignored, so this both works:
http://domain.ru/events/%id%/blabla
There’s already a feature request for custom permalink field per event, so it will happen (I hope to include this for the next version)
Fri 25 Mar 2011 at 13:14 #45209AnonymousInactiveI tried to open URL without postname
like this
but it opens my events list 🙁
Sun 27 Mar 2011 at 18:16 #45210AnonymousInactiveHello Franky,
is it possible change special letters in foreign languages in permalinks?
in browsers address bar:
http://domain/events/id/malé-veľké-svety/
but after copy/paste:
http://domain/events/id/mal%C3%A9-ve%C4%BEk%C3%A9-svety/ <- and this is not seo friendly, you know
solution, special letters changed, without diacritical mark [graphic accent]: http://domain/events/id/male-velke-svety/
i don’t know where the mistake is but i have in “settings – Events format – Single event page title format” written “#_NAME” but it is not shown in title of single event page.
Thank you!
Sun 27 Mar 2011 at 19:03 #45211FrankyKeymasterI just found out that WP changed behaviour in 3.1 … I used the function “sanitize_title_with_dashes” to create the permalink, but it no longer replaces the accents correctly in 3.1 … sigh …
I fixed it in trunk now:
Sun 27 Mar 2011 at 19:12 #45212AnonymousInactiveGreat!
Thank you a lot.
Can i ask another question?
i don’t know where the mistake is but i have in “settings – Events format – Single event page title format” written “#_NAME” but it is not shown in title of single event page.
Sun 27 Mar 2011 at 20:44 #45213FrankyKeymasterProbably your theme doesn’t show the title, or the CSS is hiding it …
Tue 29 Mar 2011 at 05:46 #45214AnonymousInactiveHello,
very interesting, because if i switched to twenty ten theme, it’s the same as in my present theme. title of post is displayed in title of page but title of event is not. i tried almost everything.
Tue 29 Mar 2011 at 07:37 #45215FrankyKeymasterHmmm … then I would like to ask if I can have a temporary admin account to check things out: liedekef@telenet.be
Tue 29 Mar 2011 at 08:53 #45216FrankyKeymasterIn your theme, the call to “the_title();” happens outside the loop in one-page.php. Don’t do this. See this (info in twentyten theme): http://codex.wordpress.org/The_Loop
That’s the reason why in this page: http://www.pnky.sk/podujatia/114/z-tvorby-majstra-mikulasa-klimcaka/ the title still shows as “Podujatia v Piešťanoch”
Sat 23 Jul 2011 at 10:12 #45217AnonymousInactiveHello,
i want to ask, Franky, if is it possible to have permalinks like this:
http://domainname/events/single-event-name
thanks for your great work.
Sun 24 Jul 2011 at 10:02 #45218FrankyKeymasterThis is not possible since you can have more than one event with the same name. ..
-
AuthorPosts
- The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.