Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Flitterkill Posted August 22, 2016 Posted August 22, 2016 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.
Flitterkill Posted August 22, 2016 Author Posted August 22, 2016 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...
teraßyte Posted August 23, 2016 Posted August 23, 2016 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.
Flitterkill Posted August 23, 2016 Author Posted August 23, 2016 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.
bfarber Posted October 3, 2016 Posted October 3, 2016 I have raised your suggestion internally for further discussion. Thanks!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.