Jump to content

Club Sponsors Page - Supporttopic


Fosters

Recommended Posts

Posted

All we're doing with this app is to add the tab to the tablist :( which works with several of our apps and their all compatible with each other.

      'selector' => '#tabs_club > ul[role=\'tablist\']',
      'type' => 'add_inside_end',
      'content' => '<li>
  <a href=\'{$club->url()->setQueryString(\'do\',\'sponsors\')}\' class="ipsTabs_item {{if $club->isSponsorTab}}ipsTabs_activeItem{{endif}}" id="club_sponsortab" role="tab">
										{lang="club_sponsors"}
									</a>
</li>

I'll see what I can do here

Posted (edited)

I see the issue. I had to overload the foreach tab loop to add Home/Activity tabs, not sure why. 

Since yours will always be the last tab, can't you just add your tab via code hook instead of template hook? Take a look at Members Map app; it has a plugin that does this. 

Edited by Adriano Faria
Posted (edited)
On 11.9.2017 at 11:58 AM, Adriano Faria said:

I see the issue. I had to overload the foreach tab loop to add Home/Activity tabs, not sure why. 

Do you know in the meanwhile why you had to replace it?This breaks all other apps trying to add tabs to this template without using a really hackish way via nodes because it's not a node in 2 other apps which we're going to release soon. For the same reason the club members page was implemented as own tab and method and not as node.

e.g.  nodes are only returned when  $club->canRead() returns true, and it works only with nodes, which isn't always the case.

Are you using an own template for the tabs output which you're replacing? Then other apps could at least hook into your template and add their tabs

Edited by Fosters
Posted
1 hour ago, Fosters said:

Do you know in the meanwhile why you had to replace it?This breaks all other apps trying to add tabs to this template without using a really hackish way via nodes because it's not a node in 2 other apps which we're going to release soon. For the same reason the club members page was implemented as own tab and method and not as node.

e.g.  nodes are only returned when  $club->canRead() returns true, and it works only with nodes, which isn't always the case.

Are you using an own template for the tabs output which you're replacing? Then other apps could at least hook into your template and add their tabs

Hi @ Adriano Faria  can you give him any pointers?

Posted
4 hours ago, Fosters said:

Do you know in the meanwhile why you had to replace it?This breaks all other apps trying to add tabs to this template without using a really hackish way via nodes because it's not a node in 2 other apps which we're going to release soon. For the same reason the club members page was implemented as own tab and method and not as node.

That's how you can add tabs withtout nodes:

- Hook to \IPS\Member\Club:

	 * Get Node names and URLs
	 *
	 * @return	array
	 */
	public function nodes()
	{
		$return = call_user_func_array( 'parent::nodes', func_get_args() );

		$return[] = array(
			'name'			=> "Something",
			'url'			=> \IPS\Http\Url::internal( 'app=core&module=system&controller=settings', 'front', 'settings' ),
			'node_class'		=> NULL,
			'node_id'		=> '',
		);

		return $return;
	}

ywIqu4R.png

As you can see, you can send the user to any URL you want. In this case, I'm using Account Settings. You just need to add your own URL there and a template with the club header and bottom divs.

4 hours ago, Fosters said:

e.g.  nodes are only returned when  $club->canRead() returns true, and it works only with nodes, which isn't always the case.

\IPS\Member\Clubs::nodes() will return nodes from the "open" club, so the permission is alredy checked.

3 hours ago, Unlucky said:

Hi @ Adriano Faria  can you give him any pointers?

I was planning a new version for today or tomorrow, according to this and this posts. Due to that, I will need, at least, more 7 days to refactor this specific part of my resource.

Posted

OK, I still think that the node method should return only nodes and not additional pages (that's what it's called nodes() :D ) but I'll go with this way to avoid any further conflicts with your app.

 

A new upgrade of this app with the compabilityfix should be ready later today @Unlucky

Posted

If anybody else is interested into a solution for club tabs...

As mentioned before, the nodes method won't work because it works only with nodes:P

You'll have to use javascript to deal with the tabs and set the tab active

 var tabs = data.tab.parent().parent();
            tabs.find('li>a').each(function(i,v)
           {
               if (v.href.indexOf("sponsors") != -1)
               {
                  $(v).addClass('ipsTabs_activeItem');
               }
           });

 

  • 2 weeks later...
  • 2 weeks later...
Posted
2 hours ago, Fosters said:

 

2 hours ago, Pedro Ibáñez said:

Hi, is there any way to reorder the sponsors?

Not yet, but it's on our todo list

 

Ok thanks and please I need to reorder the sponsor tab...

59ee2af9558a4_Capturadepantalla2017-10-23alas19_45_08.thumb.png.491fada74d73d1b502b50a244028bd9d.png

  • Recently Browsing   0 members

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