English > Extensions and jDiction

XML for custom made params

(1/3) > >>

nkt:
Hi all,

I made a plugin that adds extra parameters to the category detail view in the backend. It adds the following XML file stored in the plugin folder to the form:

--- Code: ---<?xml version="1.0" encoding="utf-8"?>
<form>
<fields name="params">
<fieldset name="FILTER">
<field name="filter_exptag" type="checkbox" label="PLG_CONTENT_CATFILTER_EXPTAG" value="1" default="0" />
<field name="namefilter1" type="text" label="PLG_CONTENT_CATFILTER_TEXT" description="PLG_CONTENT_CATFILTER_TEXT_DESC" size="30" />
<field type="spacer" name="myspacer1" hr="true" />
<field name="filter_relexp" type="checkbox" label="PLG_CONTENT_CATFILTER_RELEXP" value="1" default="0"/>
<field name="namefilter2" type="text" label="PLG_CONTENT_CATFILTER_TEXT" description="PLG_CONTENT_CATFILTER_TEXT_DESC" size="30" />
<field type="spacer" name="myspacer2" hr="true" />
<field name="filter_relsec" type="checkbox" label="PLG_CONTENT_CATFILTER_RELSEC" value="1" default="0"/>
<field name="namefilter3" type="text" label="PLG_CONTENT_CATFILTER_TEXT" description="PLG_CONTENT_CATFILTER_TEXT_DESC" size="30" />
</fieldset>
</fields>
</form>

--- End code ---
The problem is that I won't succeed in translating these custom params. I tried the following for categories.xml and many variations:

--- Code: ---<?xml version="1.0" encoding="utf-8"?>
<jdiction>
  <component>com_categories</component>
  <sections>
    <section>
      <tables>
        <table>
          <name>#__categories</name>
          <key>id</key>
          <class>CategoriesTableCategory</class>
          <file>category.php</file>
          <exportfilter>title != "ROOT"</exportfilter>
          <cache fullfetch="1" />
        </table>
      </tables>
      <views>
        <view name="category" list="categories" layout="edit" default="true">
          <form import="category.xml">
          <fieldset name="main" label="COM_JDICTION_TRANSLATION_FIELDSET_MAIN">
              <field name="title" />
              <field name="alias" type="jdalias" field="title" export="false" />
              <field name="metakey" />
              <field name="metadesc" />
              <field name="description" />
            </fieldset>
          </form>
  <form import="..\..\..\..\..\plugins\content\catfilter\catfilter.xml">
          <fieldset name="FILTER" label="COM_JDICTION_TRANSLATION_FIELDSET_MAIN">
              <field name="namefilter1" />
            </fieldset>
          </form>
        </view>
      </views>
    </section>
  </sections>
</jdiction>

--- End code ---

To make it more clear, I added my plugin.

Harald Leithner:
Nice work.

thx for sharing.

nkt:
Thnx Harald, however I still got the problem that I can't translate my custom parameters :'(

Do you have an idea how to edit the categories.xml, such that it will also translate my custom parameters?

Harald Leithner:
sure ;-)

you have to enclose the fieldset with a field tag


--- Code: ---<fields name="params">
  <fieldset name="FILTER" label="COM_JDICTION_TRANSLATION_FIELDSET_MAIN">
    <field name="namefilter1" />
  </fieldset>
</fields>
--- End code ---

nkt:
Unfortunately that doesn't work, the field doesn't even show up in the translation form.

And why do I need to enclose it in the fields tag, because the "main" fieldset is also not enclosed by a fields tag.

Thanks for helping me!

Navigation

[0] Message Index

[#] Next page

Go to full version