Page MenuHomePhabricator

having SF display an 'alias' value in autocompletion
Closed, ResolvedPublic

Description

Author: matrix.has.neo

Description:
Overview:

I have a structure with Folders and Items where each folder could have sub-items and sub-folders. I need a way to have autogenerated page names for these entities since there could be folders or items with the *same* name in the hierarchical structure.

The issue is that when I want to change the parent of these items to a different value, all the values in the autocomplete are page names. These have no meaning for the end-user(e.g. Folder1, Folder 2, etc.). The [[Property::name]] of each of these pages should be displayed in the list instead - e.g. Folder 1.name=Books.

Steps to Reproduce:

I have used the SF(SemanticForms) to automatically generate page names for each folder/item, thus having Folder 1, Folder 2, ...., Folder n and Item 1, ..., Item n.

Each Folder/Item has a [[name::]] property and a [[parent::]] property.

Actual Results:

Since the page names of these folders/items are automatically generated, when editing the SemanticForm for a folder/item, I'd see a list of page names(which are automatically generated thus have no meaning for the end-user).

Expected Results:

There should be a way to display the values from the [[name::]] property for each target page in the autocomplete values.


Version: unspecified
Severity: enhancement

Details

Reference
bz23557

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:04 PM
bzimport set Reference to bz23557.

I'm not fully sure I understand the data structure here, but can't you use "autocomplete on property=name" in the relevant field(s)?

matrix.has.neo wrote:

I'm not sure the "autocomplete on property" would solve my case. The data structure is like this:

I have:

Category:Folder which contains autogenerated folders that look like:

  • Folder 1 [[Name::a name for this folder]]
  • Folder 2 [[Name::other name for this folder]]

Category:Item which contains autogenerated items that can be children of those folders like:

  • Item 1 [[Name::the same name for this item]] [[Parent::Folder 1]]
  • Item 2 [[Name::the same name for this item]] [[Parent::Folder 2]]

As it can be seen, I have two items that have the same name and coexist in two different folders - this is a use case I need.

My issue is that I want to edit with Semantic Forms the <Item 1> and in the parent field's autocomplete list I want to see:

"Folder 1 - a name for this folder"
"Folder 2 - other name for this folder"

Then, I could select one of these and in the backend, the Semantic Forms would write [[Parent::Folder 1]] if I choose "Folder 1 - a name for this folder" from the list.

The idea is that I don't want these folders to be categories because I need them to be included in SMW {{#ask:...}} queries, so a structure with Category:Folder1 and Category:Folder2 wouldn't fit the design.

This is just an example very similar to the data structure I have which is more complex to express.

(In reply to comment #2)
Probably http://www.mediawiki.org/wiki/Extension:Semantic_Forms_Inputs#Menuselect is what you need?
It displayes a menu structure and is able to show one value (property Name) while returning another (actual article name).

  • Bug 32891 has been marked as a duplicate of this bug. ***

I'm unable to get SF working due to bugs that have been hard to troubleshoot (like bug 33424 and bug 33832). Once I'm able to get SF working smoothly, I'll test the menuselect feature of SFI to evaluate if this bug is ready to be closed.

Yaron_Koren claimed this task.
Yaron_Koren subscribed.

Marking as "resolved"; feel free to re-open.