Question -- Frontend Filtering #36
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#36
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I have one of my frontend views that I am working on right now. It is the more complex out of all my views, as it will have dropdown filters on the site view. For example, there will be a dropdown for category, that will pre-populate with the categories available for the component which the items on the view can be filtered by, or city which will populate the values in the dropdown with values from the cities table, and if selected would filter by the city selected.
I have all the code that I need to get this working "hard-coded" into the model, which works beautifully, and now I'm working on actually getting the code into the dynamic get. Joining DB tables was fairly simple, and that is compiling with no problems.
Where I'm having struggles right now, and hopefully you have some suggestions, is adding more conditions to protected function getListQuery(). Some samples of the code that I need to get in the getListQuery (there are actually a lot more than this, but this is a sample):
I've tried putting testing putting $categoryDd = $this->input->get('categoryDd'); in the filter, and the where, but upon compile nothing is showing up in the model.
Any thoughts on this?
Please review the tutorials on dynamic get
IF this is a getListQuery then you can add that script right in the DynamicGet->CustomScript->getListQuery - JModelList I have done it many time and it works great.
But if it is a single item, you will need to do two things with each, add the
$var = $this->input->get('xxx')
in above the query in before getting the Item the in the Where adda.var
in Table Key and$var
Value KeyAlways type cast an int
$query->where('a.catid = '. (int) $categoryDd);