Updated 5. Field Types 11 23 2018 Work in progress (markdown)
@@ -1,16 +1,16 @@
|
||||
If you have a good understanding of the Joomla! API you'll know it can build forms that can be used in a component; it's done using an XML file. Joomla! Component Builder builds the XML file and places it in a location a model, view and controller can access using the Joomla! API. JCB builds the fields which you define in a view containing the fields displayed by the component. These and other terms will be defined as we proceed. Let's start start with field types, then list and edit views using Joomla! articles.
|
||||
|
||||
+ [01:05](https://youtu.be/OhLzvThDXls?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=1m5s) **Field types** _Create Field Types Using basic joomla article to explain field types and their relationship within views_
|
||||
A field type is needed if you are building a field. Use of field types can be seen when you create a Joomla! article. When you do the first thing you see is called a view. Scroll down a bit and you'll see a URL displaying the view View = article and it's called an article view.
|
||||
A field type is needed if you are building a field. Use of views, field types, and fields can be seen when you create a Joomla! article. When you do the first thing you see is the view. Scroll down and you'll see a URL displaying View = article indicating this is the article view.
|
||||
|
||||
+ [01:57](https://youtu.be/OhLzvThDXls?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=1m57s) **List view** _Difference between list view and edit view. Plural and single_
|
||||
If you close this article view you'll see a list of articles created in the web site. You won't see any articles here if it's a blank website. The list of articles is also called a view. If you click on an row in the list you will see the edit or single view. Your components will usually have these two views in the admin area to list and edit your different data sets. Let's take a look at the views and the fields they display.
|
||||
|
||||
### All Fields Live In Views
|
||||
The Joonla! article title is a text field type; the alias is also a text field type. The editor block is a text editor field. There are others like list, radio, tag, text, date, user, text-area, label. You will see ICB has placed all these in the component for you. Make use of each of these different types that can be applied to a field. There is an important concept to realize. All fields live in views. Now, you might not think that a list view has fields and you are partly right. It does more than just display these fields. Let's do a dummy test article here to show what we mean.
|
||||
The Joonla! article title is a text field type; the alias is also a text field type. The editor block is a text editor field. There are others like list, radio, tag, text, date, user, text-area, label. You will see JCB has placed all these in the component for you. You can make use of each of these different types by applying one to a field. All fields live in views which is an important concept to understand. Now, you might not think that a list view has fields and you are partly right. It does do more than just display these fields. Let's create a test article here to show what we mean.
|
||||
|
||||
### Joomla! Articles List and Article Edit Views
|
||||
After adding some content, save and close the article so we at least have a list item. But that is also a field and if you click on search options all these are fields. So, your list also has certain fields which are only available in the list view. This is also the place where we do most of our features for multiple items where opening one item does what's only required for one item. There is a table which is part of the list that Component Builder sets Up. The bucket list and edit views are built for you, based on the fields and input value mapped to them in your view. We will look at these other concepts more deeply but I need to have you understand from which angle we are coming. We will try and show you that inside of this article you will be creating fields, even put them into different tabs, which will have been rendered in a specific order by the Joomla! component after it's been compiled using Component Builder. That's using Joomla!'s Article Manager as sort of an example.
|
||||
After adding some content, save and close the article so we at least have a list item. That is also a field and if you click on search all those options are fields. So, your list has certain fields which are only available in the list view. This is also the place where we do most of our features for multiple items where opening one item does what's only required for one item. There is a table which is part of the list that Component Builder sets Up. The bucket list and edit views are built for you, based on the fields and input value mapped to them in your view. We will look at these other concepts more deeply but I need to have you understand from which angle we are coming. We will try and show you that inside of this article you will be creating fields, even put them into different tabs, which will have been rendered in a specific order by the Joomla! component after it's been compiled using Component Builder. That's using Joomla!'s Article Manager as sort of an example.
|
||||
|
||||
+ [05:45](https://youtu.be/OhLzvThDXls?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=5m45s) **Compile error** _Remember to select correct options that suit your build._
|
||||
We could just as well go into Component Builder Since it has the demo application. See a detailed explanation of the demo component and building a local developer environment to run it. After selecting the demo Compile, it displays a warning because we haven't set some options in the global settings. It doesn't mean that there's been an error in the compiling. It just means it couldn't move the file to the git repository. If we deselect some compile options and start again it doesn't give you the same warning. Click install and compiled component gets installed Into this Joomla site. It doesn't have any images because that we don't ship the images with the components. It's easy to use your own.
|
||||
@@ -22,7 +22,7 @@ Now let's look at how fields get into the component and use the Joomla! infrastr
|
||||
|
||||
The field types are mapped into the libraries inside of Joomla! Joomla! has many field types and for each field type which you build you need to set certain values in an XML document. These values in our free samples use a checkbox Set Up in Properties. So, you have to be certain when changing properties that you adjust the corresponding field. This applies only to the checkbox field. Most of the time you would never need to do that. An exception is adding more field types which we haven't covered, or if you want to extend the existing field types. For the most part you should not tinker with field types. I hope this explains where the field type comes from and the amazing scale produced from its use.
|
||||
|
||||
With most other Component Builders you need to wait for the developer to add a new field type. With Component Builder you can add your own field type which requires mapping it to the Joomla! library. Joomla! has their field type set to certain types now such as a repeatable field which is quite tricky and needs special attention even in the code of the JCB compiler. But the majority of field types are very straight forward and simple to implement. SO, we have created tutorials to help you with the learning process.
|
||||
With most other Component Builders you need to wait for the developer to add a new field type. With Component Builder you can add your own field type which requires mapping it to the Joomla! library. Joomla! has their field type set to certain types now such as a repeatable field which is quite tricky and needs special attention even in the code of the JCB compiler. But the majority of field types are very straight forward and simple to implement. So, we have created tutorials to help you with the learning process.
|
||||
|
||||
We have not implemented all the attributes that can be targeted though. You might need to add them if you want to use them. For example, I added this show on Action While recently to all field types which I did ti show and hide fields based on other fields values. An application was replaced in Joomla! Component Builder to take control of the features to show and hide fields. This is an added feature which you might use yourself and add to your component. If you are developing a feature we can add to a Component Builder version I would obviously suggest to do that I would still explain much more on this topic as we continue. Getting back to field types I continue.
|
||||
|
||||
|
Reference in New Issue
Block a user