Jump to content

Gallery/Front/Browse/Category needs to be hookable


Flitterkill

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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