I need 12 custom buttons

babygal
Topic Author
Posts: 8
7 years 3 months ago #1923 by babygal
Replied by babygal on topic I need 12 custom buttons

Lodder wrote: Hi babygirl,

As mentioned before, the Social Slider only supports 5 custom slides along with the default slides.

The possible solution above I've just realised will not work as it will result in duplicate element id's and other possible problems.

I'm sorry but you will either have to wait for the Pro version of the extension, try fiddling with the code.

Regards,
Lodder


i did something with the coding and as a result I got like this apps.atoa.com/test/ . i changed the default.php like this
<?php
/**
* @package    JJ_Social_Slider
* @author     JoomJunk <admin@joomjunk.co.uk>
* @copyright  Copyright (C) 2011 - 2013 JoomJunk. All Rights Reserved
* @license    GPL v3 http://www.gnu.org/licenses/gpl-3.0.html
*/

// No direct access
defined('_JEXEC')  or die('Restricted access');

$document = JFactory::getDocument();
$document->addStyleSheet(JURI::root() . "media/mod_social_slider/css/style.css");

if ($params->get('tab', 0) == 0)
{
	$target = ' target="_self"';
}
else
{
	$target = "";
}


echo '<ul id="jj_sl_navigation">';

$sorting = $params->get('sorting', 'sort_1,sort_2,sort_3,sort_4,sort_5,sort_6,sort_7,sort_8,sort_9,sort_10,sort_11,sort_12,sort_13,sort_14,sort_15,sort_16,sort_17,sort_18,sort_19,sort_20');
$order = explode(',', $sorting);

foreach ($order as $item)
{
	$parts = explode('_', $item);
	$key = $slides[$item];
	$uppercase = strtoupper($key);

	if ($params->get($key) == 1)
	{
		if ($parts[1] < 16)
		{
			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php?Itemid=125" target="_self"><span class="jj_social_text">Acoustic</span></a></li>';
        
		}
			
      {
			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php?Itemid=140" target="_self"><span class="jj_social_text">Aerospace</span></a></li>';
        
		}
      {
			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php?Itemid=132" target="_self"><span class="jj_social_text">Bio-Medical</span></a></li>';
        
		}
      {
			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php?Itemid=129" target="_self"><span class="jj_social_text">Chemical</span></a></li>';
        
		}
     
       {
			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php?Itemid=142" target="_self"><span class="jj_social_text">Computer</span></a></li>';
        
		}
       {
			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php?Itemid=127" target="_self"><span class="jj_social_text">Electrical</span></a></li>';
        
		}
       {
			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php?Itemid=123" target="_self"><span class="jj_social_text">Flow</span></a></li>';
        
		}
       {
			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php?Itemid=143" target="_self"><span class="jj_social_text">Industrial</span></a></li>';
        
		}
       {
			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php?Itemid=124" target="_self"><span class="jj_social_text">Mechanical</span></a></li>';
        
		}
       {
			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php?Itemid=126" target="_self"><span class="jj_social_text">Optical</span></a></li>';
        
		}
       {
			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php/structural" target="_self"><span class="jj_social_text">Structural</span></a></li>';
        
		}
       {
			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php?Itemid=122" target="_self"><span class="jj_social_text">Thermal</span></a></li>';
        
		}
      
	}
}

echo '</ul>';

But the slides are repeating.. how can I stop it with the first 12

Please Log in or Create an account to join the conversation.

Lodder
Lodder's Avatar
Posts: 1181
7 years 3 months ago - 7 years 3 months ago #1924 by Lodder
Replied by Lodder on topic I need 12 custom buttons
I've removed all the unnecessary brackets from your code as shown below:
<?php
/**
* @package    JJ_Social_Slider
* @author     JoomJunk <admin@joomjunk.co.uk>
* @copyright  Copyright (C) 2011 - 2013 JoomJunk. All Rights Reserved
* @license    GPL v3 http://www.gnu.org/licenses/gpl-3.0.html
*/
 
