Feature Request - automatic alias building #246
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#246
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
One thing that I find I'm often doing is manually modifying the building of the alias field.
This is usually due to the fact that I need to create a 'compound' (or 'concat') alias, based on a couple/few fields (the most common is that of first/last name for people records).
I'm still not quite up to actually digging under the hood of JCB and actually suggesting a change in code myself, but wondering if this is something that others might be interested in as well.
If I were to have time to create this code, I'm not quite sure where it would go. Not sure if it would go into the Fields system or within the Admin view or exactly where?
What do others think about this?
I, too, had to do this on a component. I added custom code, but it would have been nice to have the ability to have the alias field created in jcb with field(s) that i set in the field.
There is already some automation with the alias, but to effect the build from within JCB does not exist at this point.
I can give you insight on where it is being build, also where in the actual component the code is found that deals with alias.
So you will see two functions at work:
$this->generateNewTitle()
native function of AdminModel.php#L895$this->_generateNewTitle()
Build in JCBOkay in JCB:
$this->_generateNewTitle()
)This functions are all found in the model of the view, so in Sermon Distributor for example you can find it in sermon.php#L1081
So those are the areas that would need to be adapted to automate this. One idea would be to in the admin view be able to select multiple fields (that is part of that admin view) to dynamic build alias if left empty.
This will not be that hard to achieve 👍
Please, test the feature. You will see in the admin view-tab->Fields & Conditions there are new buttons, that will show if the admin view has an alias set.
With these new fields:
Alias Builder Type
Alias Builder
You can select any of the other field in the view, to be used to build that alias. (ONLY TEXT FIELDS)
Please give me your feedback!
I have also tested this, and it seems all good 😄
This seems to work as designed; however, for my specific needs (in a number of different cases) I actually need to build even more complex alias that can't rely on just text fields like this. So, I guess for those cases I'll just stick with the overrides; however, this does solve about 75% of the instances that I have (esp. when I just have the name field with something other than 'name' for the field name).
Thanks!
One step at a time.... we can grow this. It is a start.