1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

Take out item in filter list and have it display always

Discussion in 'Professional Support' started by fractikdesigns, Mar 13, 2014.

  1. fractikdesigns

    fractikdesigns Member

    Level: Community
    ah yeah... thanks for that, it worked out great...
     
  2. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    No more hacky than the solution we were working on, and yours is betterm as it actually does exactly what the client wants.

    Really, the only non-hacky solution involves me finishing off those changes to the join element I'm half way through, to make it run the "eval options" code on filters as well as form display. The dropdown element already does that, but not the join element. Then it oculd be done with supported methods, using a combination of the eval options to remove the "core" option (by returning false), and using the php_events list plugin to fire on 'onFiltersGot' and modifying the main $listModel->filters data to do the "OR status = 'core'" thing.

    I'm going to finish off those changes at some point, but it got a little more involved than I'd hoped, and is something I'm going to have to test for a while before committing. As you know, anything to do with filters gets a little hairy in the code.

    -- hugh
     
  3. fractikdesigns

    fractikdesigns Member

    Level: Community
    So should I implement tht ecode that felixkat offered? It seems to do exactly what I need and seems to work well... I will go ahead and implement that tonight.. Really need to wrap up this project this week. I can always go back later and make adjustments if needed.. but for now I just need a working solution to get the customer happy and get myself paid, lol.....

    and thanks again felixkat for the solution.... very helpful...
     
  4. fractikdesigns

    fractikdesigns Member

    Level: Community
    silly question felixkat. I currently have this as a databasejoin. (not sure why i did it that way).. Should i just make this a normal dropdown element instead of a separate list? This way I have display and value (0,1,2)
     
  5. fractikdesigns

    fractikdesigns Member

    Level: Community
    also is the filter hack in a filter file or in the default.php? can't seem to locate it but found the rest...
     
  6. fractikdesigns

    fractikdesigns Member

    Level: Community
    hmmm i get a blank page after trying this out... hmmmm
     
  7. fractikdesigns

    fractikdesigns Member

    Level: Community
    I get a blank page and this is the only code in the source when i view source

    Code (Text):
    <form class="fabrikForm form-search" action="/voicelink/?resetfilters=0&amp;clearordering=0&amp;clearfilters=0" method="post" id="listform_2_com_fabrik_2" name="fabrikList">
     
    <div class="colfilter">
    Not sure what I could have done diffeerently.. hmmmmm

    I did however figure out my other issue with files uploading weird... The text editor in MAC is changing things causing it to not render correctly. I did this from a pc laptop until i can figure out a decent html/code editor for MAC...

    the colfilter was a class i made when felixkat gave me code for the 2 column layout.. now sure why its failing there... when i rename my old files back, the site renders fine again...
     
  8. fractikdesigns

    fractikdesigns Member

    Level: Community
    also.. on the php plugin for the form (I assume you went to forms > my form > plugins?

    do i need to enter or do anything for process script, php file, and require once fields, or just enter the code?

    also up top do i need anything for the In and On? they currently say both
     
  9. fractikdesigns

    fractikdesigns Member

    Level: Community
    ok sorry for all the posts. its something in the filter file. checking that over now to see if i messed up the code somehow... when i put that back to original it loads...
     
  10. fractikdesigns

    fractikdesigns Member

    Level: Community
    you had an extra ' in the one section. took that out and the filter works just fine (removed core)... only issue is it doesn't seem to have core show up when you filter union and nonunion, but core does show up on ALL..

    I will review the original default.php code. maybe i missed something there, or in the plugin php...
     
  11. fractikdesigns

    fractikdesigns Member

    Level: Community
    btw i looked in phpmyadmin. the status's are correct as it shows 1, 2, 0 in record order. so the status is showing 0,1,2. I also changed it to a dropdown as you had it to make it easier since they will not be adding more entries later on. Makes the table and list easier to deal with.

    So not sure where the issue lies... filter is rendering properly, but the list is not. It Does filter normally, but core is not showing up when you select union or nonunion. so maybe filter isn't working properly?

    what should the values in phpmyadmin show? just a 0,1 or 2? or something else? I deleted the allison record and readded and the teser one as well after I added all the code and php plugin...

    and once again sorry for all the posts tonight. my subscription runs out and i do not have any more room in the budget to resubscribe for another month. I am already at a loss on this project.

    Thanks
     
  12. fractikdesigns

    fractikdesigns Member

    Level: Community
    forgot to mention one thing. the items are only being entered on the backend, not on front end web facing form. only through list > listname >view data. does that make a difference? the php should should render either way correct?
     
  13. fractikdesigns

    fractikdesigns Member

    Level: Community
  14. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    I've asked Felix if he can take a look at this, at it was his solution!

    If he has the time, I'll move this to the community forum so you can respond.

    -- hugh
     
  15. felixkat

    felixkat Senior Member

    Level: Community
    Okay where to start... :)

    For most of my editing I use Notepad++ on windows as it's free quick and easy and has some decent plugins. So I looked at Mac alternatives and people suggested some alternatives. It's better that I show you the post which contains the suggestions.

    http://forums.macrumors.com/showthread.php?t=1127502

    The dropdown is probably a preferred element if the data is never going to change and it will only ever be a few options.

    Looking back I don't think I made it clear where all the various changes go. I think I was battling with the forum markup as it was changing some of my code.

    So where I mention the filter hack should be placed in default_filter.php.


    PHP:
    $this->filters['z_status___status']->element = str_replace('<option value="0">Core</option>', '', $this->filters['z_status___status']->element);

    I have attached a screenshot, bear in mind it shows my element details.

    Yes you can specify where the plugin runs, just have both options set to BOTH, see screenshot.
     

    Attached Files:

Share This Page