Enhancement - Labels #6

Closed
opened 2016-05-20 19:13:29 +00:00 by mwweb · 3 comments
mwweb commented 2016-05-20 19:13:29 +00:00 (Migrated from github.com)

I like the idea behind creating one field, for example Name, and being able to reuse that field in all views. It would make it convenient having the same naming convention throughout the code.

However, in a component that I am working on, I could have the database field the same in all my views, but I would like to have different Labels on each view. For example, if I had 2 tables: States and Cities. In states I might want name to be State Name, and in cities the label would be City Name.

It would be nice if it was possible to have custom labels when adding the fields to the views. That way I could use Name, but input a custom label, and that label would be compiled into the language files for that view. But, if the field is empty, then the label in the field itself would be used.

I like the idea behind creating one field, for example Name, and being able to reuse that field in all views. It would make it convenient having the same naming convention throughout the code. However, in a component that I am working on, I could have the database field the same in all my views, but I would like to have different Labels on each view. For example, if I had 2 tables: States and Cities. In states I might want name to be State Name, and in cities the label would be City Name. It would be nice if it was possible to have custom labels when adding the fields to the views. That way I could use Name, but input a custom label, and that label would be compiled into the language files for that view. But, if the field is empty, then the label in the field itself would be used.

This is not posible at this time. Has been in review a few times but since the implementation is intense, we left it. Here is what you can do for now. Create the field as normal, then after first save, use copy to duplicate the same field not changing the name only the label. So you will have a few fields with different labels but the same name/code. You know that only the field details in the xml area is used, so you can change the field "name" field to be descriptive of your intent. Just be sure to leave the name field in the xml area unchanged. Hope this helps.

This is not posible at this time. Has been in review a few times but since the implementation is intense, we left it. Here is what you can do for now. Create the field as normal, then after first save, use copy to duplicate the same field not changing the name only the label. So you will have a few fields with different labels but the same name/code. You know that only the field details in the xml area is used, so you can change the field "name" field to be descriptive of your intent. Just be sure to leave the name field in the xml area unchanged. Hope this helps.
mwweb commented 2016-05-20 19:51:55 +00:00 (Migrated from github.com)

That's basically what I did. The project that I am working on is a Joomla! Real Estate component that I took over a little over a year ago when the developer just disappeared. I forked the project, and am now rebuilding the component from the ground up, since there are pieces that aren't working in J!3.5, and when using the JED checker it reports that there is a lot of depreciated code, likely since the developer made it 2.5 and 3.x compatible.

That's basically what I did. The project that I am working on is a Joomla! Real Estate component that I took over a little over a year ago when the developer just disappeared. I forked the project, and am now rebuilding the component from the ground up, since there are pieces that aren't working in J!3.5, and when using the JED checker it reports that there is a lot of depreciated code, likely since the developer made it 2.5 and 3.x compatible.

Sounds interesting, all the best. Let me know if you get stuck.

Sounds interesting, all the best. Let me know if you get stuck.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#6
No description provided.