Nicescroll 3 Joomla plugin

Al Duccino
Topic Author
Posts: 8
7 years 1 week ago - 7 years 1 week ago #139 by Al Duccino
Replied by Al Duccino on topic Nicescroll 3 Joomla plugin
You are most welcome, that was the least I could do for the amazing social slider module.

I just tried your code, but it got an error :
Parse error: syntax error, unexpected '/>' in /home/alduccin/public_html/templates/alduccino/layouts/template.php on line 16
Last edit: 7 years 1 week ago by Al Duccino.

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

George
George's Avatar
Posts: 134
7 years 1 week ago #140 by George
Replied by George on topic Nicescroll 3 Joomla plugin
What is on line 16?

George

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

Al Duccino
Topic Author
Posts: 8
7 years 1 week ago #141 by Al Duccino
Replied by Al Duccino on topic Nicescroll 3 Joomla plugin
Line 16 was the fist line of your code.

My bad, I copied your first version of the code the /> was causing the error.


Now with the corrected version, it doesn't load the jquery library for the script.
Maybe it is caused because it is in a template file ? I have no idea.

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

George
George's Avatar
Posts: 134
7 years 1 week ago #142 by George
Replied by George on topic Nicescroll 3 Joomla plugin
No it definitely should load in the template file. Try adding the very first line above the template's doctype - so it's basically the first thing to load after the
defined('_JEXEC') or die;
part. Just to confirm - you are using Joomla 3.0? Because this code will only work in Joomla 3.0

George

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

Al Duccino
Topic Author
Posts: 8
7 years 1 week ago - 7 years 1 week ago #143 by Al Duccino
Replied by Al Duccino on topic Nicescroll 3 Joomla plugin
Yes i'm using Joomla 3.0.3.

Here is actual entire code of my file :
<?php
// get template configuration
include($this['path']->path('layouts:template.config.php'));
	
?>
<!DOCTYPE HTML>
<html lang="<?php echo $this['config']->get('language'); ?>" dir="<?php echo $this['config']->get('direction'); ?>">
<head>
<?php JHtml::_('jquery.framework'); ?>
<script type='text/javascript' src="/templates/alduccino/js/jquery.nicescroll.js"></script>
<script type='text/javascript'>
(function($){
  $(document).ready(
      function() { 
      $("html").niceScroll({
        cursorcolor: "#9DDAFF",
        cursorwidth: 5,
        cursorborder: "1px solid #000000",
        mousescrollstep: 50
      });
  });
})(jQuery);
</script>
<?php echo $this['template']->render('head'); ?>
</head>

