Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

If you'd like to collapse... boxes


beerbee

Recommended Posts

Hi,

I always like to collapse... things. So let's say we have two boxes on the left: categories and information.

I want categories to be collapsed when browsing through my info pages and the other way around.

First thing to do your

catalog/includes/modules/boxes/example.php

add global $PHP_SELF  to function execute - example:

    function execute() {
      global $oscTemplate, $languages_id, $cPath_array, $datas, $PHP_SELF;

Then you'd have to alter the correspondent template file in e.g. catalog/includes/modules/boxes/templates/example.php

<div class="panel panel-default">
	
  <?php  if (basename($PHP_SELF) != 'example.php')
  {
//This collapses example if not on example.php the logic can be used the other way around if (basename($PHP_SELF) == 'some_other.php')
// collapes if not on defined other some_other.php || even_another.php and so on..

?>
  
  	

<div class="panel-heading" data-toggle="collapse" data-target="#example" aria-expanded="false" aria-controls="example"><span role="button"><?php echo MODULE_BOXES_EXAMPLE_BOX_TITLE; ?></span></div>
<div class="panel-body collapse" id="example">
<?php echo $datas; ?></div>
	<?php
}

else {
?>

<div class="panel-heading gradient"><?php echo MODULE_BOXES_EXAMPLE_BOX_TITLE; ?></div>
<div class="panel-body ContentBody"><?php echo $datas; ?></div>
  <?php
}
?> 
</div>

"example" should be exchanged then for the actual box files that should collapse or not.

Best regards

Christoph

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...