Updated 029 How to overwrite the custom fields (markdown)

Amigo 2019-07-09 08:16:54 +02:00
parent bf9282cbea
commit 19a4c845af
1 changed files with 4 additions and 2 deletions

@ -2,11 +2,13 @@
### Using Default Fields With Custom Code
It often happens that you would like to use some of the default fields differently than how component builder is actually implementing it. Now what is the default fields? [00:00:12](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m12s) If you go to add a new admin view or if you go to an admin view that already exists. You'd see that there is this little note above adding fields. It says that the ID, the asset_id, the state, the access, the ordering, the created_by, the date_created, modified_by, date_modified, checked_out, Check_out_time, version, hits, metakey, [00:00:41](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m41s) metadescription, and metadata is already added to the view. These are your default fields that always gets added to the view even if you don't create them. In fact you don't need to create them. I have seen that sometimes you might want to display some of these fields in a different area of the application. Currently the id field and the [00:01:20](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m20s) state field is the only field that is been shown by default in the list view.
It may happen that you would prefer to use some of the default fields in a different manner than that of Component Builder's way of implementation. What is the default fields? [00:00:12](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m12s) If you go to add a new Admin View or to an Admin View that already exists, it may be seen that there is this note above Adding Fields. It indicates that the 'ID', the 'asset_id', the 'state', the 'access', the 'ordering', the 'created_by', the 'date_created', 'modified_by', 'date_modified', 'checked_out', 'Check_out_time', 'version', 'hits', 'metakey', 'metadescription', and 'metadata' is already added to the view. [00:00:41](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m41s) These are the default fields that always gets added to the view even if you do not create them. In fact it is not necessary to create them. Sometimes you might want to display some of these fields in a different area of the application. Currently the ID field and the State field is the only field that is been shown by default in the List view. [00:01:20](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m20s)
* ### Example Of Shoen Default Fields in List view
Here you can see there is the id field and there is the state field and the ordering field. The ordering field doesn't show the order number you basically click on that button there(see video), then you can move them and order them [00:01:45](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m45s) All that is done by default. The other values are not displayed in the list view. I had a client once saying to me that they would like to actually see the date that something was created, and also by whom it was created. I had to adapt component builder so that those things can also be overwritten. And this is exactly what we've done. What we have done is if you create a field in component builder, as you would normally create a field and you give it [00:02:23](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m23s) any of these names, created by or created date, but exactly the same name. Then it actually will overwrite the default.
In the Experts area the 'Id field', the 'State field' and as well as the Ordering field are shown. The Ordering field does not show the order number. To be able to move and order it, click on that "Up/Down" button(see video),. [00:01:45](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m45s) All that is done by default. The other values are not displayed in the List View. Once a client requested that it should be possible to see the date on which something had been created as well as the identity of the person who created it. Component Builder then needed to be adapted so that those things could also be overwritten. What has been done is: If a field is created in Component Builder, as a field would normally be created and any of these names should be given to it, 'Created by' or 'Created date', but exactly the same name. [00:02:23](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m23s) Then it will overwrite the default.<<<<<<<<<<<
* ### Example Create_By Field In View