Rename labels
Rename labels
Hi,
maybe someone has a code how to rename field labels easily in the hooks?
Many thanks! Kai
maybe someone has a code how to rename field labels easily in the hooks?
Many thanks! Kai
Re: Rename labels
Hello Kai,
I assume you realize that the AppGini interface allows you to specify the UI label when defining each column of a table.
I have some logic that requires to potentially change the label dynamically based on input. I have done this using the AppHelper library in a tablename-dv.js script, but I suspect it could be in the tablename_dv hook in a script block. I have
Hope that helps.
~Paul
I assume you realize that the AppGini interface allows you to specify the UI label when defining each column of a table.
I have some logic that requires to potentially change the label dynamically based on input. I have done this using the AppHelper library in a tablename-dv.js script, but I suspect it could be in the tablename_dv hook in a script block. I have
Code: Select all
var fieldname = "l_name";
new AppGiniField(fieldname).label("Last Name");
~Paul
- landinialejandro
- AppGini Super Hero
- Posts: 126
- Joined: 2016-03-06 00:59
- Location: Argentina
- Contact:
Re: Rename labels
hi! other way is in your tablename.php in hooks folder, inside the init function write this:
if you have a tv with 4 cols.
Code: Select all
$options->ColCaption = ['fname1', faname2', 'NEWfname3', 'fname4' ];
Alejandro.
AppGini 5.98 - Linux OpenSuse Tumblewweed.
Some of my posts that may interest you:
Landini Admin Template: Template for Appgini like AdminLTE
Profile image plugin: add and changue image user profile
Field editor in table view: Configurable fast edit fields in TV
my personal page
AppGini 5.98 - Linux OpenSuse Tumblewweed.
Some of my posts that may interest you:
Landini Admin Template: Template for Appgini like AdminLTE
Profile image plugin: add and changue image user profile
Field editor in table view: Configurable fast edit fields in TV
my personal page
Re: Rename labels
Thank you very much for the help.
Unfortunately, I cannot use the AppHelper library with my customers.
I have tried the tip from Alejandro
But unfortunately I get only a blank page.
The code is:
I have 6 cols.
Thanks again and many greetings, Kai
Unfortunately, I cannot use the AppHelper library with my customers.
I have tried the tip from Alejandro
But unfortunately I get only a blank page.
The code is:
Code: Select all
function Documents_de_init(&$options, $memberInfo, &$args){$_SESSION ['tablenam'] = $options->TableName;
$_SESSION ['tableID'] = $options->PrimaryKey;$tableID = $_SESSION ['tableID'];
$options->ColCaption = ['fname1', faname2', 'NEWfname3', 'fname4', 'fname5', 'fname6'];
return TRUE;
}
Thanks again and many greetings, Kai
Re: Rename labels
I have tested a bit more. it works for the table view but not for the detail view, print view etc. What else can I do?
thanks a lot, Kai
thanks a lot, Kai
Re: Rename labels
I googled and found that it looks to be pretty easy in JQuery, place in the tablename_dv hook in a script block
Code: Select all
$j("label[for='yourField]").text('NewLabel');
- landinialejandro
- AppGini Super Hero
- Posts: 126
- Joined: 2016-03-06 00:59
- Location: Argentina
- Contact:
Re: Rename labels
i think this is the best way.pfrumkin wrote: ↑2021-01-22 21:10I googled and found that it looks to be pretty easy in JQuery, place in the tablename_dv hook in a script block
Code: Select all
$j("label[for='yourField]").text('NewLabel');
the camption in DV are fix in template html, inside the templates folder. you can take a look there.
this is other way, rename inside this template tablename_tamplateDV.html.
but... way you don't change this caption in your project in appgini?
Alejandro.
AppGini 5.98 - Linux OpenSuse Tumblewweed.
Some of my posts that may interest you:
Landini Admin Template: Template for Appgini like AdminLTE
Profile image plugin: add and changue image user profile
Field editor in table view: Configurable fast edit fields in TV
my personal page
AppGini 5.98 - Linux OpenSuse Tumblewweed.
Some of my posts that may interest you:
Landini Admin Template: Template for Appgini like AdminLTE
Profile image plugin: add and changue image user profile
Field editor in table view: Configurable fast edit fields in TV
my personal page
Re: Rename labels
Hi, so many thanks for your help
This is what works for the detail view. Very good.
I put it in the .js file in /hooks.
However, this is still not the optimal solution. Something about the background. I have a few custom fields for the customer. he should be able to name the fields himself. Therefore I can't just change that in appgini.
I would prefer a file in which the user of the app can name the custom fields themself and these field names are then displayed throughout the app. Also in admin , search, filters .... basically like a language file.
custom1 = Color
custom1 = Height
custom1 = xyz
custom1 = ...
Many greetings, Kai
Code: Select all
$j("label[for='yourField]").text('NewLabel');
I put it in the .js file in /hooks.
However, this is still not the optimal solution. Something about the background. I have a few custom fields for the customer. he should be able to name the fields himself. Therefore I can't just change that in appgini.
I would prefer a file in which the user of the app can name the custom fields themself and these field names are then displayed throughout the app. Also in admin , search, filters .... basically like a language file.
custom1 = Color
custom1 = Height
custom1 = xyz
custom1 = ...
Many greetings, Kai
- landinialejandro
- AppGini Super Hero
- Posts: 126
- Joined: 2016-03-06 00:59
- Location: Argentina
- Contact:
Re: Rename labels
that my friend is not so easy to solve. If you need a self-configurable platform depending on your client, you will have to look for another type of solution.
for example it occurs to me that you edit the dv template, and in each fixed tag put for example <%% mylabelname %%>. then in the hook of the table in the init function, you already have the html processed. There you should make a function that replaces this <%% mylabelname %%> with your own customization. You can also do it with the rest of the things you want to configure.
for example it occurs to me that you edit the dv template, and in each fixed tag put for example <%% mylabelname %%>. then in the hook of the table in the init function, you already have the html processed. There you should make a function that replaces this <%% mylabelname %%> with your own customization. You can also do it with the rest of the things you want to configure.
Alejandro.
AppGini 5.98 - Linux OpenSuse Tumblewweed.
Some of my posts that may interest you:
Landini Admin Template: Template for Appgini like AdminLTE
Profile image plugin: add and changue image user profile
Field editor in table view: Configurable fast edit fields in TV
my personal page
AppGini 5.98 - Linux OpenSuse Tumblewweed.
Some of my posts that may interest you:
Landini Admin Template: Template for Appgini like AdminLTE
Profile image plugin: add and changue image user profile
Field editor in table view: Configurable fast edit fields in TV
my personal page
Re: Rename labels
Yes, agree with Alejandro, that is a much bigger problem. It's not clear from the description of the problem - is this to allow individual users to change their UI on the fly, or is there a specific experience to configure by group of users, say company?
I have built a rudimentary system in which based on company, it is a different experience. I didn't get into specific .css files for instance though this could probably be extended to allow for specific styles per company (I did not need). I suppose you could add logic in your .js file(s) to check for company membership and do specific things. What I'm proposing is not dynamic, requires developer configuration. Making this dynamic is too big an ask, IMHO.
~Paul
I have built a rudimentary system in which based on company, it is a different experience. I didn't get into specific .css files for instance though this could probably be extended to allow for specific styles per company (I did not need). I suppose you could add logic in your .js file(s) to check for company membership and do specific things. What I'm proposing is not dynamic, requires developer configuration. Making this dynamic is too big an ask, IMHO.
~Paul
Re: Rename labels
Hi,
just as an idea. Put the code in the tablename_dv hooks and create the javascript according to the settings of the customer. You could have a file per customer and load that, or have all stored in the database.
just as an idea. Put the code in the tablename_dv hooks and create the javascript according to the settings of the customer. You could have a file per customer and load that, or have all stored in the database.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Rename labels
Hi,
the app is installed on the customer's server. the users do not have to make any changes to the labels. the labels should be customized by the admin or system-admin during installation according to the customer's needs.
I have to think again. I am not a programmer either and can hardly do this myself. The best would be of course a table in which the field names of all labels are located and then we can define alternative field name labels there. best still multiple e.g. to adapt the labels to different languages. i find that is missing in appgini. i have a language file but must define the field names in appgini. so you can not build a multi-language app.
best would be a code for the tablename.php in the hooks with which someone can swap the field names.
the app is installed on the customer's server. the users do not have to make any changes to the labels. the labels should be customized by the admin or system-admin during installation according to the customer's needs.
I have to think again. I am not a programmer either and can hardly do this myself. The best would be of course a table in which the field names of all labels are located and then we can define alternative field name labels there. best still multiple e.g. to adapt the labels to different languages. i find that is missing in appgini. i have a language file but must define the field names in appgini. so you can not build a multi-language app.
best would be a code for the tablename.php in the hooks with which someone can swap the field names.
Re: Rename labels
True,
but you need to keep in mind what AppGini is currently. There is no "out-of-the-box" multilingual switching.
but you need to keep in mind what AppGini is currently. There is no "out-of-the-box" multilingual switching.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Rename labels
I know
I'm thinking about creating a database structure for each language and adding the corresponding languages via the navigation.
i.E.
table1_en
table2_en
table3_en
table1_en
table2_en
table3_en
But in the admin I have to see again everywhere all tables.
Thus with appgini for each language an app
I'm thinking about creating a database structure for each language and adding the corresponding languages via the navigation.
i.E.
table1_en
table2_en
table3_en
table1_en
table2_en
table3_en
But in the admin I have to see again everywhere all tables.
Thus with appgini for each language an app