Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/06/2015, 00:03
Avatar de Larenz
Larenz
Colaborador
 
Fecha de Ingreso: enero-2007
Ubicación: Nicaragua
Mensajes: 1.398
Antigüedad: 17 años, 11 meses
Puntos: 55
Respuesta: No puedo crear un div que cargue el Module suffix en Joomla 3

Puedes crear tu propio archivo modules.php y guardarlo en tuplantilla/html/modules.php. Ese archivo lo encuentras en:

plugins/system/t3/base-bs3/html/modules.php

O bien puedes usar el siguiente código para crearlo:

Código PHP:
Ver original
  1. <?php
  2. /**
  3.  *------------------------------------------------------------------------------
  4.  * @package       T3 Framework for Joomla!
  5.  *------------------------------------------------------------------------------
  6.  * @copyright     Copyright (C) 2004-2013 JoomlArt.com. All Rights Reserved.
  7.  * @license       GNU General Public License version 2 or later; see LICENSE.txt
  8.  * @authors       JoomlArt, JoomlaBamboo, (contribute to this project at github
  9.  *                & Google group to become co-author)
  10.  * @Google group: https://groups.google.com/forum/#!forum/t3fw
  11.  * @Link:         http://t3-framework.org
  12.  *------------------------------------------------------------------------------
  13.  */
  14.  
  15. defined('_JEXEC') or die('Restricted access');
  16.  
  17. /**
  18.  * This is a file to add template specific chrome to module rendering.  To use it you would
  19.  * set the style attribute for the given module(s) include in your template to use the style
  20.  * for each given modChrome function.
  21.  *
  22.  * eg.  To render a module mod_test in the sliders style, you would use the following include:
  23.  * <jdoc:include type="module" name="test" style="slider" />
  24.  *
  25.  * This gives template designers ultimate control over how modules are rendered.
  26.  *
  27.  * NOTICE: All chrome wrapping methods should be named: modChrome_{STYLE} and take the same
  28.  * three arguments.
  29.  */
  30.  
  31.  
  32. /*
  33.  * Default Module Chrome that has sematic markup and has best SEO support
  34.  */
  35. function modChrome_T3Xhtml($module, &$params, &$attribs)
  36. {
  37.     $badge          = preg_match ('/badge/', $params->get('moduleclass_sfx'))? '<span class="badge">&nbsp;</span>' : '';
  38.     $moduleTag      = htmlspecialchars($params->get('module_tag', 'div'));
  39.     $headerTag      = htmlspecialchars($params->get('header_tag', 'h3'));
  40.     $headerClass    = $params->get('header_class');
  41.     $bootstrapSize  = $params->get('bootstrap_size');
  42.     $moduleClass    = !empty($bootstrapSize) ? ' col-sm-' . (int) $bootstrapSize . '' : '';
  43.     $moduleClassSfx = htmlspecialchars($params->get('moduleclass_sfx'));
  44.  
  45.     if (!empty ($module->content)) {
  46.         $html = "<{$moduleTag} class=\"t3-module module{$moduleClassSfx} {$moduleClass}\" id=\"Mod{$module->id}\">" .
  47.                     "<div class=\"module-inner\">" . $badge;
  48.  
  49.         if ($module->showtitle != 0) {
  50.             $html .= "<{$headerTag} class=\"module-title {$headerClass}\"><span>{$module->title}</span></{$headerTag}>";
  51.         }
  52.  
  53.         $html .= "<div class=\"module-ct\">{$module->content}</div></div></{$moduleTag}>";
  54.  
  55.         echo $html;
  56.     }
  57. }
  58.  
  59.  
  60. function modChrome_t3tabs($module, $params, $attribs)
  61. {
  62.     $area = isset($attribs['id']) ? (int) $attribs['id'] :'1';
  63.     $area = 'area-'.$area;
  64.  
  65.     static $modulecount;
  66.     static $modules;
  67.  
  68.     if ($modulecount < 1) {
  69.         $modulecount = count(JModuleHelper::getModules($attribs['name']));
  70.         $modules = array();
  71.     }
  72.  
  73.     if ($modulecount == 1) {
  74.         $temp = new stdClass;
  75.         $temp->content = $module->content;
  76.         $temp->title = $module->title;
  77.         $temp->params = $module->params;
  78.         $temp->id = $module->id;
  79.         $modules[] = $temp;
  80.  
  81.         // list of moduletitles
  82.         echo '<ul class="nav nav-tabs" id="tab'.$temp->id .'">';
  83.  
  84.         foreach($modules as $rendermodule) {
  85.             echo '<li><a data-toggle="tab" href="#module-'.$rendermodule->id.'" >'.$rendermodule->title.'</a></li>';
  86.         }
  87.         echo '</ul>';
  88.         echo '<div class="tab-content">';
  89.         $counter = 0;
  90.         // modulecontent
  91.         foreach($modules as $rendermodule) {
  92.             $counter ++;
  93.  
  94.             echo '<div class="tab-pane  fade in" id="module-'.$rendermodule->id.'">';
  95.             echo $rendermodule->content;
  96.            
  97.             echo '</div>';
  98.         }
  99.         echo '</div>';
  100.         echo '<script type="text/javascript">';
  101.         echo 'jQuery(document).ready(function(){';
  102.             echo 'jQuery("#tab'.$temp->id.' a:first").tab("show")';
  103.             echo '});';
  104.         echo '</script>';
  105.         $modulecount--;
  106.  
  107.     } else {
  108.         $temp = new stdClass;
  109.         $temp->content = $module->content;
  110.         $temp->params = $module->params;
  111.         $temp->title = $module->title;
  112.         $temp->id = $module->id;
  113.         $modules[] = $temp;
  114.         $modulecount--;
  115.     }
  116. }
  117.  
  118.  
  119. function modChrome_t3slider($module, &$params, &$attribs)
  120. {
  121.     $badge = preg_match ('/badge/', $params->get('moduleclass_sfx'))?"<span class=\"badge\">&nbsp;</span>\n":"";
  122.     $headerLevel = isset($attribs['headerLevel']) ? (int) $attribs['headerLevel'] : 3;
  123.     ?>
  124.  
  125.     <div class="moduleslide-<?php echo $module->id ?> collapse-trigger collapsed" data-toggle="collapse" data-target="#slidecontent-<?php echo $module->id ?>">
  126.         <h<?php echo $headerLevel; ?>><span><?php echo $module->title; ?></span></h<?php echo $headerLevel; ?>>
  127.     </div>
  128.  
  129.     <div id="slidecontent-<?php echo $module->id ?>" class="collapse-<?php echo $module->id ?> in"><?php echo $module->content; ?></div>
  130.  
  131.     <script type="text/javascript">;
  132.     jQuery(document).ready(function(){;
  133.         jQuery(".collapse-<?php echo $module->id ?>").collapse({toggle: 1});
  134.     });
  135.     </script>
  136.  
  137.     <?php
  138. }
  139.  
  140.  
  141. function modChrome_t3modal($module, &$params, &$attribs)
  142. {
  143.  
  144.     $headerLevel = isset($attribs['headerLevel']) ? (int) $attribs['headerLevel'] : 3;
  145.  
  146.     if (!empty ($module->content)) : ?>
  147.  
  148.     <div class="moduletable <?php echo $params->get('moduleclass_sfx'); ?> modalmodule">
  149.         <div class="t3-module-title">
  150.             <a href="#module<?php echo $module->id ?>" role="button" class="btn" data-toggle="modal">
  151.                 <h<?php echo $headerLevel; ?>><span><?php echo $module->title; ?></span></h<?php echo $headerLevel; ?>>
  152.             </a>
  153.         </div>
  154.         <div id="module<?php echo $module->id ?>" class="modal hide fade" aria-hidden="true">
  155.             <div class="modal-header">
  156.                 <h<?php echo $headerLevel; ?>><span><?php echo $module->title; ?></span></h<?php echo $headerLevel; ?>>
  157.                 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  158.  
  159.             </div>
  160.             <div class="t3-module-body">
  161.                 <?php echo $module->content; ?>
  162.             </div>
  163.         </div>
  164.     </div>
  165.    
  166.     <?php endif;  
  167. }
  168.  
  169.  
  170. function modChrome_popover($module, &$params, &$attribs)
  171. {
  172.     $position = preg_match ('/left/', $params->get('moduleclass_sfx'))?"":"";
  173.     $headerLevel = isset($attribs['headerLevel']) ? (int) $attribs['headerLevel'] : 3;
  174.  
  175.     if (!empty ($module->content)) : ?>
  176.     <div class="moduletable <?php echo $params->get('moduleclass_sfx'); ?> popovermodule">
  177.         <a id="popover<?php echo $module->id ?>" href="#" rel="popover" data-placement="right" class="btn">
  178.             <h<?php echo $headerLevel; ?>><span><?php echo $module->title; ?></span></h<?php echo $headerLevel; ?>>
  179.         </a>
  180.         <div id="popover_content_wrapper-<?php echo $module->id ?>" style="display: none">
  181.             <div><?php echo $module->content; ?></div>
  182.         </div>
  183.        
  184.         <script type="text/javascript">;
  185.         jQuery(document).ready(function(){
  186.  
  187.             jQuery("#popover<?php echo $module->id ?>").popover({
  188.                 html: true,
  189.                 content: function() {
  190.                     return jQuery('#popover_content_wrapper-<?php echo $module->id ?>').html();
  191.                 }
  192.             }).click(function(e) {
  193.                 e.preventDefault();
  194.             });
  195.         });
  196.         </script>
  197.     </div>
  198.     <?php endif;  
  199. }
__________________
¡No lo sé todo! Pero comencé como tú, ¡sin saber nada!
Encuéntrame en Facebook: Perfil + Página