8
votes
Accepted
Search tools is not open by default
I managed to add options as below
JLayoutHelper::render(
'joomla.searchtools.default',
array('view' => $this,
'options' => array('filtersHidden' =>$hidden)));
If $hidden is set as ...
- 2,671
7
votes
Accepted
What is the recommended way to structure a Joomla 3 custom component view using angularJS?
According to my experience:
JSON views: I have created components based FoF automatic JSON rendering https://github.com/akeeba/fof In this way, it is straightforward to load /get queries. In spite of ...
- 7,415
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 ...
6
votes
How can include the component view in plugins
From joomla 3.0 onwards a layout sharing feature is introduced, using it you can call a layout across views or extensions. It requires creating a layout object and then render the view using that ...
- 358
5
votes
What is the correct method of developing a front-end list and edit view
It is the right way :-) Build your links with JRoute, for example:
JRoute::_('index.php?option=com_productman&view=product&product_id=x');
It will automatically append the menu item ID of ...
- 3,713
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->...
- 26.7k
4
votes
Accepted
Joomla singular and plural view names
Yes, there is. Take a look at this if statement in JControllerForm class.
So to redirect to deliverys, you have to add property
protected $view_list = 'deliverys';
in your controller. If this dosen't ...
- 3,208
3
votes
Accepted
How to redirect to a "part-view" of a view file?
Probably you just need to add the layout GET parameter to the URL
Also you can redirect in the controller using setRedirect() and JRoute.
$this->setRedirect(JRoute::_('index.php?option=...
- 347
3
votes
Joomla-Development: Set default view
I think your view files are missing or view class is named incorrectly (correct is [Prefix]View[Viewname]).
If I change the name of
administrator/components/com_banners/views/ to /viewx/
I get the ...
- 505
3
votes
Accepted
Joomla 3 frontend view xml: How do I add a custom field to the menu item's paramaters?
Try removing the blank spaces in fields name and fieldset name attributes
<fields name="RouteSettings">
<fieldset name="RouteSettings">
<field name="route_id" type="sql" ...
- 977
3
votes
Search tools is not open by default
The filter fields will automatically populated if they are listed in your Model's $config['filter_fields'] array in the constructor.
For example:
public function __construct ($config = array())
{
...
- 2,981
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 ...
- 3,072
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 ...
- 890
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, ...
- 26.7k
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.
- 61
2
votes
Accepted
Access Model State Variable in View
You should use get function of the state object (object of JObject class)
$state = $this->get('State');
$requestId = $state->get('request.id', 0);
second parameter is default value to return ...
- 2,981
2
votes
Accepted
How to avoid loading a module in a view without creating a menu item for that view
I'm pretty sure you can use Advanced Module Manager for this purpose. There are many different rules you can apply to your modules in order to control when and where your modules should be displayed ...
- 13.3k
2
votes
Search tools is not open by default
I ran into the same issue but have tracked it down to what it is. It is a multi-step process to setup the filters.
For the filters to work you need to add filter_.xml file in the models/forms folder. ...
- 31
2
votes
Accepted
How do I add print button in Joomla list view.?
I don't know if you talk about the frontend or backend... if you are in the Joomla! backend you can create a custom toolbar button in your view.html.php
$bar = & JToolBar::getInstance('toolbar');
...
- 102
2
votes
Correct / Best way of calling model methods inside view.html.php
I think $mydata = $this->get('MyData'); is the best way to call model's functions if you don't need to pass any argument.
Model's function are already available in the MVC view logic and using the ...
- 977
2
votes
How to remove component name from URL?
You can use .htaccess In joomla with apache rewrite feature.
Rename the file htaccess.txt to .htaccess In root joomla folder;
Enable Apache rewrite In global configuration In joomla admin area.
- 991
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 ...
- 26.7k
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 ...
- 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 ...
- 167
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 ...
- 802
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:...
- 1,763
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 ...
- 9,686
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 ...
- 9,686
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 ...
- 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 ...
- 1,180
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
view × 73component × 27
joomla-3.x × 26
custom-component × 11
controller × 9
model × 8
development × 6
joomla-3.4 × 5
mysql × 5
mvc × 5
layout × 5
php × 4
joomla-2.5 × 3
menu-item × 3
ajax × 3
joomla-4.x × 3
plugin × 2
database × 2
overrides × 2
menu × 2
url × 2
jform × 2
module-display × 2
acl × 2
front-end × 2