How do I change the text for Add New button?
How do I change the text for Add New button?
I have a strange need to change the text for Add New button which you see at the top of a table view. I need to change this only for one table and not the whole application. I searched and searched and could not find where that button is defined. I appreciate any pointers you might have. Thanks much!!!
Re: How do I change the text for Add New button?
It's defined, as is the case with all the text in the users' area, in the "language.php" file .. Look for the line beginning with
But if you change it in there, you'd affect all tables .. so, to change it for just one table, you could make the change in the tablename_init() hook function for the concerned table:
Code: Select all
$Translation['Add New']
Code: Select all
// change the text value below
global $Translation;
$Translation['Add New'] = 'Add new text for this table only';

- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
Re: How do I change the text for Add New button?
Great!!! The hook solution is even better than hunting down the place where Add New is defined as it will persist future builds and updates. Wonderful. Thanks much for your help.
Re: How do I change the text for Add New button?
I use this method for a number of changes to really customize some of the screens etc. I also use a similar method on a 'settings screen' (as I call it) where the admin or others can change certain values relating to a number of factors.
This way there is no need to write a hook or change a hook. My 'hook' is done using a settings file for each member (think table in database). That way they can change things like # of items in the table view, play with some colours and much much more and it persists from session to session for them. For admin level people there are additional parameters they can set which affect the entire site.
My end goal is to not have to attend to the site by giving a certain level of control to end users/admins and getting out of the picture. When I have time I will post my code for the setting file system I am using. (Not sure when that will be as I am very busy umpiring baseball right now and other summer type of stuff).
Alan
This way there is no need to write a hook or change a hook. My 'hook' is done using a settings file for each member (think table in database). That way they can change things like # of items in the table view, play with some colours and much much more and it persists from session to session for them. For admin level people there are additional parameters they can set which affect the entire site.
My end goal is to not have to attend to the site by giving a certain level of control to end users/admins and getting out of the picture. When I have time I will post my code for the setting file system I am using. (Not sure when that will be as I am very busy umpiring baseball right now and other summer type of stuff).
Alan
Calgary, Alberta, Canada - Using Appgini 5.50 -
Re: How do I change the text for Add New button?
That sounds like a very interesting idea, Alan ... I'll consider adding some variation of this in the next release.

- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
Re: How do I change the text for Add New button?
Ahmad
I would suggest allowing the following for all users (this is based upon my users feedback). I do this per table - this may seem huge but is not as the average user does not get to see all the tables anyway.
1. time out before being auto logged out - I allow them to pick any number between 10 minutes of no activity to 60 minutes
2. # of items shown in the table view
3. new record either on separate or same page under table view
4. Sorting of table view items by a limited set of columns and either asc or desc. (I usually give them 3 auto sort choices for the table view)
5. Highlight colours - can never please everyone so this way they can pick
6. Records per page in table view
For admins:
Basically most options which can be set by changing a setting in the your_tablename_view.php file and others. I even have settings changes for some of the premade text as found in language.php file. ($Translation)
It may seem daunting with a lot of options but a lot of them are set and forget. If they are not set the default values apply.
On another note I have just about finished my tracking system. This tracks record changes table by table and by user so that it can be determined who changed what and when in case the need comes up to know such information. You can then view an entire list of who made what changes to what table data and when etc. Is more than just data modified and by what user.
Alan
I would suggest allowing the following for all users (this is based upon my users feedback). I do this per table - this may seem huge but is not as the average user does not get to see all the tables anyway.
1. time out before being auto logged out - I allow them to pick any number between 10 minutes of no activity to 60 minutes
2. # of items shown in the table view
3. new record either on separate or same page under table view
4. Sorting of table view items by a limited set of columns and either asc or desc. (I usually give them 3 auto sort choices for the table view)
5. Highlight colours - can never please everyone so this way they can pick
6. Records per page in table view
For admins:
Basically most options which can be set by changing a setting in the your_tablename_view.php file and others. I even have settings changes for some of the premade text as found in language.php file. ($Translation)
It may seem daunting with a lot of options but a lot of them are set and forget. If they are not set the default values apply.
On another note I have just about finished my tracking system. This tracks record changes table by table and by user so that it can be determined who changed what and when in case the need comes up to know such information. You can then view an entire list of who made what changes to what table data and when etc. Is more than just data modified and by what user.
Alan
Calgary, Alberta, Canada - Using Appgini 5.50 -
Re: How do I change the text for Add New button?
Great discussion! Can't wait to see Alan's code and/or Ahmad's changes. Thanks much to both of you!!!
Re: How do I change the text for Add New button?
I need to change the "Save New" on The Detail View (Form Page), where would I do that? I only need it on certain pages not globally. Any help would be greatly appreciated.
Thanks
Michael
Thanks
Michael
Re: How do I change the text for Add New button?
Any way to get the same label change done for the Add New button on a child table?
Re: How do I change the text for Add New button?
The Child table uses the same Tablename-dv.js as if would the the standalone table. So you can add your code there.
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: How do I change the text for Add New button?
For some reason, it's not changing the existing Add New button's label for the child table when I add the following in the tablename_init() function in the hook php file...
global $Translation;
$Translation['Add New'] = 'Add new text for this table only';
global $Translation;
$Translation['Add New'] = 'Add new text for this table only';
Re: How do I change the text for Add New button?
Hi,
you need to use the translation for Save New, not Add New
$Translation['Save New'] = 'Add new text for this table only';
you need to use the translation for Save New, not Add New

$Translation['Save New'] = 'Add new text for this table only';
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: How do I change the text for Add New button?
I tried $Translation['Save New']. While a subsequent window that shows up after pressing the "add new" button shows the text properly, I am still not able to change "Add New" button that shows up for the child table.
Re: How do I change the text for Add New button?
ok, if you are looking for the Add New at the child table, this can only be changed dynamically via the tablename-dv.js (warning, the child table is loaded afterwards, so you need to wait until is show up before update.
As alternative you could also edit each templates/children-TABLNAME.php file where TABLENAME is the name of the child table. In there you search for the $Translation['Add New'] and replace it with whatever suits you. !! Warning, this file gets overwritten once you regenreate your application.
As alternative you could also edit each templates/children-TABLNAME.php file where TABLENAME is the name of the child table. In there you search for the $Translation['Add New'] and replace it with whatever suits you. !! Warning, this file gets overwritten once you regenreate your application.
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.