// No direct access
defined('_JEXEC')  or die('Restricted access');
 
$document = JFactory::getDocument();
$document->addStyleSheet(JURI::root() . "media/mod_social_slider/css/style.css");
 
if ($params->get('tab', 0) == 0)
{
	$target = ' target="_self"';
}
else
{
	$target = "";
}
 
 
echo '<ul id="jj_sl_navigation">';
 
$sorting = $params->get('sorting', 'sort_1,sort_2,sort_3,sort_4,sort_5,sort_6,sort_7,sort_8,sort_9,sort_10,sort_11,sort_12,sort_13,sort_14,sort_15,sort_16,sort_17,sort_18,sort_19,sort_20');
$order = explode(',', $sorting);
 
foreach ($order as $item)
{
	$parts = explode('_', $item);
	$key = $slides[$item];
	$uppercase = strtoupper($key);
 
	if ($params->get($key) == 1)
	{
		if ($parts[1] < 16)
		{
			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php?Itemid=125" target="_self"><span class="jj_social_text">Acoustic</span></a></li>';

			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php?Itemid=140" target="_self"><span class="jj_social_text">Aerospace</span></a></li>';

			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php?Itemid=132" target="_self"><span class="jj_social_text">Bio-Medical</span></a></li>';

			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php?Itemid=129" target="_self"><span class="jj_social_text">Chemical</span></a></li>';

			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php?Itemid=142" target="_self"><span class="jj_social_text">Computer</span></a></li>';

			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php?Itemid=127" target="_self"><span class="jj_social_text">Electrical</span></a></li>';

			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php?Itemid=123" target="_self"><span class="jj_social_text">Flow</span></a></li>';

			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php?Itemid=143" target="_self"><span class="jj_social_text">Industrial</span></a></li>';

			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php?Itemid=124" target="_self"><span class="jj_social_text">Mechanical</span></a></li>';

			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php?Itemid=126" target="_self"><span class="jj_social_text">Optical</span></a></li>';
 
			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php/structural" target="_self"><span class="jj_social_text">Structural</span></a></li>';

			echo '<li class="youtube"><a href="http://apps.atoa.com/test/index.php?Itemid=122" target="_self"><span class="jj_social_text">Thermal</span></a></li>';
		}
 
	}
}
 
echo '</ul>';

The thing you have to do now is change class="youtube" because this will current always show the youtube icon.

If you add your own custom class, then be sure you associate an image with it in the CSS file.

Do bare in mind that editing the default.php file is not a good idea as when we release an update and you decide to install it, it will override your changes. I would suggest making a Template Override first.

Regards,
Lodder
Last edit: 7 years 3 months ago by Lodder.

Please Log in or Create an account to join the conversation.

babygal
Topic Author
Posts: 8
7 years 3 months ago #1926 by babygal
Replied by babygal on topic I need 12 custom buttons
i did as you have instructed. But even doing that I am getting repeated slides.. have a look at this apps.atoa.com/test

Please Log in or Create an account to join the conversation.

Lodder
Lodder's Avatar
Posts: 1181
7 years 3 months ago #1927 by Lodder
Replied by Lodder on topic I need 12 custom buttons
This is because your code is inside a foreach loop, so foreach item that exists, it's displaying your code.

So lets say you have 5 slides activated in the backend, that's 5*12 ;)

Please Log in or Create an account to join the conversation.

babygal
Topic Author
Posts: 8
7 years 3 months ago #1929 by babygal
Replied by babygal on topic I need 12 custom buttons

Lodder wrote: This is because your code is inside a foreach loop, so foreach item that exists, it's displaying your code.

So lets say you have 5 slides activated in the backend, that's 5*12 ;)

Oh :( Is there any way I can resolve that

Please Log in or Create an account to join the conversation.

Lodder
Lodder's Avatar
Posts: 1181
7 years 3 months ago #1930 by Lodder
Replied by Lodder on topic I need 12 custom buttons
Yes, you can move the code outside the foreach loop.

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum