Jump to content

Club Sponsors Page - Supporttopic


Recommended Posts

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

Link to comment
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
Link to comment
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?

Link to comment
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.

Link to comment

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');
               }
           });

 

Link to comment
  • 2 weeks later...
  • 2 weeks later...
  • Recently Browsing   0 members

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