Jump to content

Gallery/Front/Browse/Category needs to be hookable


Flitterkill

Recommended Posts

Posted

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.

Posted

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...

Posted

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.

Posted

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.

  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...