Guide Category

134

Custom Article Fields

Custom Fields, sometime called "Additional Fields" or "XFields", is the special extended plugins in Datalife Engine, when you post anything on your website you will have shortstory and fullstory fields for you and your members to add news and articles, however, you can create other fields to enter information, such as a link to the source or program, there is something extra that you want members to add in to specific fields and information you need for your website, custom fields is the extension for it and the best thing about custom field is that you have no limitation to add and specify any kinds of information you want and you have complete control in your site template designs to make it looks anyway you want, also the custom field is searchable by search module within DLE and other search function like Opensearch and modules like Search Cloud or recent search which is wonderful feature in DLE, the structure of the custom field is saved in simple text file (.txt) called "xfields.txt" which located within folder /engine/data/ and you can edit, modify, delete and reorder the fields in case you have created the field later but you want to move it to the top or second or so on
dlestarter
Custom Article Fields Custom Fields, sometime called "Additional Fields" or "XFields", is the special extended plugins in Datalife Engine, when you post anything on your website you will have shortstory and fullstory fields for you and your members to add news and articles, however, you can create other fields to enter information, such as a link to the source or program, there is something extra that you want members to add in to specific fields and information you need for your website, custom fields is the extension for it and the best thing about custom field is that you have no limitation to add and specify any kinds of information you want and you have complete control in your site template designs to make it looks anyway you want, also the custom field is searchable by search module within DLE and other search function like Opensearch and modules like Search Cloud or recent search which is wonderful feature in DLE, the structure of the custom field is saved in simple text file (.txt) called "xfields.txt" which located within folder /engine/data/ and you can edit, modify, delete and reorder the fields in case you have created the field later but you want to move it to the top or second or so on...
Custom Fields or XFields in Datalife EngineCustom Fields or XFields in Datalife Engine
Custom Article Fields is the custom field manager for Posts - News - Articles of your website, the Custom Article Fields you have created will be automatically added to your form when you add news or article to your website on both frontpage and from Admin CP addnews using tag {xfields} in addnews.tpl and /engine/inc/addnews.php, but will not automatically display in your website when display articles and posts, you must specify the the fields to display in the following files on your theme folder
  • shortstory.tpl
  • fullstory.tpl
  • topnews.tpl
  • relatednews.tpl
  • searchresults.tpl
  • previews.tpl
  • custom theme files that using to display short/fullstory
The Custom fields will be automatically added to your form when you add news or article to your website on both frontpage and from admin cp addnews using tag {xfields}

Lets take a look on Custom Fields and how to work with it

  • For Custom Article Fields: Login to your DLE Admin CP and click on Custom Article Fields http://site.com/admin.php?mod=xfields&xfieldsaction=configure
If you have created some of custom fields you will see the list of them there, from here you can edit or remove them at any time you want, to add Custom Field, simply click on "Add New" button, in add field page you will have option to add custom fields as in screenshot
Add XFields in Datalife EngineAdd XFields in Datalife Engine
  • Field name: This field is to specify the name of the custom field, the input must be in 1 word and must be unique, you can use character and number in this field and it must be "latin" characters, this field will be the name of field to add in your theme
  • Short description: to specify any description for your field, this field can be any languages and characters, you can use your own language to let the member know what it is when they add news or articles to your website, and it can be as long as you want but we recommend that you keep it within 255 characters
  • Show in category: this option to let you specify the field you create to be added in specific category, for example if you want to add DVD qualities (DVDRip, CAM, Blu-ray etc..) to "Movies" section only not in Software/Application, you can specify it here, when you and member add posts to your site, then they select to add it to "Movies" category the field to select DVD qualities will show up automatically, it will not show if they select "Software/Applications"...
  • Field type: there are 3 types of fields to select from
    • Input Field : standard input box
    • Text Field : is the full textarea, when you select this field, the editor (bbcode/wysiwyg) will be included in every field, and it will support regular bbcode and html code and the editor will be full functioned like upload, media, video, flash image etc...
    • List : is the dropdown list choice for you and members to select, currently there is no "multiple choice" available with the field, the list must be specified 1 option or value per line
    XFields or Custom FieldsXFields or Custom Fields
  • Default text: if you want to specify the default input in the field you can do so otherwise leave it blank which we recommend this option to be blank, I will tell you "why" you should leave blank in next section on add the field to display in theme later in this tutorial..
  • Optional this radio button to specify when you add custom fields, if you leave this option "unchecked" it means the field you are adding is "Required" for you and members to input when addnews, if this field not input anything they will get error message to input all required fields, this "Optional" option only available if you choose the Field type as "text field (input)" and "text area", it will not available if you select "List"
  • Safe Mode and protect xfield (disable BB tags and HTML): This option is new in DLE 10.0, the option will allow you to enable or disable BBCode/HTML code in the field which was the same option "Protect additional fields" in previous versions of DLE which used to be located in System Settings > Script Safety Control tab but in DLE 10.0 is now moved to xField manager which is easy for enable or disable for each xfield in case you want some fileds to be protected but want to use bbcode/html on some fields.
  • Use the field values as hyperlinks, this option is new feature in DLE 9.6, In this case, the added value to fields will be displayed in the form of links to show other articles that have the same value. Also allowed transfer values through tag, with each word will have a separate link. For example, when using this feature you can organize the news on a certain type of appropriate.
When you add news/articles you will see the XFields displaying like this:
XFields when Addnews in Datalife EngineXFields when Addnews in Datalife Engine

Sort XFields

Sort XFields in Datalife EngineSort XFields in Datalife Engine
Sort XFields is very easy in newer version of Datalife Engine starting with !0.0 to newest released versions will allow you to drag and drop like in screenshot above, then click "Save the Sort Order" button in the bottom, but on the older versions you have to select to move up and down one by one which sometimes it becomes difficult when you have lot of XFields.
Sort XField in older Datalife Engine versionsSort XField in older Datalife Engine versions

Related Tutorials

Review/Leave Comment

comments powered by Disqus