mn cho em hỏi chút ạ ! Trang thangnhom-xeday. com em tạo 2 menu dọc : Thang Nhôm và Xe đẩy hàng, e muốn thêm link cho 2 menu này thì làm như thế nào ạ ?
Bạn Tuanthuanan ơi, bạn xem giúp mình file module.php dưới đây với nhé. Mình làm theo hướng dẫn của bạn ở bước 1 và với file của mình ở bước 2 thì sửa cụ thể như thế nào ạ <?php defined('_JEXEC') or die(); function modChrome_wellLarge($module, &$params, &$attribs) { $hasIcon = false; $icon = array(); $hasBadge = false; $badge = array(); $moduleClassSuffix = htmlspecialchars($params->get('moduleclass_sfx')); $finalClassSfx = explode(' ', $moduleClassSuffix); // array contain classes // check if classSuffix contain icon class or badge class if (count($finalClassSfx)){ $tempClsSfx = $finalClassSfx; foreach ($finalClassSfx as $idx => $clsSfx){ if (strpos($clsSfx, 'icon-') !== false) { $hasIcon = true; $icon[] = $clsSfx; unset($tempClsSfx[$idx]); $module->content = str_replace($clsSfx, '', $module->content); } else if (strpos($clsSfx, 'badge-') !== false) { $badgeContent = explode('--', $clsSfx); if (isset($badgeContent[0]) && isset($badgeContent[1])){ $hasBadge = true; $badge[] = $badgeContent[0]; $badgeContent = $badgeContent[1]; } unset($tempClsSfx[$idx]); $module->content = str_replace($clsSfx, '', $module->content); } } unset($idx, $clsSfx); unset($finalClassSfx); $finalClassSfx = $tempClsSfx; unset($tempClsSfx); } // prepare title: title split to parts or sub if ($module->showtitle){ $arrtitle = explode('--',trim($module->title), 2); $title = ''; if (count($arrtitle) > 1){ foreach ($arrtitle as $index => $at) { $title .= '<span class="part'.$index.'">'.$at.'</span>'; } unset($index, $at); } else $title = $module->title; } if ($module->content) { echo '<div id="mod-'.$module->id.'" class="ot-mod-outer well well-large module' . (implode(' ', $finalClassSfx)) . '">'; echo '<div class="ot-mod-inner">'; //if ($module->showtitle) echo '<h3 class="mod-title">' . $title . '</h3>'; if ($module->showtitle) echo '<div class="mod-title">' . $title . '</div>'; if ($hasIcon) echo '<span class="icon '.(implode(' ', $icon)).'"> </span>'; if ($hasBadge) echo '<span class="badge '.(implode(' ', $badge)).'">'.$badgeContent.'</span>'; echo '<div class="mod-content"><div class="mod-content-i">'; echo $module->content; echo '</div></div>'; echo '</div>'; echo '</div>'; } } function modChrome_wellMedium($module, &$params, &$attribs) { $hasIcon = false; $icon = array(); $hasBadge = false; $badge = array(); $moduleClassSuffix = htmlspecialchars($params->get('moduleclass_sfx')); $finalClassSfx = explode(' ', $moduleClassSuffix); // array contain classes // check if classSuffix contain icon class or badge class if (count($finalClassSfx)){ $tempClsSfx = $finalClassSfx; foreach ($finalClassSfx as $idx => $clsSfx){ if (strpos($clsSfx, 'icon-') !== false) { $hasIcon = true; $icon[] = $clsSfx; unset($tempClsSfx[$idx]); $module->content = str_replace($clsSfx, '', $module->content); } else if (strpos($clsSfx, 'badge-') !== false) { $badgeContent = explode('--', $clsSfx); if (isset($badgeContent[0]) && isset($badgeContent[1])){ $hasBadge = true; $badge[] = $badgeContent[0]; $badgeContent = $badgeContent[1]; } unset($tempClsSfx[$idx]); $module->content = str_replace($clsSfx, '', $module->content); } } unset($idx, $clsSfx); unset($finalClassSfx); $finalClassSfx = $tempClsSfx; unset($tempClsSfx); } // prepare title: title split to parts or sub if ($module->showtitle){ $arrtitle = explode('--',trim($module->title), 2); $title = ''; if (count($arrtitle) > 1){ foreach ($arrtitle as $index => $at) { $title .= '<span class="part'.$index.'">'.$at.'</span>'; } unset($index, $at); } else $title = $module->title; } if ($module->content) { echo '<div id="mod-'.$module->id.'" class="ot-mod-outer well well-medium module' . (implode(' ', $finalClassSfx)) . '">'; echo '<div class="ot-mod-inner">'; if ($module->showtitle) echo '<h3 class="mod-title">' . $title . '</h3>'; if ($hasIcon) echo '<span class="icon '.(implode(' ', $icon)).'"> </span>'; if ($hasBadge) echo '<span class="badge '.(implode(' ', $badge)).'">'.$badgeContent.'</span>'; echo '<div class="mod-content"><div class="mod-content-i">'; echo $module->content; echo '</div></div>'; echo '</div>'; echo '</div>'; } } function modChrome_wellSmall($module, &$params, &$attribs) { $hasIcon = false; $icon = array(); $hasBadge = false; $badge = array(); $moduleClassSuffix = htmlspecialchars($params->get('moduleclass_sfx')); $finalClassSfx = explode(' ', $moduleClassSuffix); // array contain classes // check if classSuffix contain icon class or badge class if (count($finalClassSfx)){ $tempClsSfx = $finalClassSfx; foreach ($finalClassSfx as $idx => $clsSfx){ if (strpos($clsSfx, 'icon-') !== false) { $hasIcon = true; $icon[] = $clsSfx; unset($tempClsSfx[$idx]); $module->content = str_replace($clsSfx, '', $module->content); } else if (strpos($clsSfx, 'badge-') !== false) { $badgeContent = explode('--', $clsSfx); if (isset($badgeContent[0]) && isset($badgeContent[1])){ $hasBadge = true; $badge[] = $badgeContent[0]; $badgeContent = $badgeContent[1]; } unset($tempClsSfx[$idx]); $module->content = str_replace($clsSfx, '', $module->content); } } unset($idx, $clsSfx); unset($finalClassSfx); $finalClassSfx = $tempClsSfx; unset($tempClsSfx); } // prepare title: title split to parts or sub if ($module->showtitle){ $arrtitle = explode('--',trim($module->title), 2); $title = ''; if (count($arrtitle) > 1){ foreach ($arrtitle as $index => $at) { $title .= '<span class="part'.$index.'">'.$at.'</span>'; } unset($index, $at); } else $title = $module->title; } if ($module->content) { echo '<div id="mod-'.$module->id.'" class="ot-mod-outer well well-small module' . (implode(' ', $finalClassSfx)) . '">'; echo '<div class="ot-mod-inner">'; if ($module->showtitle) echo '<h3 class="mod-title">' . $title . '</h3>'; if ($hasIcon) echo '<span class="icon '.(implode(' ', $icon)).'"> </span>'; if ($hasBadge) echo '<span class="badge '.(implode(' ', $badge)).'">'.$badgeContent.'</span>'; echo '<div class="mod-content"><div class="mod-content-i">'; echo $module->content; echo '</div></div>'; echo '</div>'; echo '</div>'; } } function modChrome_standard($module, &$params, &$attribs) { $hasIcon = false; $icon = array(); $hasBadge = false; $badge = array(); $moduleClassSuffix = htmlspecialchars($params->get('moduleclass_sfx')); $finalClassSfx = explode(' ', $moduleClassSuffix); // array contain classes // check if classSuffix contain icon class or badge class if (count($finalClassSfx)){ $tempClsSfx = $finalClassSfx; foreach ($finalClassSfx as $idx => $clsSfx){ if (strpos($clsSfx, 'icon-') !== false) { $hasIcon = true; $icon[] = $clsSfx; unset($tempClsSfx[$idx]); $module->content = str_replace($clsSfx, '', $module->content); } else if (strpos($clsSfx, 'badge-') !== false) { $badgeContent = explode('--', $clsSfx); if (isset($badgeContent[0]) && isset($badgeContent[1])){ $hasBadge = true; $badge[] = $badgeContent[0]; $badgeContent = $badgeContent[1]; } unset($tempClsSfx[$idx]); $module->content = str_replace($clsSfx, '', $module->content); } } unset($idx, $clsSfx); unset($finalClassSfx); $finalClassSfx = $tempClsSfx; unset($tempClsSfx); } // prepare title: title split to parts or sub if ($module->showtitle){ $arrtitle = explode('--',trim($module->title), 2); $title = ''; if (count($arrtitle) > 1){ foreach ($arrtitle as $index => $at) { $title .= '<span class="part'.$index.'">'.$at.'</span>'; } unset($index, $at); } else $title = $module->title; } if ($module->content) { echo '<div id="mod-'.$module->id.'" class="ot-mod-outer standard module' . (implode(' ', $finalClassSfx)) . '">'; echo '<div class="ot-mod-inner">'; if ($module->showtitle) echo '<h3 class="mod-title">' . $title . '</h3>'; if ($hasIcon) echo '<span class="icon '.(implode(' ', $icon)).'"> </span>'; if ($hasBadge) echo '<span class="badge '.(implode(' ', $badge)).'">'.$badgeContent.'</span>'; echo '<div class="mod-content"><div class="mod-content-i">'; echo $module->content; echo '</div></div>'; echo '</div>'; echo '</div>'; } } function modChrome_preview($module, &$params, &$attribs) { static $css = false; if (!$css) { $css = true; $doc = JFactory::getDocument(); $doc->addStyleDeclaration(".mod-preview-info { padding: 2px 4px 2px 4px; border: 1px solid black; position: absolute; background-color: white; color: red;}"); $doc->addStyleDeclaration(".mod-preview-wrapper { background-color:#eee; border: 1px dotted black; color:#700;}"); } echo ' <div class="mod-preview"> <div class="mod-preview-info">Id: '.$module->id.'<br /> ' . $module->position . ' [' . $module->style . ']</div> <div class="mod-preview-wrapper"> '.$module->content.' </div> </div>'; } ?>
Code module của bạn hình như là tách từng function riêng như: function modChrome_wellLarge($module, &$params, &$attribs) function modChrome_wellMedium($module, &$params, &$attribs) function modChrome_wellSmall($module, &$params, &$attribs) function modChrome_standard($module, &$params, &$attribs) .... Bạn để ý tại các đoạn code sau: // prepare title: title split to parts or sub if ($module->showtitle){ $arrtitle = explode('--',trim($module->title), 2); $title = ''; if (count($arrtitle) > 1){ foreach ($arrtitle as $index => $at) { $title .= '<span class="part'.$index.'">'.$at.'</span>'; } unset($index, $at); } else $title = $module->title; }
chú ý mấy chỗ bôi đậm ạ, sửa như thế nào bạn chỉ cụ thể giúp mình với ạ + tại file tên template/html/modules.php tìm dòng có nội dung $module->title để thiết lập lại, vd như sau (tùy theo template nha..) <?php if($params->get('link_title_mod')!="#" && $params->get('link_title_mod')!=NULL){?> <a href="<?php echo $params->get('link_title_mod');?>"> <?php echo $module->title;?> </a> <?php } else{ echo $module->title; } ?>
Dịch vụ sửa chữa máy tính giá rẻ Tại Công: Win 7 : 500 Rup - Win 8.1 : 800 rup : Win 10 - 1000 Rup hệ điều hành Macbook 1000 RUP Bảo dưỡng máy 300 Rup Cài tại nhà: Phải cho thêm tiền xe đi . Bán latop cũ: Các loại giá rẻ.từ 7000 Rup- 30.000 Rúp BÁN ĐIỆN THOẠI CŨ GIÁ 500- 50.000 RUP bán Sim gọi Việt Nam - Sim mạng giá rẻ LÀM WEBSITE BÁN HÀNG CHO CÁC DOANH NGHIỆP CÁ NHÂN NHẬN QUẢNG CÁO CÁC MẶT HÀNG- LÀM CARD VISIT GIÁ RẺ LIÊN HỆ: EM KHÁNH : TẠI CHỢ LIU VÀ SADAVOD: 89067175434