<body id="page" class="page <?php echo $this['config']->get('body_classes'); ?>" data-config='<?php echo $this['config']->get('body_config', '{}'); ?>'>
	
	<?php if ($this['modules']->count('absolute')) : ?>
	<div id="absolute">
		<?php echo $this['modules']->render('absolute'); ?>
	</div>
	<?php endif; ?>
	
	<div id="block-toolbar">
		<div class="wrapper">
	
			<div id="toolbar" class="grid-block">
		
				<?php if ($this['modules']->count('toolbar-l') || $this['config']->get('date')) : ?>
				<div class="float-left">
				
					<?php if ($this['config']->get('date')) : ?>
					<time style="margin-top:2px;" datetime="<?php echo $this['config']->get('datetime'); ?>"><?php echo $this['config']->get('actual_date'); ?></time>
					<?php endif; ?>
				
					<?php echo $this['modules']->render('toolbar-l'); ?>
					
				</div>
				<?php endif; ?>
					
				<?php if ($this['modules']->count('toolbar-r')) : ?>
				<div class="float-right"><?php echo $this['modules']->render('toolbar-r'); ?></div>
				<?php endif; ?>
				
			</div>
			
		</div>
	</div>
			
	<div id="block-header"><div>
		<div class="wrapper">

			<?php if ($this['modules']->count('login')) : ?>
			<div id="login"><?php echo $this['modules']->render('login'); ?></div>
			<?php endif; ?>

			<?php if ($this['modules']->count('bubble')) : ?>
			<div id="bubble"><?php echo $this['modules']->render('bubble'); ?></div>
			<?php endif; ?>
		
			<header id="header">
		
				<div id="headerbar" class="grid-block">
				
					<?php if ($this['modules']->count('logo')) : ?>	
					<a id="logo" href="<?php echo $this['config']->get('site_url'); ?>"><?php echo $this['modules']->render('logo'); ?></a>
					<?php endif; ?>
					
					<?php if($this['modules']->count('headerbar')) : ?>
					<div class="left"><?php echo $this['modules']->render('headerbar'); ?></div>
					<?php endif; ?>
					
				</div>
		
				<div id="menubar" class="grid-block">
					
					<?php  if ($this['modules']->count('menu')) : ?>
					<nav id="menu"><?php echo $this['modules']->render('menu'); ?></nav>
					<?php endif; ?>
		
					<?php if ($this['modules']->count('search')) : ?>
					<div id="search"><?php echo $this['modules']->render('search'); ?></div>
					<?php endif; ?>
					
				</div>
			
				<?php if ($this['modules']->count('banner')) : ?>
				<div id="banner"><?php echo $this['modules']->render('banner'); ?></div>
				<?php endif;  ?>
			
			</header>
		
		</div>
	</div></div>
			
	<div id="block-main"><div><div>
		<div class="wrapper">
					
			<?php if ($this['modules']->count('top-a')) : ?>
			<section id="top-a" class="grid-block"><?php echo $this['modules']->render('top-a', array('layout'=>$this['config']->get('top-a'))); ?></section>
			<?php endif; ?>
			
			<?php if ($this['modules']->count('top-b')) : ?>
			<section id="top-b" class="grid-block"><?php echo $this['modules']->render('top-b', array('layout'=>$this['config']->get('top-b'))); ?></section>
			<?php endif; ?>
			
			<?php if ($this['modules']->count('innertop + innerbottom + sidebar-a + sidebar-b') || $this['config']->get('system_output')) : ?>
			<div id="main" class="grid-block">
			
				<div id="maininner" class="grid-box">
				
					<?php if ($this['modules']->count('innertop')) : ?>
					<section id="innertop" class="grid-block"><?php echo $this['modules']->render('innertop', array('layout'=>$this['config']->get('innertop'))); ?></section>
					<?php endif; ?>
		
					<?php if ($this['config']->get('system_output')) : ?>
					<section id="content"><div class="grid-block" style="min-height:585px;">
					
						<?php if ($this['modules']->count('breadcrumbs')) : ?>
						<section id="breadcrumbs"><?php echo $this['modules']->render('breadcrumbs'); ?></section>
						<?php endif; ?>
						
			<?php if ($this['modules']->count('menu-content')) : ?>
			<div id="menu-content"><?php echo $this['modules']->render('menu-content'); ?></div>
			<?php endif; ?>

						<?php echo $this['template']->render('content'); ?>
						
					</div></section>
					<?php endif; ?>
		
					<?php if ($this['modules']->count('innerbottom')) : ?>
					<section id="innerbottom" class="grid-block"><?php echo $this['modules']->render('innerbottom', array('layout'=>$this['config']->get('innerbottom'))); ?></section>
					<?php endif; ?>
		
				</div>
				<!-- maininner end -->
				
				<?php if ($this['modules']->count('sidebar-a')) : ?>
				<aside id="sidebar-a" class="grid-box"><?php echo $this['modules']->render('sidebar-a', array('layout'=>'stack')); ?></aside>
				<?php endif; ?>
				
				<?php if ($this['modules']->count('sidebar-b')) : ?>
				<aside id="sidebar-b" class="grid-box"><?php echo $this['modules']->render('sidebar-b', array('layout'=>'stack')); ?></aside>
				<?php endif; ?>
		
			</div>
			<?php endif; ?>
			<!-- main end -->
		
			<?php if ($this['modules']->count('bottom-a')) : ?>
			<section id="bottom-a" class="grid-block"><?php echo $this['modules']->render('bottom-a', array('layout'=>$this['config']->get('bottom-a'))); ?></section>
			<?php endif; ?>
			
		</div>
	</div></div></div>
			
	<?php if ($this['modules']->count('bottom-b')) : ?>
	<div id="block-bottom"><div>
		<div class="wrapper clearfix">
	
			<section id="bottom-b" class="grid-block"><?php echo $this['modules']->render('bottom-b', array('layout'=>$this['config']->get('bottom-b'))); ?></section>
		
		</div>
	</div></div>
	<?php endif; ?>
	
		
	<?php if ($this['modules']->count('footer + debug') || $this['config']->get('warp_branding')) : ?>
	<div id="block-footer" style="width:994px; margin:10px auto 0;">
		<div class="wrapper">
		
			<footer id="footer" class="">
		
				<?php if ($this['config']->get('totop_scroller')) : ?>
				<a id="totop-scroller" href="#page"></a>
				<?php endif; ?>

			<?php if ($this['modules']->count('footer2')) : ?>
			<div id="footer2"><?php echo $this['modules']->render('footer2'); ?></div>
			<?php endif; ?>
		
				<?php
					echo $this['modules']->render('footer');
					$this->output('warp_branding');
					echo $this['modules']->render('debug');
				?>
		
			</footer>
		
		</div>
	</div>
	<?php endif; ?>
	
	
	<?php echo $this->render('footer'); ?>
	
