Skip to main content
7 votes
Accepted

Joomla Terminology: view, layout, task and component development

Running ahead a little bit let me provide you with link to JooYii Library. This library makes a leap ahead brings some practices that would be at Joomla! 4 to current Joomla! 3.x branch along with ...
Alexandr's user avatar
  • 1,130
6 votes
Accepted

How to render a component view in a module?

This is code I write time ago for Joomla 1.5, you will need adapt it for jooma 3.x (JRequest -> JInput, ...), and surely there is more elegant way to do this. This is the basic part of module.php My ...
José Sánchez Martín's user avatar
3 votes
Accepted

Toolbar not displayed in my Joomla MVC component

Toolbar isn't really supported in frontend. In backend it's rendered by mod_toolbar module which is only available in backend. You can still render the toolbar in frontend using this code but it may ...
Sharky's user avatar
  • 11.5k
3 votes
Accepted

Documentation tutorial: Why is my JFormFieldList showing a textbox?

The problem is that it is not able to get the field. I see filename you have defined as ulwiz_wmode.php and in class name you are using this JFormFieldUlWiz_WMode. Make sure the naming convention is ...
Liz.'s user avatar
  • 1,385
3 votes
Accepted

Why does Joomla have both models and tables?

Class JTable is created to work strictly on database object. Table object should create,modify,delete,check data in database. It can be used in many models, helpers, modules. Single model some times ...
Artur Stępień's user avatar
3 votes
Accepted

Joomla correct way of routing

You should run the URL through Joomla\CMS\Router\Route::_() before passing to setRedirect() to get the correct SEF URL since none of the involved methods do that automatically. use Joomla\CMS\Router\...
Sharky's user avatar
  • 11.5k
2 votes

What is the proper way to handle models that use other models in MVC?

There are many software design / architecture patterns and the is a good overview at https://en.wikipedia.org/wiki/Architectural_pattern From your description, it sounds like having a single joomla ...
AndyGaskell's user avatar
2 votes

How can I can get the new record ID after saving data with JModel?

Even though this is an old post. I wanted to post one of the solutions that helped me. JLoader::import('group', JPATH_ADMINISTRATOR.'/components/com_users/models'); $groupModel = JModelLegacy::...
Irfan's user avatar
  • 167
2 votes
Accepted

Restricted direct access creates problems passing references between files

Use Joomla's AJAX interface... (JRequest was actually a unified mechanism for data filtering etc of post and get requests… Never use raw globals ($_POST, $_GET etc) you leave yourself open to security ...
Craig's user avatar
  • 1,759
2 votes
Accepted

Where to prevent field value change in custom component form record?

JTable method check is design for Method to perform sanity checks on the JTable instance properties to ensure they are safe to store in the database. JTable method bind is design for Method ...
Rene Korss's user avatar
  • 3,208
2 votes

Create a User Area

Two questions: Do you want your users log in front or backend of your site? The workflow is a little different for each scenario. What user functionality you want?, or want to extend?, once the user ...
AlejandroVega's user avatar
2 votes
Accepted

View only showing one row from sql result set

