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
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | linkit-profile-weights-2311957-4.patch | 2.55 KB | dsnopek |
Comments
Comment #1
anonIf they can link to both all the time, why not just have both node and file search plugins enabled in one profile?
Comment #2
jstoller@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.
Comment #3
alan d. commented+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.
Comment #4
dsnopekHere's a patch to implement.
I wasn't able to figure out how to add table drag to the table at
/admin/config/content/linkitbecause 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.
Comment #6
anonThanks for patch.
Comment #8
ciss commentedAs 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'.