Keyword
Please note that official support for commercial extensions & templates is provided in the Subscriber Help Desk.
Support requests should ONLY be directed there and require an active subscription plan.
This forum board is to be used for archive purposes and knowledge exchange ONLY.

Slideshow on home page

  • emperor
  • emperor's Avatar Topic Author
  • Offline
  • Premium Member
More
10 years 5 months ago #137169 by emperor
Slideshow on home page was created by emperor
Hi there,

I'd like to change the top slideshow on the home page and create exactly the same like "BusinessOne" template.
To be more accurate, i'd like to have inside a K2 Category the extra fields for URL, image, title and description so i'll be able to lead the slideshow images in other links outside of K2 (exactly like you have on BusinessOne slideshow-K2 Category)

Thank you!

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

More
10 years 5 months ago - 10 years 5 months ago #137170 by Yiota
Replied by Yiota on topic Slideshow on home page
Hello,

First of all you need to create your extrafields and name them like we did in the BusinessOne template. Then through the module parameters you need to disable Image, title and introtext and enable the extrafields.
Edit the Slideshow override located in templates/newsworth/html/mod_k2_content/Slideshow/ and replace the snippets for image, title and introtext with the ones below.

The snippet for the image should be
<?php if($params->get('itemExtraFields') && isset($item->extraFields->Image)): ?> style="background-image:url(<?php echo $item->extraFields->Image->value; ?>);"<?php endif; ?>

for the title and tagline
<?php if($params->get('itemExtraFields') && count($item->extra_fields) && (isset($item->extraFields->Title) || isset($item->extraFields->Tagline))): ?>
	      <div class="moduleItemExtraFields">
	        	       
  	        <?php if($item->extraFields->Title->value): ?>
  	        <h2 class="slideTitle"><?php echo $item->extraFields->Title->value; ?></h2>  
  	        <?php endif; ?>
  	        <?php if($item->extraFields->Tagline->value): ?>
            <div class="moduleItemIntrotext hide-for-small"><?php echo $item->extraFields->Tagline->value; ?></div>  
            <?php endif; ?>
            
	      </div>
	      <?php endif; ?>

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • emperor
  • emperor's Avatar Topic Author
  • Offline
  • Premium Member
More
10 years 5 months ago #137171 by emperor
Replied by emperor on topic Slideshow on home page
I used it and it doesn't work. I'm coming up either with a fast flash or a white home page.

Here is the code:
<?php
/**
 * @version     1.0.0
 * @package     BusinessOne
 * @author      Nuevvo - http://nuevvo.com
 * @copyright   Copyright (c) 2010 - 2013 Nuevvo Webware Ltd. All rights reserved.
 * @license     http://nuevvo.com/license
 */

$count = 1; 

// DO NOT CHANGE ANYTHING BELOW THIS LINE
$document 	= JFactory::getDocument();
$numOfPages = floor(count($items)/$count); 

defined('_JEXEC') or die('Restricted access');
?>

