1

I want to make a small edit in an existing module. That module parses articles from the given categories and post them at index. I wanted to add another element (ID) so the user could give the id from an article that isn't in a category and post that Also.

I'm completely new to module development and even the easiest task seems really complex for me right now. So I created the text field at my XML manifest file, and I can add a value and here comes my question/s.

If I'm not mistaken the list type fields are getting saved somewhere in the db and you can retrieve them calling as a list that has default elements.

$params = JFactory::getApplication()->getParams();
$model->setState('params', $appParams);
$modell->setState('list.start');

It maybe sounds dumb but I didn't find anything about text fields. Or maybe I didn't understand it. So I would like someone to enlighten me on how we generally retrieve the values user gives at backend so we can echo em at frontend.

And also if someone could recommend me a book or something that could help me with Joomla module development (I tried Joomla Development A beginners Guide by Hagen Graf and Learning Joomla 3 Extension Development 3rd Edition, but they didn't help me a lot as you can see).

2 Answers 2

1

Nick gave you the right direction - Adding form fields is exactly what you need. May be you missed some points from this doc:

  • Form fields and parameters can be found on this page (text is also there)
  • The form field parameters are stored for each module in the #__modules table under the params field as JSON encoded string
  • You can retrieve the parameter via $params variable (it's a Registry object). For example: $myParam = $params->get('my_param', '1') where my_param is the name of the field in your manifest file and '1' is the default value.
  • You can pass the $params to modules helper and use it there
  • The examples of $params usage can be found in any Joomla standard module
2
  • Seems i really misunderstood what i readed , thanks for making it clear ;)
    – IseNgaRt
    Nov 21, 2014 at 9:50
  • I forgot the book :) Joomla! Programming is the one that you should consider to read. Nov 21, 2014 at 9:56
1

You can refer below links for module development.

Developing a Basic Module

Using Database

Adding form fields

1
  • i allready readed that. I know how the MCV model works i just wanted to know the mechanic i parse from backend,edit,post to frontend.
    – IseNgaRt
    Nov 21, 2014 at 9:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.