Skip to main content
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
4 votes
Accepted

SQL syntax error when attempting to filter list view - how to build WHERE clause?

Try changing your query to the following: $query->select('#__users_2679886', 'name') ->from($db->qN('#__users', '#__users_2679886')) ->where($db->qN('id') . ' = ' . $db->...
Lodder's user avatar
  • 26.9k
3 votes
Accepted

Is it possible to insert a category list view inside an article?

One option would be to use the Articles - Category module that's shipped with Joomla. Create module Set all the options you require Assign it to a custom position, e.g category-test In your article, ...
Lodder's user avatar
  • 26.9k
3 votes
Accepted

Component view problem. Model method not called

It sounds like you only have one model, rather than the expected one-model-per-view. As such, it is looking for the function in a model related to your singles view, which does not exist. Try ...
RichardB's user avatar
  • 3,082
3 votes
Accepted

How can I have a dynamic $default_view?

You can't set a class property to a dynamic value, such as a method call, during declaration like you're attempting. See http://php.net/manual/en/language.oop5.properties.php You would need to set it ...
Drew G's user avatar
  • 890
3 votes

Joomla 4 Views will not load on some Hosts

HtmlView.php is case-sensitive. Also, all other files within the src folder for namespacing are case-sensitive. That is what was causing all the problems.
Brent Cordis's user avatar
2 votes
Accepted

Where query in Joomla component - what file do I edit?

As you've probably gathered already, Joomla is an MVC (model, view controller) content management system, so you're database queries will be located in the model: models/students.php As for current ...
Lodder's user avatar
  • 26.9k
2 votes
Accepted

Create alias for alternate view format

You could accomplish this in your component's route.php file. The particulars would depend on how your routing in route.php is done so I can't give you an exact answer but I think you'd need to update ...
Drew G's user avatar
  • 890
2 votes

Multiple templates for the same view of a custom component

I've found the issue, I'm adding it here for future references. Yes, it's enough to add the additional templates under the directory com_things/views/things/tmpl/. The problem in the question was ...
dolma33's user avatar
  • 167
2 votes

JViewLegacy::get weird behavior

That's an error in 2.5 documentation. For some reason it shows description of parent JObject::get() method. In 2.5 code and in 3.0 documentation the description is this: Method to get data from a ...
Sharky's user avatar
  • 11.3k
2 votes

JRoute not working - always shows the current view

You need to add your own router.php and build your own views in the build + parse methods in it. I would create a router.php file with this information: https://docs.joomla.org/J3.x:...
pe7er's user avatar
  • 2,023
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
Accepted

Joomla layout CSS classes in a view into iFrame

It doesn't work the way you expect because you're using tmpl URL parameter with value messages. What this parameter does is tells is to render the page using the specified template layout. When the ...
Sharky's user avatar
  • 11.3k
2 votes
Accepted

How do I override Joomlas default field template, but just in my component?

JLayouts do support component level overrides (but not view level). Create the override (layouts/joomla/form/renderlabel.php) in your component's directory. In frontend and/or backend, depending on ...
Sharky's user avatar
  • 11.3k
1 vote
Accepted

Add a class attribute to body tag when a user is logged in

You can use addScriptDeclaration to add some custom Javascript to the buffer, like so: <?php if (\Joomla\CMS\Factory::getUser()->guest === 0) { \Joomla\CMS\Factory::getDocument()->...
Lodder's user avatar
  • 26.9k
1 vote

How to make an adjustment on User Profile page in Community Builder

I don't use Community Builder myself so I can only give you some general tips. What you could do to find the right page to edit: create a backup of your site (e.g. using Akeeba Backup) with files + ...
pe7er's user avatar
  • 2,023
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

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

How to remember User State settings when returnng to a Site View?

It doesn't look like you are including the menu Itemid in your redirect which is why your URL is changing. Add another hidden field with the value of your current Itemid. Your redirect code is fine ...
Terry Carter's user avatar
  • 1,812
1 vote
Accepted

How to hide grey 'button bar' in administrator component view

In your default admin template folder (for example: yourjoomla/administrator/templates/isis/css) you can create a custom.css file in which you can define: .subhead-collapse collapse { height: 0px;...
Zollie's user avatar
  • 2,936
1 vote

How to hide grey 'button bar' in administrator component view

Just looking into how that bar is generated. It is part of the Isis administrator template. In line 58 of \administrator\templates\isis\index.php there is the code $cpanel = $option === '...
RichardB's user avatar
  • 3,082
1 vote
Accepted

Specify view and layout when adding a button with addNew()

Buttons point to a method in your controller. So create a method inside your thing controller called add and then use a redirect to send it to your correct view/layout. If you are using standard ...
Terry Carter's user avatar
  • 1,812
1 vote

0 Class 'EngineeringHelpersEngineering' not found

Short version. Move your jloader register statement into an earlier file like your controller or something. Longer version. JLoader::register allows you to ask Joomla's autoloader to require the ...
jamesgarrett's user avatar
  • 3,299
1 vote
Accepted

string together multiple partial templates

I think you're going in the wrong directing a little. It sounds like you're creating a different view for each of your parent and children templates. What you really want to do is have a single view ...
Drew G's user avatar
  • 890
1 vote
Accepted

Join two list views without a shared key

All roads lead to Rome. If you are new to Joomla, I recommend to read this: https://docs.joomla.org/J3.x:Developing_an_MVC_Component There you can get a good idea how Joomla components work. Back ...
Dennis Heiden's user avatar
1 vote

Redirect to specific tab in view

You have to pass the tab where you are in the link. I did it once like this: $jinput = JFactory::getApplication()->input; $tab = $jinput->getString('tab', 'info'); $tabinfo = false; $...
Piero Marsilio's user avatar
1 vote
Accepted

Override View path in the Controller is only partially working

I think you need to path 'template_path' in the config as well. Probably something like $config['template_path'] = array( JPATH_COMPONENT.'/views/tmpl', $custom_view_path.'/tmpl', /* ...
David Hayes'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
  • 492
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

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