The good news is that this is a very basic task. I would pass the entire players result set to your view via $this->_item->players. $query ->select("*") ->from($db->qn(...
mickmackusa's user avatar
  • 4,826
2 votes

Sharing a model between two views in a component

OK, comments are not the easiest place to talk in details (too short, too easy to misinterpret) so I'll post this here. It may be a bit wide-ranging and high-concept at first b/c of the lack of detail ...
Arlen's user avatar
  • 802
2 votes

Joomla 4 API MVC Layer type

You can use virtually any component structure you want as long as Joomla can dispatch the component. You can use the J3 style single entry file. You can use the J4 service provider while still using ...
Sharky's user avatar
  • 11.5k
2 votes

For how long will legacy component MVC structure work in Joomla?

My understanding is I don't believe it will 'stop working'. The new structure is guideline or preferred structure that brings Joomla inline with other frameworks. You can have whatever structure you ...
Irata's user avatar
  • 3,972
1 vote
Accepted

I want to display a form with the data added already

There is a method $form->setProperty() which does this.
DeesreX's user avatar
  • 87
1 vote

Sharing a MVC resources library between two components

First of all, you're using different file structure and class naming conventions than Joomla! core. This won't work without rewriting related methods such as controller's getView(). That said, using ...
Sharky's user avatar
  • 11.5k
1 vote

Display the component view or layout into a module

I would program a custom module for this purpose. In its helper file I would load the Model of your component to retrieve the items that you will display. Check out a Joomla core module like /...
pe7er's user avatar
  • 2,058
1 vote

How can I show an alternate layout for my view in an MVC component?

I have been fighting the same problem for two full days now, going over lesson 10 of Robbie Jacksons excellent video explanations in this series https://docs.joomla.org/J3.x:...
SoaringBird's user avatar
1 vote
Accepted

How can I show an alternate layout for my view in an MVC component?

The approach given above seemed like it should work because it does. However, if your class is a little more complex than my example and you have a __construct() function don't forget to call parent::...
glenatron's user avatar
  • 239
1 vote

Retrieve the value of a line a checkbox

Yes, the ids of those records that have been checked will be sent in the HTTP POST request within a param array named cid. You can retrieve them via $_REQUEST['cid'], but it's safer to retrieve them ...
Robbie Jackson's user avatar
1 vote

How to set the view location in Joomla 4

The view file that your component is looking for MycomponentViewViewname which was used in the Joomla 3, so make sure you are extending the right controller class in your Controller(i.e Joomla\CMS\MVC\...
Pratyush's user avatar
  • 496
1 vote
Accepted

Get user id from user form field type

Here is the code you would put in your models/forms XML file: <field name="modified_user_id" type="sql" label="JGLOBAL_FIELD_MODIFIED_BY_LABEL" description="...
Terry Carter's user avatar
  • 1,822
1 vote

How can I create a custom attribute/property on a model?

Table You can modify a Table object (usualy in /administrator/com_yourcomponent/tables/property.php) of this Property to set the is_sold property in load method right after parent::load(). Model Other ...
Artur Stępień's user avatar
1 vote
Accepted

Can a model display itself within the view of a different model?

Not by default, no. The model and the view basically don't talk to each other at all, all interaction between them is handled by the controllers. The reason the model is attached to the view is ...
Bathmat's user avatar
  • 502
1 vote

Natively override core extension classes from templates?

There is no core MVC override support. At the doc you say is outdated https://docs.joomla.org/How_to_override_the_component_mvc_from_the_Joomla!_core there is a link to a working plugin MVC override ...
AHeavyObject's user avatar
1 vote

How to render a component view in a module?

When I want to use a component in a module I use Regular Labs's Component Anywhere extension. https://www.regularlabs.com/extensions/componentsanywhere Perhaps that could be an example for you to ...
NJA's user avatar
  • 71
1 vote

Joomla component development - how to organize?

I´ll describe the way I did it. I created a system plugin that responds to the onAfterInitialise event to create a new router. $router = $app->getRouter(); So I can use my own rules: $router-&...
Piero Marsilio's user avatar
1 vote

How to query and display a list of nested tags for a particular parent on front end as links?

<?php defined('_JEXEC') or die; // Joomla $parent_tag_id=12345; // your tag id here JLoader::register('TagsHelperRoute', JPATH_BASE . '/components/com_tags/helpers/route.php'); $tags_tree=JTable::...
Marcel's user avatar
  • 35
1 vote
Accepted

which exception should be thrown when sanity checks fail?

First of all, i recommend reading this two posts: Whats the correct way for exception handling? http://martinfowler.com/articles/replaceThrowWithNotification.html Basically, it might be so that in ...
JSamir's user avatar
  • 126

Only top scored, non community-wiki answers of a minimum length are eligible