</body>
</html>
Last edit: 7 years 1 week ago by Al Duccino.

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

George
George's Avatar
Posts: 134
7 years 1 week ago #144 by George
Replied by George on topic Nicescroll 3 Joomla plugin
Try it with the headers moved above the script includes. this is because the Joomla insertation of the jQuery is done in the
<jdoc:include type="head" />
part of the template. In this case (I think yootheme?). This is done in
<?php echo $this['template']->render('head'); ?>
- hence why before your code wasn't seeing a jQuery file! Try the file as below :)
<?php
// get template configuration
include($this['path']->path('layouts:template.config.php'));
 
?>
<!DOCTYPE HTML>
<html lang="<?php echo $this['config']->get('language'); ?>" dir="<?php echo $this['config']->get('direction'); ?>">
<head>
<?php JHtml::_('jquery.framework'); ?>
<?php echo $this['template']->render('head'); ?>
<script type='text/javascript' src="/templates/alduccino/js/jquery.nicescroll.js"></script>
<script type='text/javascript'>
(function($){
  $(document).ready(
      function() { 
      $("html").niceScroll({
        cursorcolor: "#9DDAFF",
        cursorwidth: 5,
        cursorborder: "1px solid #000000",
        mousescrollstep: 50
      });
  });
})(jQuery);
</script>
</head>
 
