Updated 5. Field Types (markdown)
@@ -16,12 +16,16 @@
|
||||
If you have a good knowledge of the Joomla! API You will know it can build forms you can use in a component and it's done using an XML file. Joomla! Component Bolder builds the XML file and places it in a location a model, view and controller can access it from using the Joomla! API. JCB builds the fields which you define would use in a view using a view containing fields displayed by the component. These and other terms will be defined as we proceed. Let's start start with what is known as field types.
|
||||
|
||||
+ [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_
|
||||
There is always a field type 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. 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.
|
||||
There is always a field type 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.
|
||||
+ [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.
|
||||
|
||||
The 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 these things are all in place in the application for you. Make use of each of these different types that can be applied to a field. All these fields live inside a view. That's 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.
|
||||
|
||||
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 inly 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.
|
||||
|
||||
If you click on add a Look It will open the edit and it keeps you on Looks. It also opens a list view of where the Looks will be displayed. We added an import feature with your normal to Miller Components don't have. We will explain that later. But if it's new you see that we have a text to add to your radio button. If I add something to the text field it opens and alias field is also a text field. We have a repeatable field and we can add information to this. And that is sort of Look at The fears that is in the demo component
|
||||
@@ -36,6 +40,7 @@ You have name which is called type And a value for checkbox And it Must be set t
|
||||
|
||||
You see that it shows you examples of how that XML line should look right see Now Yeah In the Field area where you created to field Basically gave the few the name this is just for the system The name used here is the one that is important That should be the correct name the label This name is just that you when you add it to your view You know this is what we used to identify it Weston explain adding it to the view In more detail This diet data type and things were also explain we only go into more depth around What a field is and how to build one I'm simply now looking at few pipes and showing you how the changes that you've made in field type Effects I feel that you would build with that type So here is that Detail that was in field type Member on change And it tells you What is mandatory in what is optional but that's basically because I placed it in the description right I mean let's be country close to go back to that field type And then take on property And we'll see that I added optional and mandatory To the description So that I can know is this option or mandatory Yes you could Possibly argued that I should have done it from here and that it's not true don't be necessary to add it there But you know this is that this The settings here is used when we compile the component Where is this Here is used for you You know what this field attribute is all about And maybe as weak Continue to develop this component I might Make it changed to that But I wouldn't make such a change that it affects anything that already exists Dramatically and anyway Ok so let's go back to a field
|
||||
|
||||
+ [17:43](https://youtu.be/OhLzvThDXls?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=17m43s) **XML string within compilier** _How XML string is build and compilied within component builder._
|
||||
The way the compiler works it is doesn't really grab the string and just put it into the XML In fact if I show you how a string looks that the compiler is built Wrong window Let's go to the string that the compiler is built Assessment type You see that it is completely reformatted The label is turned into a translatable string So it's been done done with the description It also tells you where in the compiler if well we'll still look at that because this might Sometimes show and sometimes you can Tweak Your Your component that it doesn't show it But it tells you Europe in which line in the Compiler it was built and also in which file which is very nice I think those of you that are developers will appreciate this feature from tremendously I also tells you the fuel type so Obviously as you can see it as we scroll through this You can see that Component builder really goes way out of its way to Reconstruct That That field It is not using This directly It in fact Grabs That area And that To determine that this is a Text Field So it actually is really dependent on that part Which is up dude name come now And That part there So the opening Exclamation and the closing one And the value in between those is what is used So if you prefer by accident drop off this Or that it will still work perfectly
|
||||
|
||||
These are really the only Things that are Really need it And part of what I am Hoping to achieve eventually is that this becomes just input Fields Like These And yet I'm wondering if I should go that way The fact that they all in one big text area Leaves us with a lot of room and freedom 2/2 really adjusted easily without major Complications And any case if you start a new field which we'll look at later It populates this with the demo demo data and the demo data Is actually values that you said When you create a fuel type You see Here it is the demo is this Value or example That is placed here It's from these values that region is in if you create a new text field It grabs these values as the values which you can then Adjust to your purpose Of you you know Implementation for that specific field at that moment If you leave it blank it will also build it without any value Between those two Estimation marks Ok That is looking at fuel types
|
||||
|
Reference in New Issue
Block a user