0
Welcome Guest! Login
0 items Join Now

Roksprocket Lists Closed By Default

  • Roksprocket Lists Closed By Default

    Posted 10 years 5 months ago
    • Lists seems like a good way to create a list of system requirements.

      However, it looks kind of dorky if the top one is open by default. Id like to all of them to be closed by default, then let the user open / close them how they want. Is there a way to do this?
    • Best regards,

      Lynn Fredricks
      Download Valentina Studio database management for free (macOS, Windows & Linux)
      www.valentina-db.com
  • Re: Roksprocket Lists Closed By Default

    Posted 10 years 5 months ago
    • I am looking for the same exact thing. Seems strange that this cannot done. It causes a real issue for me since the first item is stretches beyond the fold and the close button doesn't respond on the OPEN item.

      If no one answers or I cannot figure this out. I know for a fact that Widgetkit from YOOtheme works like needed.
  • Re: Roksprocket Lists Closed By Default

    Posted 10 years 5 months ago
    • Hi,

      Sorry for my English,

      I think I solved your problem.

      Firstly You have to find such a file: templates/rt_voxel/roksprocket/layouts/lists/themes/default/item.php

      Secondly You need to in this file find this piece of code:
      <li <?php echo $class; ?>  data-lists-item>
      	<?php if ($item->custom_can_show_title): ?>
      	<h4 class="sprocket-lists-title" <?php if ($parameters->get('lists_enable_accordion')): ?> padding<?php endif; ?>" data-lists-toggler>
      		<span>
      		<?php if ($item->custom_can_have_link): ?><a href="<?php echo $item->getPrimaryLink()->getUrl(); ?>"><?php endif; ?>
      			<?php echo $item->getTitle();?>
      		<?php if ($item->custom_can_have_link): ?></a><?php endif; ?>
      		<?php if ($parameters->get('lists_enable_accordion')): ?><span class="indicator" ><span></span></span><?php endif; ?>
      		</span>
      	</h4>
      	<?php endif; ?>
      	<div class="sprocket-lists-item"  data-lists-content >
      		<div class="sprocket-padding <?php if (strlen($item->custom_tags)) : ?>tags-padding<?php endif; ?>">
      			<?php if ($item->getPrimaryImage()) :?>
      			<img src="<?php echo $item->getPrimaryImage()->getSource(); ?>" alt="" class="sprocket-lists-image" />
      			<?php endif; ?>
      			<?php echo $item->getText(); ?>
      			<?php if ($item->getPrimaryLink()) : ?>
      			<a href="<?php echo $item->getPrimaryLink()->getUrl(); ?>" class="sprocket-readmore"><span><?php rc_e('READ_MORE'); ?> +</span></a>
      			<?php endif; ?>
      		</div>
      	</div>
      	<div class="clear"></div>
      	<?php if (strlen($item->custom_tags)) : ?>
      		<span class="sprocket-corner-badge"></span>
      		<span class="sprocket-badge-icon"></span>
      	<?php endif; ?>
      </li>

      and change
      <h4 class="sprocket-lists-title" <?php if ($parameters->get('lists_enable_accordion')): ?> padding<?php endif; ?>" data-lists-toggler>

      to:
      <h4 class="sprocket-lists-title" onclick="display_more();" <?php if ($parameters->get('lists_enable_accordion')): ?> padding<?php endif; ?>" data-lists-toggler>

      That is insert into <h4 ...> this function: onclick="display_more();"

      At the very bottom of the file You have to insert this code:
      <script language="javascript" type="text/javascript">
      function hide()
      {
      	var lista1 = document.getElementsByClassName("sprocket-lists-item");
      var i;
      
      	for(i=0;i<=lista1.length;i++)
      	{
      		lista1[i].style.display = "none";
      	}
      }
      window.onload = hide;
      function display_more()
      {
      var lista1 = document.getElementsByClassName("sprocket-lists-item");
      var i;
      
      	for(i=0;i<=lista1.length;i++)
      	{
      		lista1[i].style.display = "block";
      	}
      	
      }
      </script>

      The disadvantage is that it works on every type of module list. But it is some solution

      Greetings
    • scott's Avatar
    • scott
    • Newbie
    • Posts: 4
    • Thanks: 1

    Re: Roksprocket Lists Closed By Default

    Posted 9 years 11 months ago
    • Assuming you are using the default theme:

      Edit
      /components/com_roksprocket/layouts/lists/themes/default.js

      In the function
      _setAccordion: function(container){

      Add
      alwaysHide: true,

      To the parameters

      This will result in 2 things:

      1. all closed by default
      2. the close button will now work
    • JohnH's Avatar
    • JohnH
    • Newbie
    • Posts: 5
    • Thanks: 0

    Re: Roksprocket Lists Closed By Default

    Posted 9 years 9 months ago
    • How does one achieve the all items closed in roksproket "Sliders" with the accordion template.

      I can't figure it out. I would love to have it load up with all items closed!

Time to create page: 0.088 seconds