jDiction Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

jDiction 2.2.0 released. http://jdiction.org/downloads

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - pipedream

Pages: [1]
1
General Questions / Re: able to update in each language in the frontend
« on: August 14, 2014, 02:52:24 am »
+1, it would really be a great wanted feature, thanks!

2
When opening a custom extension translation page, the fields on the first tab are not displayed.
If the tab is clicked, then the fields are displayed.
If there are no tabs (only 1 field set), fields are also displayed.

This only happens when the attribute name of the first fieldset tag in jdiction.xml is not equal to "main".

To prevent this small bug, I changed the file administrator/components/com_jdiction/views/translation/tmpl/form.php:

148 -        if ($tabs) { echo JHtml::_('bootstrap.startTabSet', 'language-'.$language->lang_code.'-fieldset-tabs', array('active' => 'language-'.$language->lang_code.'-tab-main')); }
148 +        $fieldsets = $this->form->getFieldsets();
149 +        if ($tabs) { echo JHtml::_('bootstrap.startTabSet', 'language-'.$language->lang_code.'-fieldset-tabs', array('active' => 'language-'.$language->lang_code.'-tab-'.reset($fieldsets)->name)); }
149 -        foreach($this->form->getFieldsets() as $fieldset) :
150 +        foreach($fieldsets as $fieldset) :


Hope it helps.

3
Extensions and jDiction / Re: XML format for component
« on: July 11, 2014, 06:08:54 am »
Hi Harald,

Yes, please complete the documentation.

While using jDiction with Event Booking, I had some problems trying to find the correct values for each tag and parameter.
So, I will try my best to add something to the useful information already posted by pagchen.

A jdiction.xml file should be created inside administrator/components/com_my_component/.

Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<jdiction>
  <component>com_my_component</component>
  <sections>
    <section>
      <tables>
        <table>
          <name>#__db_table</name>
          <key>db_table_key</key>
          <class>MyComponentTable</class>
          <file>my_component.php</file>
          <cache fullfetch="0" />
          <exportfilter/>
        </table>
      </tables>
      <views>
        <view name="edit_view" list="list_view" layout="edit_layout" default="true">
          <form import="my_component_form.xml">
            <fieldset name="main" label="COM_JDICTION_TRANSLATION_FIELDSET_MAIN">
              <field name="a_field" />
      <field name="another_field" />
            </fieldset>
            <fields name="extra_fields">
              <fieldset name="extra" label="ANOTHER_TRANSLATION_STRING">
                <field name="an_extra_field" />
              </fieldset>
            </fields>
          </form>
        </view>
      </views>
    </section>
  </sections>
</jdiction>

<tables> tag

Locate the model file, such as administrator/components/com_my_component/tables/my_component.php.
The <table><file> tag should contain the name of this file and in its content we can also find the values for the tags:
  • <table><class>, within the code "class MyComponentTable extends JTable";
  • <table><name>, within the code "parent::__construct('#__db_table', 'db_table_key', $db);";
  • <table><key>, within the code "parent::__construct('#__db_table', 'db_table_key', $db);".
As far I understood, <table><cache> should have the attribute fullfetch equal to 0 unless we are sure that all the table records are always being fetched by Joomla. Don't know if this tag is mandatory.

The tag <table><exportfilter> seems to be optional and allows you to filter records through an SQL query when exporting the table, right?

<views> tag

In you administrator's panel visit the component and get the view/task and layout values of the URL of the listing and editing pages.
The <view> tag should have the following attributes:
  • name, value of the view/task parameter in the editing URL:
    "mysite/administrator/index.php?option=my_component&view=edit_view" or
    "mysite/administrator/index.php?option=my_component&task=edit_view.edit_layout";
  • list, value of the view/task parameter in the listing URL:
    "mysite/administrator/index.php?option=my_component&view=list_view" or
    "mysite/administrator/index.php?option=my_component&task=list_view.list_layout";
  • layout, value of the layout parameter in the editing URL:
    "mysite/administrator/index.php?option=my_component&task=edit_view.edit_layout" or
    "mysite/administrator/index.php?option=my_component&task=edit_view&layout=edit_layout"
    (if the layout parameter is not defined, the value "default" should be used);
  • default, when equal to true it should allow translations on the default component page (without any view/task parameter defined, such as "mysite/administrator/index.php?option=my_component), seems to be useful only when the default task is not the editing or listing because for these it would be enough to specify as "default" its attribute (name or list, respectively).
The attribute import of the tag <view><form> accepts XML files (separated by commas) that define forms created using JForm in the administrator/components/com_my_component/models/forms/ folder. When importing these form definitions, we don't have to specify each attribute of the field tags beyond the name attribute, unless we want to change attribute values or specify additional attributes.

Regarding the fieldset, fields and field tags, these should follow what is described in Joomla! Documentation:
http://docs.joomla.org/XML_JForm_form_definitions

Still, there are some aspects worth mentioning:
  • fieldset tag must have a name attribute and, if a XML form definition file is imported, its value or the value of an additional attribute named reffield should be the same as the one set in the file;
  • field tag can have an alias auto-generated from another field by setting the following attributes and values: type="jdalias" and field="source_field_name" (usually source_field_name is "title");
  • export of a particular field can be disabled if its attribute export is equal to "false";
  • field tag can accept a pair of attributes for holding multiple table columns: the multifield attribute holds the column names (separated by commas) and the seperator attribute defines what separates each column value inside the field; for now, this feature seems to only work with the Joomla content table;
  • fields tag can be used for handling multiple fields stored as a JSON format string in a single table column.


Please review and correct this information, thanks.

Pages: [1]