- Posts: 1421
- Thank you received: 234
Slider for joomla 3
9 years 2 months ago - 9 years 1 week ago #3593
by redactie
Slider for joomla 3 was created by redactie
Below is a basic jquery based slider for price ranges.
It can be seen on the demo website
The slider is very basic. Next step would be to have the menu to the left and the pagination move along
It can be seen on the demo website
The slider is very basic. Next step would be to have the menu to the left and the pagination move along
Code:
<?php
$dataitems=modDatamenuHelper::getMinMax($params);
$min=floor($dataitems[0]['min']);
$max=ceil($dataitems[0]['max']);
$count=$dataitems[0]['c'];
if ( $count > 10 ) {
$url=$params->get( 'baselink', '' );
if ( $min >= $max ) { return; }
for ($v=1;$v<=9;$v++) { if ($x=$params->get("q$v",'')) { $url .="&q$v=".urlencode($x); } }
if ( $x=$params->get("q",'')) { $url .="&q=".urlencode($x); }
#add sort options
$url .='&format=raw&ajax=1&tmpl=component';
$doc =& JFactory::getDocument();
$doc->addStyleSheet( 'https://code.jquery.com/ui/1.11.2/themes/ui-lightness/jquery-ui.css');
$doc->addScript('https://code.jquery.com/ui/1.11.2/jquery-ui.min.js');
?>
<script>
jQuery(function() {
jQuery( "#slider-range" ).slider({
range: true,
min: <?php echo $min;?>,
max: <?php echo $max;?>,
values: [ <?php echo $min;?>,<?php echo $max;?> ],
slide: function( event, ui ) {
jQuery( "#amount" ).val( "Van " + ui.values[ 0 ] + " tot " + ui.values[ 1 ] +' Euro');
},
stop: function( event, ui ) {
url='<?php echo $url?>'+'&min='+ui.values[ 0 ]+'&max='+ui.values[ 1 ];
jQuery.get(url, function(data) {
if( data) {
jQuery('#main').html(data);
jQuery("img").show().lazyload({effect : "slideDown" });
jQuery('#main').scroll();
} else {
jQuery('#main').html('<h2>Geen producten gevonden voor deze prijzen</h2>');
}
});
}
});
jQuery( "#amount" ).val( "van " + jQuery( "#slider-range" ).slider( "values", 0 ) +
" tot " + jQuery( "#slider-range" ).slider( "values", 1 ) + ' Euro');
});
</script>
<label for="amount">Prijs :</label>
<input type="text" id="amount" style="border: 0; color: #f6931f; font-weight: bold;" />
<div style="width:50%;margin:0px auto" id="slider-range"></div>
<?php } ?>
- create a file slider_custom.php in YOURTEMPLATE/html/mod_datamenu
- (or in modules/mod_datamenu/tmpl but use a different name like myslider_cusom.php, the name must end with _custom.php)
- customize the strings
- customize the target id's ( for example for the flexbox layout the #com_datafeeds should be #products)
Last edit: 9 years 1 week ago by redactie.
Please Log in to join the conversation.
9 years 2 months ago #3594
by bubi739
Replied by bubi739 on topic Slider for joomla 3
Thank you so mucho for this contribution. I understand that I put the code into a template?
Could do this code with the "Select1" field, for example???
Could do this code with the "Select1" field, for example???
Please Log in to join the conversation.
9 years 2 months ago #3595
by redactie
Replied by redactie on topic Slider for joomla 3
I added some instructions.
I don't understand your 'select1', this slider uses the price, the component has a helper function to get the min and max value.
I don't understand your 'select1', this slider uses the price, the component has a helper function to get the min and max value.
Please Log in to join the conversation.
9 years 2 months ago #3596
by bubi739
Replied by bubi739 on topic Slider for joomla 3
Excuse me for my english, i'm from Spain.
I would like to do the same but with other field, for example, choose a category travel by field "destination" and this field is "Select1" or in restaurans by the field "tupe of cuisine". It's posible?
Thank you
I would like to do the same but with other field, for example, choose a category travel by field "destination" and this field is "Select1" or in restaurans by the field "tupe of cuisine". It's posible?
Thank you
Please Log in to join the conversation.
9 years 2 months ago #3597
by redactie
Replied by redactie on topic Slider for joomla 3
Sorry
you want to slide categories?
As I jump to a different category the slider adjust it's price ranges:
demos.affiliatefeeds.nl/shop/Spanje.html
what this slider doesn't do is adjusting the menu's as you slide
that's what i'm looking into here :
j3.gryla.biz/normaal
problem is that creating the menu's using a pricerange takes a lot of time to query
you want to slide categories?
As I jump to a different category the slider adjust it's price ranges:
demos.affiliatefeeds.nl/shop/Spanje.html
what this slider doesn't do is adjusting the menu's as you slide
that's what i'm looking into here :
j3.gryla.biz/normaal
problem is that creating the menu's using a pricerange takes a lot of time to query
Please Log in to join the conversation.
9 years 2 months ago #3598
by bubi739
Replied by bubi739 on topic Slider for joomla 3
This is exactly what I'm looking for my serious an interesting improvement for my website.
j3.gryla.biz/normaal
My site has restaurants, hotels, etc ..
For example: www.unanocheinolvidable.com/index.php/restaurantes
And I have to duplicate the menu making a SQL filter for each city or each type of food or hotel. For me would be perfect to have a prefilter.
If you can help me to implement this I would be very grateful.
Thank you so much
j3.gryla.biz/normaal
My site has restaurants, hotels, etc ..
For example: www.unanocheinolvidable.com/index.php/restaurantes
And I have to duplicate the menu making a SQL filter for each city or each type of food or hotel. For me would be perfect to have a prefilter.
If you can help me to implement this I would be very grateful.
Thank you so much
Please Log in to join the conversation.
Time to create page: 0.391 seconds