Adding permalink support to Connections has presented some interesting challenges to overcome since there is an established user base using it in a variety of ways that had to be taken in to account.
First, everyone on the next upgrade will be required to choose a target page. Target home page, huh? Read on…
A target home page for the permalink must be defined. This will be the page where you used the [connections] shortcode. If you have used it on more than one page, you will have to choose one page to be the target home page. The target page will be used when:
- The new “View” link on the Connections : Manage admin page.
- All widgets in the forthcoming “Widget Pack”.
Why? Because rules have to be written on how to process the permalink and adding support for posts and custom post types make writing these rules very difficult, so I am concerned with inadvertently clashing with other permalink rules. Limiting support to pages only simplifies this greatly. Maybe a future version of Connections will address this limitation.
What does this mean to you? For most, I suspect, nothing, since the most common use case for Connections is displaying a directory on a single page. When the shortcode is used on a page, the permalinks will redirect to the current page. They will not be redirected to the target page. This is the behavior that I think most will be expecting because this is how all current premium templates function when choosing a category or advancing to the next page of results.
With this said, I expect most will simply select their current directory page as the target page.
What can you expect with permalink support?
- For all templates, default and premium, the name will become a link. Clicking on that link will redirect to the same page, but showing only the entry that was clicked using the same template. You’ll be able to use that link in email, IM and such to link to that specific entry.
- Permalink support for vCards, an often requested feature.
- Direct link to the individual entry on the frontend from the Connections : Manage admin page.
- Premium templates will be updated to include permalink support for the pagination links.
One last thing — Just like the WordPress category and tag permalink base can be customized, so can those for Connections. The screen capture shows the available options.
KEY
- pagename = the page slug created by WordPress when adding a page. This will be the target home page.
- region = province/state
- locality = city
- ? = search query term(s)
- %name% = the category name / region name / locality name / postal code
- %page% = if the template supports pagination
Supported Permalinks
- pagename/landing [reserved for future use]
- pagename/category/%name%/?
- pagename/category/%name%/pg/%page%/?
- pagename/category/%name%/country/%name%/?
- pagename/category/%name%/country/%name%/pg/%page%/?
- pagename/category/%name%/country/%name%/region/%name%/?
- pagename/category/%name%/country/%name%/region/%name%/pg/%page%/?
- pagename/category/%name%/country/%name%/region/%name%/locality/%name%/?
- pagename/category/%name%/country/%name%/region/%name%/locality/%name%/pg/%page%/?
- pagename/category/%name%/country/%name%/region/%name%/postal-code/%name%/?
- pagename/category/%name%/country/%name%/region/%name%/postal-code/%name%/pg/%page%/?
- pagename/category/%name%/region/%name%/?
- pagename/category/%name%/region/%name%/pg/%page%/?
- pagename/category/%name%/locality/%name%/?
- pagename/category/%name%/locality/%name%/pg/%page%/?
- pagename/category/%name%/postal-code/%name%/?
- pagename/category/%name%/postal-code/%name%/pg/%page%/?
- pagename/country/%name%/?
- pagename/country/%name%/pg/%page%/?
- pagename/country/%name%/region/%name%/?
- pagename/country/%name%/region/%name%/pg/%page%/?
- pagename/country/%name%/region/%name%/locality/%name%/?
- pagename/country/%name%/region/%name%/locality/%name%/pg/%page%/?
- pagename/country/%name%/region/%name%/postal_code/%name%/?
- pagename/country/%name%/region/%name%/postal_code/%name%/pg/%page%/?
- pagename/country/%name%/locality/%name%/?
- pagename/country/%name%/locality/%name%/pg/%page%/?
- pagename/country/%name%/postal_code/%name%/?
- pagename/country/%name%/postal_code/%name%/pg/%page%/?
- pagename/region/%name%/?
- pagename/region/%name%/pg/%page%/?
- pagename/region/%name%/locality/%name%/?
- pagename/region/%name%/locality/%name%/pg/%page%/?
- pagename/region/%name%/postal_code/%name%/?
- pagename/region/%name%/postal_code/%name%/pg/%page%/?
- pagename/locality/%name%/?
- pagename/locality/%name%/pg/%page%/?
- pagename/postal_code/%name%/?
- pagename/postal_code/%name%/pg/%page%/?
- pagename/entry_slug/edit [reserved for future use]
- pagename/entry_slug/delete [reserved for future use]
- pagename/entry_slug/moderate [reserved for future use]
- pagename/entry_slug/detail [reserved for future use]
- pagename/entry_slug/vcard
- pagename/entry_slug/
- pagename/%directory_root%
Potential Future Additional Permalinks
- pagename/category/%name%/organization/%name%/?
- pagename/category/%name%/organization/%name%/pg/%page%/?
- pagename/category/%name%/organization/%name%/department/%name%/?
- pagename/category/%name%/organization/%name%/department/%name%/pg/%page%/?
- pagename/category/%name%/department/%name%/?
- pagename/category/%name%/department/%name%/pg/%page%/?
- pagename/category/%name%/last_name/?
- pagename/category/%name%/last_name/pg/%page%/?
- pagename/organization/%name%/?
- pagename/organization/%name%/pg/%page%/?
- pagename/department/%name%/?
- pagename/department/%name%/pg/%page%/?
- pagename/last_name/?
- pagename/last_name/pg/%page%/?
- pagename/last_name/first_name
- pagename/last_name/first_name/vcard
When is this version going to be available?
@David
I’ll be releasing an RC version within a few days — maybe even today. The RC will be released as a link on this site and not thru the usual upgrade. I want some brave souls to test it before releasing it to the world.
I have a decent site to test this on if you want that is not yet in production (http://floralparkvillage.org)
Let me know if you want me to get it installed.
@David
Sure, here’s a link to the RC: http://downloads.wordpress.org/plugin/connections.zip.
Do me a favor…
Before installing, change your image settings, all of them, on the Connections : Settings admin page. Record what you changed them to. Now update Connections. Did the settings stay after the update or did they go back to the default? Now you can change them back to what you want them to be.
Thanks!
finally got to do the upgrade and the image settings appear to have stayed the same after the upgrade and did not revert to the defaults
@David
Good to hear. That was my experience too.
Ok, it seems to be mostly working. The main issue I have is that if you do a permalink and try to select a new category it does not reset the page appropriately.
If you go here:
http://www.floralparkvillage.org/business-directory/
And then click on one of the entries to bring up the specific page. Then once you are on that page try to change the category and you will see that it stays on that page (at least it did for me).
Any ideas?
@David
Yep, I know exactly what the issue is. The new version of cMap resolves this … I hadn’t tested the existing templates yet for backward compatibility. There just is no solution for this. User will have to upgrade their template … That’s not really an issue since upgrades ares free, but that’ll be a support headache. Maybe I’m going to turn off having the name as a link and add an option in the settings to turn it on. I’m going to have to mull this over a little.
Sorry, found one more potential issue. We have a category hierarchy. I swear before the upgrade it used to show it that way. Now it seems to just be in some sort of random order.
@David
Actually it’s a simple CSS issue. The hierarchy is still there and the categories are in the correct order. They’ll all just left aligned. I’ve made a bunch of CSS changes — making the rules much more strict to help prevent theme’s from overriding the styles required by Connections. I’m going to have to loosen that rule a bit for backward compatibility.
I just uploaded a version with a bunch of minor fixes — I would download and install that version.
Thanks for testing!
What are the implications for a site like mine, http://www.essexdaysout.com which has separate pages which call Connections (see top menu items)?
@Mark
I’ve taken that into account. The permalinks will build based on the context in which they are used. So, what this means for you is that each of those separate top level pages, the names for each entry will become a permalink to that current page but will show only the specific entry when clicked. I hope that makes sense.
Hi there
I’m testing out the RC, and I’m getting this SQL error:
SELECT SQL_CALC_FOUND_ROWS DISTINCT wmq_connections.*, CASE `entry_type` WHEN ‘individual’ THEN `last_name` WHEN ‘organization’ THEN `organization` WHEN ‘connection_group’ THEN `family_name` WHEN ‘family’ THEN `family_name` END AS `sort_column`FROM wmq_connections WHERE 1=1 AND wmq_connections.visibility IN (‘public’, ‘private’) AND wmq_connections.status IN (‘approved’) ORDER BY sort_column, last_name, first_name
It shows both on frontend and in admin under the Manage
Thanks in advance
@Lui
Sorry, that’s not an error, but some debug code I left in. I just updated the RC. Grab the latest version.
Also, I did just find a bug … make sure to uncheck the “Login Required” option under the “General” tab on the “Connections : Settings” admin page.
Super! :-) … I’ll report back if anything else turns up. Other than that it seems to be functioning a ok
Hey Steven,
I know this feature took longer than you expected, thanks for your continued hard work.
I just downloaded the RC and put it on the sandbox. wow. I have tons of questions on this. Most of them I will just stumble through and figure out on my own so as to not sound totally stupid. :)
The homepage concept got me right from the start. Let me provide a usage scenario, and see what I would do different. Currently, on a standalone Page, I create some relevant content, then I put in a connections shortcode, for example:
[ connections id=348 enable_category_select=’FALSE’ enable_website_link=’FALSE’ enable_search=’FALSE’ enable_map=’true’ show_social_media=’true’ ]
this outputs the connections record for that individual company (id). I then add more content to the Page after the record, including some photos, video, etc, and call it a Page.
How will the new permalink structure effect such an application? Will I continue to use the shortcode as was structured?
What will that do if anything to my existing permalink for that Page if it is in a ( url.com/pageparent/pagechild ) structure? I found it throws 404’s unless that Page is/becomes a child of the new connections ‘homepage’.
And if I click on the permalink of the company name in record within this Page I have created, the URL changes from
/connx/testco-premier/
to
/connx/testco-premier/company/adventure-dental-pediatric-dentistry-and-orthodontics/ (which was the company record name)
Does that matter?
I know, too many questions, sorry, I’m just working to get my arms around this. :)
Thanks,
Mitch
@Mitch
I guess I need to start with — Currently the names are clickable in the RC, I’m going to have to disable that by default and only allow that to be enabled by templates via a shortcode option. I really didn’t want to release that way because I wanted that to be a standard feature, but I need to have better control over the user experience to limit the support requests and questions. And it’s you usage scenario that highlights the reason for the decision.
One other thing before I answer the questions. This might be a difficult concept, but the permalinks created by Connections for the entries — those page do not really exist. You never actually leave the page that you clicked the link on. Well, there four are exceptions. Two are, the “Widget Pack”, those links will always redirect to the page selected as the “directory home”. The same goes for the “View” link on the “Connections : Manage” admin page. The other two, if the shortcode is used on a post [not a page] and you’re viewing a list of blog posts or viewing an archive of blog posts such as a category archive or a date archive [really just another list of posts] those links will also redirect to the “directory home”. However, if you click thru to the actual post, those links well redirect to that post. Now the reason for this design is because you can use different options each time you use the shortcode and those options can still influence if you get a result or not and need to ensure that if you clicked on a link that you would get a result. I really did try to accommodate every usage scenario of the shortcode, but I may back track on that too and force all links to redirect to the “directory home”. Thoughts?
On to your questions…
“How will the new permalink structure effect such an application? Will I continue to use the shortcode as was structured?”
Yes, you can continue to use it just as you are. Actually since the names will now not be enable by default, you will actually not see any difference in use.
“What will that do if anything to my existing permalink for that Page if it is in a ( url.com/pageparent/pagechild ) structure?”
Can you share a link where this happens? I’m having a hard time visualizing the issue?
“Does that matter?”
Yes, actually, but that is exactly how it is supposed to work. Imagine if you set the “directory home” and have set shortcode options that make that entry not part of the results, you would actually get a “No Results” message. By redirecting to the actual page the link was clicked on I can ensure that that entry will be displayed. I really hope that makes sense.
Please ask away, questions will force me to think about how this will be used compared to the way I think it will be used.
” “What will that do if anything to my existing permalink for that Page if it is in a ( url.com/pageparent/pagechild ) structure?”
Can you share a link where this happens? I’m having a hard time visualizing the issue? ”
Sorry in advance for how long this is…
Sandbox is locked down, so I can’t show link with RC active, but here is what I mean:
I have Pages that I set up like this
http://www.clarkcountylive.com/go-local/automotive/northwest-auto-body
where url structure is parent / child(category) / child(companypage) You can actually look as that is a live link on our main site with connections.
I have child(category) page set up like this with *TWO* shortcodes:
A list of ‘Featured” [ connections department=’Featured’ order_by=’organization|SORT_ACS’ category=’52’ enable_search=’false’ enable_category_select=’false’ enable_note=’true’ enable_bio=’true’ ]
and then just below it, a list of ‘ALL in that category’ [ connections order_by=’organization|SORT_ACS’ category=’52’ enable_search=’false’ enable_category_select=’false’ enable_map=’true’ show_alphaindex=’false’ show_alphahead=’true’ enable_website_link=’true’ enable_note=’true’ enable_bio=’true’ ]
see: http://www.clarkcountylive.com/go-local/automotive
And then I have the child(companypage) where I have content above and below a connections record (created by shortcode with individual id) in this specific case: [ connections id=338 enable_category_select=’FALSE’ enable_website_link=’false’ enable_search=’FALSE’ enable_map=’false’ ]
see: http://www.clarkcountylive.com/go-local/automotive/northwest-auto-body
Three questions:
1) In the RC, when I click on the companyname link (in the individual record created by the ‘id=338’ shortcode, on what would be the ‘url/go-local/automotive/northwest-auto-body’ structured page), it refreshes the same content, but the URL changes to ‘url/parent/child/childcompany/%name%/nameofrecord
by way of example:’url/connx/automotive/nwauto/go-local/nwauto’ with the last two being %name%(category)/nameofrecord
This seems like a problem?
2) How am I going to be able to place that content (above and below the record) on the same page (with the individual record) that outputs from the new configuration of connections? (since that results ‘page’ for the record(s) doesn’t really exist).
3). How am I going to have ‘category’ pages, where all records with the common category are listed, with that Featured and ALL configuration, and content I place above/below on the same page?
Thank you very much for your guidance here. I have been really looking forward to these updates, but now I am consumed by fear that my entire structure will not work. :)
@Mitch
I think the short answer is — You’ve already created your page structure and as such already have your own permalink setup, you will not need the permalink feature of Connections.
Long answer —
1) That is exactly what I would expect because the permalinks for Connections will generate based on the context in which the entry is displayed. If it’s a page, it’ll build from the current page permalink.
2) Well, if you were using Connections to drive the entire structure of the directory, you would be able to place content above/below an entry.
3) Same, you wouldn’t be able to.
No fear. Your current setup will function exactly as it does now. I’ve made the change where the name is a link is off by default (for now) and can only be enabled by a template that has the option to enable it, such as the forthcoming cMap update.
With you usage scenario, you would simply leave this option off.
I hope that helps.
Hi Steven,
I continue to mess around with this new structure in a test site, way too many great things we can do. :)
Quick Q: When you edit the Organization name in a record, the system does not change the permalink, so /basepage/company/%name% looks for the wrong record and returns nothing.
What is the best way to have the edits made to Organizations’ names be properly reflected?
Thanks!
@Mitch
For now, there’s not a way to edit the slug. Well, you could, edit the slug in the db using phpMyAdmin or similar tool.
OK, I did go into phpmyAdmin and manually changed the slug for that record. Then the /basepage/company/%name% worked fine. Probably wouldn’t want to do it that way a bunch, but for limited edits of errors/typos it was fine.
Thanks!
@Mitch
It’s on the to do list to allow editing, similar to how you can do it when editing a page or post.
@Mitch
Fun fact, did you know Connections has been saving an entry slug for almost a year now? I implemented that feature last Labor Day week [released in mid-December] solely to eventually support the permalinks. Plan ahead, right?
I’ve upgraded to the latest version of Connections and Cmap, both of which my clients really love. Thanks! Here’s the thing, I have five different “Posts” with each displaying a different grouping of category entries. Without selecting a “directory home page” everything seams to be working as intended. Am I missing something? I used “posts” for other design considerations. Thanks.
@Eric
This usage scenario was taken into consideration which is why it still working as expected. The directory will only become more important is if you decide to use any of the widgets in the Widget Pack as all links will be to the selected directory home page.
Perfect, thanks for a great product!
Im needing the permalinks to be:
/the_contact_name
not
/category/name/the_contact_name
Did anyone figure this out ?
@David
This is already, sort off, the default permalink structure.
This is a single entry:
/name/the_contact_name
The name slug has to be used, but can be configured on the Connections : Settings admin page under the Advanced tab.
Here in this is the problem. I dont want anything in front of the the_contact_name .
Can we hack something to remove name and category from the permalink in class.rewrite.php
@David
There’s no way I know of around this. Part of creating rewrite rules is supplying a regex to WordPress on how to parse the incoming URL so it can build the proper query string. This is why there is the directory home page and URL slugs for Connection. This is the same reason WordPress itself uses the category/tags slugs. Same for custom post types.
There must be a way to remove the base. In wordpress we can remove the category base and have everything be site.com/page-name . I really dont like having site.com/category_name/name/page-name .
@David
Yes, technically, you can remove the category base slug but you can’t for tags and custom post types. But, like I said, I know no way around this requirement. If you remove the name base from the Connections permalink, WordPress will not know from the URL if you’re querying a category or a page rather than a Connections entry.