Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted August 22, 20168 yr A lot of unhookable if statements abound. The one that is pretty much a stone wall is this: {{if $category->can('add')}} <ul class="ipsToolList ipsToolList_horizontal ipsClearfix ipsSpacer_bottom ipsResponsive_hidePhone"> {template="categoryButtons" group="browse" params="$category->can('add'), $category, NULL"} </ul> {{endif}} That is the only call to display the button controls on category view in Gallery and it's trapped inside of a canAdd check. Any attempt at hooking and adding a button of my own there is doomed to fail unless the individual viewing the page has the ability to add in that category. Of course, I could just hook the entire template and then change what is needed - inefficient as hell but not uncommon - except I can't. The template itself starts with an opening and closing div and then proceeds into all those if checks. So grabbing the whole template is out as well. I really just need that category canAdd check moved inside the UL. Or hell, just add a plain div wrapper around the entire thing and I can then grab and change as needed.
August 22, 20168 yr Author And again with Downloads... (front/browse/category) {{if \IPS\downloads\Category::canOnAny('add') AND ( !$category OR $category->can('add') ) }} <ul class="ipsToolList ipsToolList_horizontal ipsResponsive_hidePhone ipsClearfix ipsSpacer_both"> {template="categoryButtons" group="browse" params="\IPS\downloads\Category::canOnAny('add'), $category"} </ul> {{endif}} And the same open/close div up top to stop me grabbing most of the template to do it that way...
August 23, 20168 yr We need the old hook on IF/FOREACH entry points. This new CSS rules has certainly its advantages in 4.x but a combination of both old and new method would solve all our issues. I find it difficult myself sometimes finding the proper hook point.
August 23, 20168 yr Author Oh yeah, hooks on if/elseif/else/foreach would be lights out fantastic but like I said, I'll take what I can get. Though I've kinda stopped holding my breath for action on just about anything in this forum. Still, gotta try.
Archived
This topic is now archived and is closed to further replies.