install with default parameter - Joomla! Forum - community, help and support


hi,

i have written component. in administration define global preferences stored in db under __extensions in column params in way: {"purchase_type":"3","track_impressions":"0"}

but how set params when component installed have defaults? tried understand site: http://docs.joomla.org/component_parameters
this install xml:

code: select all

<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="2.5.4">

   <name>com_sportactivities</name>
   <!-- following elements optional , free of formatting conttraints -->
   <creationdate>2012-05-13</creationdate>
   <author>md-technologie michael düpjohann</author>
   <authoremail>kontakt@md-technologie.de</authoremail>
   <authorurl>http://www.md-technologie.de</authorurl>
   <copyright>copyright md-technologie</copyright>
   <license>free use/gnu</license>
   <!--  version string recorded in components table -->
   <version>4.01</version>
   <!-- description optional , defaults name -->
   <description>this component athlete arrange sportacitivty.
  first component. because small 1
  use example own first component. of common needed
  functions implemented , tried use standard functionality.
  </description>

   <install> <!-- runs on install -->
      <sql>
         <file charset="utf8" driver="mysql">sql/install.sql</file>
      </sql>
    <params>
      <param name="sitename" default="sportaktivitäten" />
      <param name="text1" default="wo" />
      <param name="text2" default="sportart" />
      <param name="text3" default="dauer" />
      <param name="text4" default="" />
      <param name="text5" default="" />
      <param name="text6" default="" />
      <param name="text7" default="" />
      <param name="text8" default="" />
      <param name="text9" default="" />
    </params>      
   </install>
   <uninstall> <!-- runs on uninstall -->
      <sql>
         <file charset="utf8" driver="mysql">sql/uninstall.sql</file>
      </sql>
   </uninstall>
   <update> <!-- runs on update; new in 2.5 -->
      <schemas>
         <file charset="utf8" driver="mysql">sql/updates</file>
      </schemas>
   </update>

   <!-- site main file copy section -->
   <!-- note folder attribute: attribute describes folder
        to copy in package install therefore files copied
        in section copied /site/ in package -->
   <files folder="site">
      <filename>sportactivities.php</filename>
      <filename>controller.php</filename>
      <filename>index.html</filename>
      <folder>models</folder>
      <folder>views</folder>
      <folder>assets</folder>
   </files>

  <!-- site main language file copy section -->
  <languages>
          <language tag="en-gb">language/site/en-gb.com_sportactivities.ini</language>
          <language tag="de-de">language/site/de-de.com_sportactivities.ini</language>
  </languages>

   <administration>
      <!-- administration menu section -->
      <menu>sportactivities</menu>

      <!-- administration main file copy section -->
      <files folder="admin">
         <filename>sportactivities.php</filename>
         <filename>config.xml</filename>
         <filename>controller.php</filename>
         <filename>index.html</filename>
        <folder>controllers</folder>
        <folder>helpers</folder>
        <folder>models</folder>
        <folder>sql</folder>
        <folder>tables</folder>
        <folder>views</folder>
      </files> 
      
    <languages>
            <language tag="en-gb">language/admin/en-gb.com_sportactivities.ini</language>
            <language tag="en-gb">language/admin/en-gb.com_sportactivities.sys.ini</language>
            <language tag="de-de">language/admin/de-de.com_sportactivities.ini</language>
            <language tag="de-de">language/admin/de-de.com_sportactivities.sys.ini</language>
    </languages>
      
   </administration>
</extension>


but params column stays empty (just {} )

i found workaround:
http://www.khawaib.co.uk/blog/saving-de ... tallation/

does know if have use fix in joomla 2.5.x?





Comments