<?php
defined('_JEXEC') or die;
use Joomla\CMS\Helper\ModuleHelper; //se importa clasa ModuleHelper
require ModuleHelper::getLayoutPath('mod_exemplu', $params->get('layout', 'default')); //se include fisierul template prestabilit - default.php aflat in subdirectorul tmpl
<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="4.0" client="site" method="upgrade">
<name>Modul exemplu</name>
<creationDate>Iunie 2022</creationDate>
<author>Numele Autorului</author>
<authorEmail>email.autor@site.com</authorEmail>
<authorUrl>www.site-autor.com</authorUrl>
<copyright>[COPYRIGHT]</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>1.0.1</version>
<description>Acesta este un modul exemplu</description>
<namespace>Joomla\Module\Exemplu</namespace>
<files>
<filename module="mod_exemplu">mod_exemplu.php</filename>
<folder>tmpl</folder>
<filename>mod_exemplu.xml</filename>
</files>
</extension>
<?php
defined('_JEXEC') or die;
?>
Aici este afisat un exemplu de text realizat cu ajutorului modulului <b>mod_exemplu</b>.
<?xml version="1.0" encoding="utf-8"?>
<extension type="template" client="site">
<name>jomania</name>
<version>1.0</version>
<creationDate>Ianuarie 2022</creationDate>
<author>Numele Autorului</author>
<authorEmail>email@autor.org</authorEmail>
<copyright>GPL v2</copyright>
<description>Descrierea templateului nou creat</description>
<files>
<filename>index.php</filename>
<filename>templateDetails.xml</filename>
<filename>template_preview.png</filename>
<filename>template_thumbnail.png</filename>
<folder>assets</folder>
<folder>html</folder>
</files>
<positions>
<position>logo</position>
<position>menu</position>
<position>search</position>
<position>top_left</position>
<position>top_right</position>
<position>side_left</position>
<position>side_right</position>
<position>breadcrumbs</position>
<position>footer</position>
<position>debug</position>
</positions>
<config>
<fields name="params">
<fieldset name="advanced">
<field
name="logo"
type="radio"
label="Afisare logo"
default="0"
layout="joomla.form.field.radio.switcher"
filter="boolean"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="logoFile"
type="media"
default=""
label="Logo"
showon="brand:1"
/>
<field
name="banner"
type="radio"
label="Afisare banner"
default="0"
layout="joomla.form.field.radio.switcher"
filter="boolean"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="bannerFile"
type="media"
default=""
label="Banner"
showon="brand:1"
/>
</fieldset>
</fields>
</config>
</extension>
<?php
/**
* @package Joomla.Site
* @subpackage Templates.jomania
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Uri\Uri;
$app = Factory::getApplication();
$wa = $this->getWebAssetManager();
// Detecting Active Variables
$option = $app->input->getCmd('option', '');
$view = $app->input->getCmd('view', '');
$layout = $app->input->getCmd('layout', '');
$task = $app->input->getCmd('task', '');
$itemid = $app->input->getCmd('Itemid', '');
$sitename = htmlspecialchars($app->get('sitename'), ENT_QUOTES, 'UTF-8');
$menu = $app->getMenu()->getActive();
$pageclass = $menu !== null ? $menu->getParams()->get('pageclass_sfx', '') : '';
// Template path
$templatePath = 'templates/' . $this->template;
?>
<!DOCTYPE html>
<html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
<jdoc:include type="metas" />
<jdoc:include type="styles" />
<link href="<?= $templatePath ?>/assets/css/template.css" rel="stylesheet" />
<jdoc:include type="scripts" />
</head>
<body>
<header class="header">
<div class="logo">
<?php
if ($this->params->get('logo'))
{
echo $logo = '<img src="' . Uri::root(true) . '/' . htmlspecialchars($this->params->get('logoFile'), ENT_QUOTES) . '" alt="' . $sitename . '">';
}
?>
</div>
<div class="top">
<div class="mainMenu">
<jdoc:include type="modules" name="menu" style="none" />
</div>
<div class="search">
<jdoc:include type="modules" name="search" style="none" />
</div>
</div>
</header>
<?php
if ($this->params->get('banner'))
{
echo '<div class="banner">';
echo $logo = '<img src="' . Uri::root(true) . '/' . htmlspecialchars($this->params->get('bannerFile'), ENT_QUOTES) . '" alt="' . $sitename . '">';
echo '</div>';
}
?>
<div class="top_zone">
<?php if ($this->countModules('top_left', true)) : ?>
<div class="top_left">
<jdoc:include type="modules" name="top_left" style="none" />
</div>
<?php endif; ?>
<?php if ($this->countModules('top_right', true)) : ?>
<div class="top_right">
<jdoc:include type="modules" name="top_right" style="none" />
</div>
<?php endif; ?>
</div>
<div class="breadcrumbs">
<jdoc:include type="modules" name="breadcrumbs" style="none" />
</div>
<section id="contentContainer">
<aside class="side_left">
<jdoc:include type="modules" name="side_left" style="none" />
</aside>
<main class="main">
<jdoc:include type="message" />
<jdoc:include type="component" />
</main>
<aside class="side_right">
<jdoc:include type="modules" name="side_right" style="none" />
</aside>
</section>
<footer class="footer">
<jdoc:include type="modules" name="footer" style="none" />
</footer>
<jdoc:include type="modules" name="debug" style="none" />
</body>
</html>
body {
background-color: #ccc;
font-family: Arial, Helvetica, sans-serif;
}
#contentContainer {
display: grid;
grid-template-columns: 1fr 3fr 1fr;
background-color: #fff;
margin: 10px 0;
padding: 5px;
}
.header {
background-color: #333;
display: flex;
}
.logo {
margin: 5px 10px;
width:30%;
}
.top {
margin: 5px 10px;
width: 70%;
text-align: right;
}
.search {
padding:10px;
color:#fff;
}
.banner {
margin: 10px 0;
padding: 5px 10px;
display: flex;
justify-content: center;
}
.top_zone {
display: flex;
margin: 10px 0;
}
.top_left {
width: 50%;
background-color:#F2A722;
padding:5px;
margin:0 2px 0 0;
border-radius: 10px;
border: 2px solid #333;
}
.top_right {
width: 50%;
background-color:#F2A722;
padding: 5px;
margin:0 0 0 2px;
border-radius: 10px;
border: 2px solid #333;
}
.breadcrumbs {
margin: 10px 0px;
background-color: #333;
padding: 5px;
color:#fff;
}
.breadcrumbs ol {
display:flex;
list-style-type: none;
}
.breadcrumbs li {
padding:5px;
}
.breadcrumbs li a {
color:#fff;
}
.footer {
margin: 10px 0;
background-color: darkorange;
padding: 5px;
border-radius: 10px;
border: 2px solid #333;
display:flex;
justify-content: center;
}
.mainMenu ul {
list-style: none;
display: flex;
flex-direction: row;
justify-content: flex-end;
}
.mainMenu li {
padding: 5px 15px;
}
.mainMenu li:hover {
background-color: #ccc;
}
.mainMenu .active {
background-color: deeppink;
}
.mainMenu li a {
color:#fff;
text-decoration: none;
}