<body id="page" class="page <?php echo $this['config']->get('body_classes'); ?>" data-config='<?php echo $this['config']->get('body_config', '{}'); ?>'>
 
	<?php if ($this['modules']->count('absolute')) : ?>
	<div id="absolute">
		<?php echo $this['modules']->render('absolute'); ?>
	</div>
	<?php endif; ?>
 
	<div id="block-toolbar">
		<div class="wrapper">
 
			<div id="toolbar" class="grid-block">
 
				<?php if ($this['modules']->count('toolbar-l') || $this['config']->get('date')) : ?>
				<div class="float-left">
 
					<?php if ($this['config']->get('date')) : ?>
					<time style="margin-top:2px;" datetime="<?php echo $this['config']->get('datetime'); ?>"><?php echo $this['config']->get('actual_date'); ?></time>
					<?php endif; ?>
 
					<?php echo $this['modules']->render('toolbar-l'); ?>
 
				</div>
				<?php endif; ?>
 
				<?php if ($this['modules']->count('toolbar-r')) : ?>
				<div class="float-right"><?php echo $this['modules']->render('toolbar-r'); ?></div>
				<?php endif; ?>
 
			</div>
 
		</div>
	</div>
 
	<div id="block-header"><div>
		<div class="wrapper">
 
			<?php if ($this['modules']->count('login')) : ?>
			<div id="login"><?php echo $this['modules']->render('login'); ?></div>
			<?php endif; ?>
 
			<?php if ($this['modules']->count('bubble')) : ?>
			<div id="bubble"><?php echo $this['modules']->render('bubble'); ?></div>
			<?php endif; ?>
 
			<header id="header">
 
				<div id="headerbar" class="grid-block">
 
					<?php if ($this['modules']->count('logo')) : ?>	
					<a id="logo" href="<?php echo $this['config']->get('site_url'); ?>"><?php echo $this['modules']->render('logo'); ?></a>
					<?php endif; ?>
 
					<?php if($this['modules']->count('headerbar')) : ?>
					<div class="left"><?php echo $this['modules']->render('headerbar'); ?></div>
					<?php endif; ?>
 
				</div>
 
				<div id="menubar" class="grid-block">
 
					<?php  if ($this['modules']->count('menu')) : ?>
					<nav id="menu"><?php echo $this['modules']->render('menu'); ?></nav>
					<?php endif; ?>
 
					<?php if ($this['modules']->count('search')) : ?>
					<div id="search"><?php echo $this['modules']->render('search'); ?></div>
					<?php endif; ?>
 
				</div>
 
				<?php if ($this['modules']->count('banner')) : ?>
				<div id="banner"><?php echo $this['modules']->render('banner'); ?></div>
				<?php endif;  ?>
 
			</header>
 
		</div>
	</div></div>
 
	<div id="block-main"><div><div>
		<div class="wrapper">
 
			<?php if ($this['modules']->count('top-a')) : ?>
			<section id="top-a" class="grid-block"><?php echo $this['modules']->render('top-a', array('layout'=>$this['config']->get('top-a'))); ?></section>
			<?php endif; ?>
 
			<?php if ($this['modules']->count('top-b')) : ?>
			<section id="top-b" class="grid-block"><?php echo $this['modules']->render('top-b', array('layout'=>$this['config']->get('top-b'))); ?></section>
			<?php endif; ?>
 
			<?php if ($this['modules']->count('innertop + innerbottom + sidebar-a + sidebar-b') || $this['config']->get('system_output')) : ?>
			<div id="main" class="grid-block">
 
				<div id="maininner" class="grid-box">
 
					<?php if ($this['modules']->count('innertop')) : ?>
					<section id="innertop" class="grid-block"><?php echo $this['modules']->render('innertop', array('layout'=>$this['config']->get('innertop'))); ?></section>
					<?php endif; ?>
 
					<?php if ($this['config']->get('system_output')) : ?>
					<section id="content"><div class="grid-block" style="min-height:585px;">
 
						<?php if ($this['modules']->count('breadcrumbs')) : ?>
						<section id="breadcrumbs"><?php echo $this['modules']->render('breadcrumbs'); ?></section>
						<?php endif; ?>
 
			<?php if ($this['modules']->count('menu-content')) : ?>
			<div id="menu-content"><?php echo $this['modules']->render('menu-content'); ?></div>
			<?php endif; ?>
 
						<?php echo $this['template']->render('content'); ?>
 
					</div></section>
					<?php endif; ?>
 
					<?php if ($this['modules']->count('innerbottom')) : ?>
					<section id="innerbottom" class="grid-block"><?php echo $this['modules']->render('innerbottom', array('layout'=>$this['config']->get('innerbottom'))); ?></section>
					<?php endif; ?>
 
				</div>
				<!-- maininner end -->
 
				<?php if ($this['modules']->count('sidebar-a')) : ?>
				<aside id="sidebar-a" class="grid-box"><?php echo $this['modules']->render('sidebar-a', array('layout'=>'stack')); ?></aside>
				<?php endif; ?>
 
				<?php if ($this['modules']->count('sidebar-b')) : ?>
				<aside id="sidebar-b" class="grid-box"><?php echo $this['modules']->render('sidebar-b', array('layout'=>'stack')); ?></aside>
				<?php endif; ?>
 
			</div>
			<?php endif; ?>
			<!-- main end -->
 
			<?php if ($this['modules']->count('bottom-a')) : ?>
			<section id="bottom-a" class="grid-block"><?php echo $this['modules']->render('bottom-a', array('layout'=>$this['config']->get('bottom-a'))); ?></section>
			<?php endif; ?>
 
		</div>
	</div></div></div>
 
	<?php if ($this['modules']->count('bottom-b')) : ?>
	<div id="block-bottom"><div>
		<div class="wrapper clearfix">
 
			<section id="bottom-b" class="grid-block"><?php echo $this['modules']->render('bottom-b', array('layout'=>$this['config']->get('bottom-b'))); ?></section>
 
		</div>
	</div></div>
	<?php endif; ?>
 
 
	<?php if ($this['modules']->count('footer + debug') || $this['config']->get('warp_branding')) : ?>
	<div id="block-footer" style="width:994px; margin:10px auto 0;">
		<div class="wrapper">
 
			<footer id="footer" class="">
 
				<?php if ($this['config']->get('totop_scroller')) : ?>
				<a id="totop-scroller" href="#page"></a>
				<?php endif; ?>
 
			<?php if ($this['modules']->count('footer2')) : ?>
			<div id="footer2"><?php echo $this['modules']->render('footer2'); ?></div>
			<?php endif; ?>
 
				<?php
					echo $this['modules']->render('footer');
					$this->output('warp_branding');
					echo $this['modules']->render('debug');
				?>
 
			</footer>
 
		</div>
	</div>
	<?php endif; ?>
 
 
	<?php echo $this->render('footer'); ?>
 
</body>
</html>

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

Powered by Kunena Forum