Problem/Motivation

I have two linkit profiles: one for linking to "pages" (i.e. nodes) and one for linking to "documents" (i.e. file entities). 99% of the time my users will be linking to pages, however, the documents profile is always selected by default. This creates a serious usability problem.

Proposed resolution

Add a weight column to the {linkit_profiles} table and allow reordering of profiles on the module's configuration page. Then use this weight to order the profiles wherever they are used.

Remaining tasks

Do all the things.

User interface changes

The table at /admin/config/content/linkit will become a draggable table and a button to save the profile order will need to be added. This order will also be reflected in the profile list within the Linkit dialog on edit forms.

API changes

None anticipated

CommentFileSizeAuthor
#4 linkit-profile-weights-2311957-4.patch2.55 KBdsnopek

Comments

anon’s picture

If they can link to both all the time, why not just have both node and file search plugins enabled in one profile?

jstoller’s picture

@anon: Because 99% of the time they will be linking to pages, so I don't want to clutter up the search results with documents. In the event they need to link to a document I want them to be deliberate about it.

alan d.’s picture

+1, sometimes it is nice to separate these.

Order appears random, I get the default, then my first custom one for files. Aim was to default to file links (95% of links would be files) followed by the default profile second.

So I disabled the default and added a 2nd profile and this was inserted first, before the files profile and the disabled default still showed, so I had to revert to the default with two search plugins.

So wish-list would be either weighing on the profiles, or to have a default active profile.

dsnopek’s picture

Status: Active » Needs review
StatusFileSize
new2.55 KB

Here's a patch to implement.

I wasn't able to figure out how to add table drag to the table at /admin/config/content/linkit because of the filtering and sorting on that page. In order to make a draggable table, the items would always need to be sorted by weight, and they'd all have to always be visible (ie. with no filtering). I've never had enough profiles to really make filtering and sorting of profiles visible, but removing that functionality (if done) should probably be done in a different issue, since it's only tangentially related.

So, I punted on that, and just put a simple weight widget when editing individual profiles.

  • anon committed 542ad17 on 7.x-3.x authored by dsnopek
    Issue #2311957 by dsnopek, anon: Add weights to linkit profiles
    
anon’s picture

Status: Needs review » Fixed

Thanks for patch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ciss’s picture

As already mentioned in another (wrong) issue, the update hook 7305 in this commit causes SQL errors when updating from schema version < 7303. Bug report is #2842804: Error in linkit_update_7303: Unknown column 'weight' in 'field list'.