⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Change deafult text in search boxes in 'datatables' theme



Juanma

Juanma
  • profile picture
  • Member

Posted 12 September 2019 - 10:37 AM

SOLVED IN THE REPLIES

Hi!! First post here, currently working with Grocery Crud for my first database CRUD project ever!!

 

I'm so thankful for how helpful Grocery Crud is and how it is helping me learn a lot about this topic.

If everything goes well I'm looking forward to donate a bit after finishing my project to thank the creators of this helpful tool for their work.

 

Now on to the question:

I want to change the default text displayed on the search boxes of the Datatables theme.

Here's an image of what I'm talking about:

https://imgur.com/DVvZWNf

 

Where can I change this?

I would like it to display only the name of the column instead of "Search + $name_of_the_column".

 

Thanks for the help and have a nice day!!


Juanma

Juanma
  • profile picture
  • Member

Posted 13 September 2019 - 07:15 AM

Update:

I found the Datatables theme view PHP folder and there found the list.php file.

 

In there I found the line about the search boxes and saw that in the line 67 the class was "search_$column_name". Removed the "search_" but nothing changes in the actual view. I think that I'm editing the wrong thing but I'm into something, will post any updates.


Juanma

Juanma
  • profile picture
  • Member

Posted 13 September 2019 - 07:30 AM

I got it!! You have to edit the next files:

 

1. Go to assets/grocery_crud/languages/(selected language).

There duplicate the line 12 ($lang['list_search']) and name it 'list_search_box'.

Then delete whatever it says after the = and leave it like this ''; (Two '). In my case as I'm spanish it said 'Buscar'.

 

2. Go to /assets/groucery_crud/themes/datatables/views/list.php

There find the 'list_search' around line 67 and modify it so it is 'list_search_box'.

 

3. Save changes in both documents and done!!

 

Hopefully this helps someone.