help to better help you:

Please: add always Joomla / JEM version and details to your posts, so we can try to reproduce your issue!

Playing with Filters - using from menus with JS

Playing with Filters - using from menus with JS

11 years 4 months ago - 11 years 4 months ago
#10599
Using SEF URLs and like I said I am just playing with filters.. I briefly tried this without SEF and it does not work. Oh well.. like I said I am just playing with filters.. I am posting this here for my memory and if it helps someone else cool.

I have 3 external URL menu items.

/events (/events points to a hidden menu item for JEM Eventlist.)
/category1
/category2

For reasons I do not want to explain I want to just use the 1 JEM menu item.

I have 3 categories.. you guessed it Events, Category1 and Category2

I wanted to use the built in filters
www.localhost.com/events?filter=4&filter_search=Category1
but having the browser address bar only showing:
www.localhost.com/events

So by looking at URL the filter=4 (Means Category)

This is how I did it..

In Joomla I created some External URL menu links:

Events
And gave it a link of
Code:
/events" onclick="Clear();return false;
Category1
And gave it a link of
Code:
/events" onclick="Category1();return false;
Category2
And gave it a link of
Code:
/events" onclick="Category2();return false;

Then I went and added the following to my /templatename/html/com_jem/eventslist custom override
Code:
<script type="text/javascript"> function Clear() { document.id('filter_search').value=''; document.adminForm.submit(); } </script> <script type="text/javascript"> function Category1() { document.id('filter').value='4'; document.id('filter_search').value='Category1'; document.adminForm.submit(); } </script> <script type="text/javascript"> function Category2() { document.id('filter').value='4'; document.id('filter_search').value='Category2'; document.adminForm.submit(); } </script>

This is likely not the proper way of doing this, but it works.. and this is the testing and I am guessing not the most efficient method of doing this.
Last edit: 11 years 4 months ago by NEYW.

Please Log in or Create an account to join the conversation.

Time to create page: 0.483 seconds