1
votes

I want to develope a joomla! 2.5 module on which the admin could select an article so that the selected article will be displayed as a link in the frontend. The params of a module are declare in the modulename.xml file, so I want to know if there is a field type like the one that lets you select an article when you create a menu item to show a single article.

here is the xml file

<fieldset name="basic" addfieldpath="/modules/mod_ctfapartados/elements/">
<field  name="" type="article"  default="0" label="MOD_APARTADOS_LINK_ONE_LABEL"
description="MOD_APARTADOS_LINK_ONE_DESC"
2

2 Answers

6
votes

for some reasons i am not able to edit the code in my previous answer so here is the revised part of code

<fieldset 
     name="request" 
     addfieldpath="/administrator/components/com_content/models/fields">
     <field 
           name="article_id"
           type="modal_article"
           label="label"
           required="true"
           description="desc"/>
</fieldset>
0
votes
  • create a folder in your module with name "elements"

  • copy the file article.php from joomlaroot\administrator\components\com_content\elements and place it in your modules elements folder

  • then in your xml add these lines