<?php
	$document->addScriptDeclaration("
		\$nuSlider(window).load(function(){
      var viewportHeight = (self.innerWidth || (document.documentElement.clientWidth || (document.body.clientWidth || 0)));
      \$nuSlider('#k2ModuleBox".$module->id." li.item').css({'width':viewportHeight});
       \$nuSlider('#k2ModuleBox".$module->id."').nuSlider( {
           orientation: 'horizontal',
           step:".$count.",
           viewport:".$count.",
           transitionTime : 1500,
           interval : 7000
        });
    });		
		
	");
?>

<div id="k2ModuleBox<?php echo $module->id; ?>" class="k2ItemsBlock<?php if($params->get('moduleclass_sfx')) echo ' '.$params->get('moduleclass_sfx'); ?>">

	<?php if($params->get('itemPreText')): ?>
	<p class="modulePretext"><?php echo $params->get('itemPreText'); ?></p>
	<?php endif; ?>

	<?php if(count($items)): ?>
	<div class="itemsWrapper">  
	  <ul class="items">
	    <?php foreach ($items as $key=>$item):	?>
	    <li class="<?php echo ($key%2) ? "odd" : "even"; if(count($items)==$key+1) echo ' lastItem'; ?> item">
	
	      <!-- Plugins: BeforeDisplay -->
	      <?php echo $item->event->BeforeDisplay; ?>
	
	      <!-- K2 Plugins: K2BeforeDisplay -->
	      <?php echo $item->event->K2BeforeDisplay; ?>
	      
	      <?php /* if($params->get('itemImage') && isset($item->image)): ?>
        <a class="moduleItemImage" href="<?php echo $item->link; ?>" title="<?php echo JText::_('K2_CONTINUE_READING'); ?> &quot;<?php echo K2HelperUtilities::cleanHtml($item->title); ?>&quot;">
          <img src="<?php echo $item->image; ?>" alt="<?php echo K2HelperUtilities::cleanHtml($item->title); ?>"/>
        </a>
        <?php endif; */ ?>
                
        <?php if($params->get('itemImage') && isset($item->image) /* If the module item image is enabled, this block will be used. */): ?>
        <span class="moduleItemImage">
          <img src="<?php echo $item->image; ?>" alt="<?php echo K2HelperUtilities::cleanHtml($item->title); ?>"/>
        </span>
        <?php endif; ?>
        
    <?php if($params->get('itemExtraFields') && isset($item->extraFields->Image)): ?> style="background-image:url(<?php echo $item->extraFields->Image->value; ?>);"<?php endif; ?>
	      
	      <div class="row">
	        
	      <?php if($params->get('itemDateCreated')): ?>
	      <span class="moduleItemDateCreated"><?php echo JHTML::_('date', $item->created, JText::_('K2_DATE_FORMAT_LC2')); ?></span>
	      <?php endif; ?>
	
	      <?php if($params->get('itemCategory')): ?>
	      <?php echo JText::_('K2_IN') ; ?> <a class="moduleItemCategory" href="<?php echo $item->categoryLink; ?>"><?php echo $item->categoryname; ?></a>
	      <?php endif; ?>
	      
	      <?php if($params->get('itemAuthor')): ?>
	      <div class="moduleItemAuthor">
		      <?php echo K2HelperUtilities::writtenBy($item->authorGender); ?>
		      
					<?php if(isset($item->authorLink)): ?>
					<a rel="author" title="<?php echo K2HelperUtilities::cleanHtml($item->author); ?>" href="<?php echo $item->authorLink; ?>"><?php echo $item->author; ?></a>
					<?php else: ?>
					<?php echo $item->author; ?>
					<?php endif; ?>
					
					<?php if($params->get('userDescription')): ?>
					<?php echo $item->authorDescription; ?>
					<?php endif; ?>
				</div>
				<?php endif; ?>    
      
     
		    <?php if($params->get('itemTitle')): ?>	     
	      	<a class="moduleItemTitle" href="<?php echo $item->link; ?>"><?php echo $item->title; ?></a>	      
	      <?php endif; ?>
	      
	      <?php if($params->get('itemAuthorAvatar')): ?>
	      <a class="k2Avatar moduleItemAuthorAvatar" rel="author" href="<?php echo $item->authorLink; ?>">
					<img src="<?php echo $item->authorAvatar; ?>" alt="<?php echo K2HelperUtilities::cleanHtml($item->author); ?>" style="width:<?php echo $avatarWidth; ?>px;height:auto;" />
				</a>
	      <?php endif; ?>
							      
	      <?php if($params->get('itemIntroText')): ?>
      	<div class="moduleItemIntrotext">
      	<?php echo $item->introtext; ?>
      	</div>
      	<?php endif; ?>
		      	
	      <!-- Plugins: AfterDisplayTitle -->
	      <?php echo $item->event->AfterDisplayTitle; ?>
	
	      <!-- K2 Plugins: K2AfterDisplayTitle -->
	      <?php echo $item->event->K2AfterDisplayTitle; ?>
	
	      <!-- Plugins: BeforeDisplayContent -->
	      <?php echo $item->event->BeforeDisplayContent; ?>
	
	      <!-- K2 Plugins: K2BeforeDisplayContent -->
	      <?php echo $item->event->K2BeforeDisplayContent; ?>
		      
	      

	<?php if($params->get('itemExtraFields') && count($item->extra_fields) && (isset($item->extraFields->Title) || isset($item->extraFields->Tagline))): ?>
	      <div class="moduleItemExtraFields">
 
  	        <?php if($item->extraFields->Title->value): ?>
  	        <h2 class="slideTitle"><?php echo $item->extraFields->Title->value; ?></h2>  
  	        <?php endif; ?>
  	        <?php if($item->extraFields->Tagline->value): ?>
            <div class="moduleItemIntrotext hide-for-small"><?php echo $item->extraFields->Tagline->value; ?></div>  
            <?php endif; ?>
 
	      </div>
	      <?php endif; ?>
            
	      </div>
	      <?php endif; ?>
	
	      <div class="clr"></div>
	
	      <?php if($params->get('itemVideo')): ?>
	      <div class="moduleItemVideo">
	      	<?php echo $item->video ; ?>
	      	<span class="moduleItemVideoCaption"><?php echo $item->video_caption ; ?></span>
	      	<span class="moduleItemVideoCredits"><?php echo $item->video_credits ; ?></span>
	      </div>
	      <?php endif; ?>
	
	      <div class="clr"></div>
	
	      <!-- Plugins: AfterDisplayContent -->
	      <?php echo $item->event->AfterDisplayContent; ?>
	
	      <!-- K2 Plugins: K2AfterDisplayContent -->
	      <?php echo $item->event->K2AfterDisplayContent; ?>
	
	
	      <?php if($params->get('itemTags') && count($item->tags)>0): ?>
        <div class="moduleItemTags">
          <span><i class="iconFont"></i><?php //echo JText::_('K2_TAGS'); ?></span>
          <?php foreach ($item->tags as $tagCounter=>$tag): ?>
          <?php if (($tagCounter+1)==count($item->tags)): ?>  
          <a href="<?php echo $tag->link; ?>"><?php echo $tag->name; ?></a>
          <?php else: ?>
          <a href="<?php echo $tag->link; ?>"><?php echo $tag->name; ?>, </a>  
          <?php endif; ?>  
          <?php endforeach; ?>
        </div>
        <?php endif; ?>
	
	      <?php if($params->get('itemAttachments') && count($item->attachments)): ?>
				<div class="moduleAttachments">
					<?php foreach ($item->attachments as $attachment): ?>
					<a title="<?php echo K2HelperUtilities::cleanHtml($attachment->titleAttribute); ?>" href="<?php echo $attachment->link; ?>"><?php echo $attachment->title; ?></a>
					<?php endforeach; ?>
				</div>
	      <?php endif; ?>
	
				<?php if($params->get('itemCommentsCounter') && $componentParams->get('comments')): ?>		
					<?php if(!empty($item->event->K2CommentsCounter)): ?>
						<!-- K2 Plugins: K2CommentsCounter -->
						<?php echo $item->event->K2CommentsCounter; ?>
					<?php else: ?>
						<?php if($item->numOfComments>0): ?>
						<a class="moduleItemComments" href="<?php echo $item->link.'#itemCommentsAnchor'; ?>">
							<?php echo $item->numOfComments; ?> <?php if($item->numOfComments>1) echo JText::_('K2_COMMENTS'); else echo JText::_('K2_COMMENT'); ?>
						</a>
						<?php else: ?>
						<a class="moduleItemComments" href="<?php echo $item->link.'#itemCommentsAnchor'; ?>">
							<?php echo JText::_('K2_BE_THE_FIRST_TO_COMMENT'); ?>
						</a>
						<?php endif; ?>
					<?php endif; ?>
				<?php endif; ?>
	
				<?php if($params->get('itemHits')): ?>
				<span class="moduleItemHits">
					<?php echo JText::_('K2_READ'); ?> <?php echo $item->hits; ?> <?php echo JText::_('K2_TIMES'); ?>
				</span>
				<?php endif; ?>
	
				<?php if($params->get('itemReadMore') && $item->fulltext): ?>
				<a class="moduleItemReadMore" href="<?php echo $item->link; ?>">
					<?php echo JText::_('K2_READ_MORE'); ?>
				</a>
				<?php endif; ?>
	
	      <!-- Plugins: AfterDisplay -->
	      <?php echo $item->event->AfterDisplay; ?>
	
	      <!-- K2 Plugins: K2AfterDisplay -->
	      <?php echo $item->event->K2AfterDisplay; ?>
	
	      <div class="clr"></div>
	      </div>
	    </li>
	    <?php endforeach; ?>
	  </ul>
	</div>
	<?php endif; ?>


	<div class="nuSliderPagination">
		<ul>
			<li><span class="prev"><a class="previousButton"> </a></span></li>
			<?php /* foreach($items as $key => $item):?>
				<?php if(($key)%$count == 0){ $class=' class="show-on-mobile"';} else {$class=' class="hidden"';}?>
				<?php if($key == 0){ $buttonClass='navigationButton navigationButtonActive';} else {$buttonClass='navigationButton';}?>
			<li<?php echo $class; ?>><a class="<?php echo $buttonClass;?>"></a></li>
			<?php endforeach; */ ?>
			<li><span class="next"><a class="nextButton"> </a></span></li>
		</ul>
	</div>


	<?php if($params->get('itemCustomLink')): ?>
	<a class="moduleCustomLink" href="<?php echo $params->get('itemCustomLinkURL'); ?>" title="<?php echo K2HelperUtilities::cleanHtml($itemCustomLinkTitle); ?>"><?php echo $itemCustomLinkTitle; ?></a>
	<?php endif; ?>

	<?php if($params->get('feed')): ?>
	<div class="k2FeedIcon">
		<a href="<?php echo JRoute::_('index.php?option=com_k2&view=itemlist&format=feed&moduleID='.$module->id); ?>" title="<?php echo JText::_('K2_SUBSCRIBE_TO_THIS_RSS_FEED'); ?>">
			<span><?php echo JText::_('K2_SUBSCRIBE_TO_THIS_RSS_FEED'); ?></span>
		</a>
		<div class="clr"></div>
	</div>
	<?php endif; ?>

</div>

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

More
10 years 5 months ago #137172 by Yiota
Replied by Yiota on topic Slideshow on home page
I didn't have to take the businessOne slideshow override for the Newsworth slideshow. The structure is different between the files.
You had to embed the snippets I provided in the override of Newsworth.
Try with this file


JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Attachments:

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

  • emperor
  • emperor's Avatar Topic Author
  • Offline
  • Premium Member
More
10 years 5 months ago #137173 by emperor
Replied by emperor on topic Slideshow on home page
Yota hi again.

I put your file and i'm getting the following errors:
\slideshow\default.php on line 94 (Undefined property.stdClass:$Title in) and on same line (Trying to get property of non-object in)

WHEN though i disable the sidebar modules error is gone.
So probably this error have something to do with the other error on my other post.

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

  • emperor
  • emperor's Avatar Topic Author
  • Offline
  • Premium Member
More
10 years 5 months ago #137174 by emperor
Replied by emperor on topic Slideshow on home page
If you look at it thought seems that there is a problem on the upper left corner i have this: )> meaning you missed something on the php.

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

More
10 years 5 months ago #137175 by Yiota
Replied by Yiota on topic Slideshow on home page
Try with this file to check it out.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Attachments:

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

More
10 years 5 months ago #137176 by Yiota
Replied by Yiota on topic Slideshow on home page
Also try with this:

Attachment not found


JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Attachments:

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

  • emperor
  • emperor's Avatar Topic Author
  • Offline
  • Premium Member
More
10 years 5 months ago #137177 by emperor
Replied by emperor on topic Slideshow on home page
Works, thanks!

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


Powered by Kunena Forum