No, mi riferisco a Joomla!, scusami.
Cerco di spiegarmi dopo che ho rivisto titoli articoli, home e categorie poichè con le varie impostazioni non era possibile senza intervenire direttamente sulla formattazione articoli non pubblicando il titolo e riportarlo nel testo in h1:
- per default joomla! 3 pubblica i titoli articoli della pagina principale in h1 (non ricordo se anche quelli dai menu top)
- pubblica i titoli degli articoli in h2
- i titoli delle categorie sono pubblicati in h1
ora per ovviare ho eliminato il blocco il 1° blocco:
Codice:
<?php if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1>
</div>
e lasciando il 2° blocco sostituendo solo il tag h2 con h1 come si vede:
Codice:
<?php if ($params->get('show_title')) : ?>
<h1 itemprop="headline">
<?php echo $this->escape($this->item->title); ?>
</h1>
Anche per eliminare il logo e descrizione in cima avevo eliminato un pezzo per sistemare come volevo, idem per le info del template, immagino che per tutti e 3 casi ci sia un modo per dire, non pubblicare questo se inserisco/attivo questo altro logo, impostazione h1 su tutto se decido sulle singole impostazioni, non pubblicate le info se inserisco chessò una descrizione personale, insomma per evitare di tagliare a muzzo parti di codice inserendo delle istruzioni/condizioni come gia ci sono per altri parametri.
Riporto sotto l'index.php originale e quello modificato per così dire, per capire se si può fare e come da nubbio.
L'originale:
Codice:
<?php
/**
* @package Joomla.Site
* @subpackage Templates.protostar
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/** @var JDocumentHtml $this */
$app = JFactory::getApplication();
$user = JFactory::getUser();
// Output as HTML5
$this->setHtml5(true);
// Getting params from template
$params = $app->getTemplate(true)->params;
// 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 = $app->get('sitename');
if ($task === 'edit' || $layout === 'form')
{
$fullWidth = 1;
}
else
{
$fullWidth = 0;
}
// Add JavaScript Frameworks
JHtml::_('bootstrap.framework');
// Add template js
JHtml::_('script', 'template.js', array('version' => 'auto', 'relative' => true));
// Add html5 shiv
JHtml::_('script', 'jui/html5.js', array('version' => 'auto', 'relative' => true, 'conditional' => 'lt IE 9'));
// Add Stylesheets
JHtml::_('stylesheet', 'template.css', array('version' => 'auto', 'relative' => true));
JHtml::_('stylesheet', 'templatepers.css', array('version' => 'auto', 'relative' => true));
// Use of Google Font
if ($this->params->get('googleFont'))
{
JHtml::_('stylesheet', '//fonts.googleapis.com/css?family=' . $this->params->get('googleFontName'));
$this->addStyleDeclaration("
h1, h2, h3, h4, h5, h6, .site-title {
font-family: '" . str_replace('+', ' ', $this->params->get('googleFontName')) . "', sans-serif;
}");
}
// Template color
if ($this->params->get('templateColor'))
{
$this->addStyleDeclaration('
body.site {
border-top: 3px solid ' . $this->params->get('templateColor') . ';
background-color: ' . $this->params->get('templateBackgroundColor') . ';
}
a {
color: ' . $this->params->get('templateColor') . ';
}
.nav-list > .active > a,
.nav-list > .active > a:hover,
.dropdown-menu li > a:hover,
.dropdown-menu .active > a,
.dropdown-menu .active > a:hover,
.nav-pills > .active > a,
.nav-pills > .active > a:hover,
.btn-primary {
background: ' . $this->params->get('templateColor') . ';
}');
}
// Check for a custom CSS file
JHtml::_('stylesheet', 'user.css', array('version' => 'auto', 'relative' => true));
// Check for a custom js file
JHtml::_('script', 'user.js', array('version' => 'auto', 'relative' => true));
// Load optional RTL Bootstrap CSS
JHtml::_('bootstrap.loadCss', false, $this->direction);
// Adjusting content width
if ($this->countModules('position-7') && $this->countModules('position-8'))
{
$span = 'span6';
}
elseif ($this->countModules('position-7') && !$this->countModules('position-8'))
{
$span = 'span9';
}
elseif (!$this->countModules('position-7') && $this->countModules('position-8'))
{
$span = 'span9';
}
else
{
$span = 'span12';
}
// Logo file or site title param
if ($this->params->get('logoFile'))
{
$logo = '<img src="' . JUri::root() . $this->params->get('logoFile') . '" alt="' . $sitename . '" />';
}
elseif ($this->params->get('sitetitle'))
{
$logo = '<span class="site-title" title="' . $sitename . '">' . htmlspecialchars($this->params->get('sitetitle'), ENT_COMPAT, 'UTF-8') . '</span>';
}
else
{
$logo = '<span class="site-title" title="' . $sitename . '">' . $sitename . '</span>';
}
?>
<!DOCTYPE html>
<html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<jdoc:include type="head" />
</head>
<body class="site <?php echo $option
. ' view-' . $view
. ($layout ? ' layout-' . $layout : ' no-layout')
. ($task ? ' task-' . $task : ' no-task')
. ($itemid ? ' itemid-' . $itemid : '')
. ($params->get('fluidContainer') ? ' fluid' : '');
echo ($this->direction === 'rtl' ? ' rtl' : '');
?>">
<!-- Body -->
<div class="body" id="top">
<div class="container<?php echo ($params->get('fluidContainer') ? '-fluid' : ''); ?>">
<!-- Header -->
<header class="header" role="banner">
<div class="header-inner clearfix">
<a class="brand pull-left" href="<?php echo $this->baseurl; ?>/">
<div class="header-search pull-right">
<jdoc:include type="modules" name="position-0" style="none" />
</div>
</div>
</header>
<?php if ($this->countModules('position-1')) : ?>
<nav class="navigation" role="navigation">
<div class="navbar pull-left">
<a class="btn btn-navbar collapsed" data-toggle="collapse" data-target=".nav-collapse">
<span class="element-invisible"><?php echo JTEXT::_('TPL_PROTOSTAR_TOGGLE_MENU'); ?></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
</div>
<div class="nav-collapse">
<jdoc:include type="modules" name="position-1" style="none" />
</div>
</nav>
<?php endif; ?>
<jdoc:include type="modules" name="banner" style="xhtml" />
<div class="row-fluid">
<?php if ($this->countModules('position-8')) : ?>
<!-- Begin Sidebar -->
<div id="sidebar" class="span3">
<div class="sidebar-nav">
<jdoc:include type="modules" name="position-8" style="well" />
</div>
</div>
<!-- End Sidebar -->
<?php endif; ?>
<main id="content" role="main" class="<?php echo $span; ?>">
<!-- Begin Content -->
<jdoc:include type="modules" name="position-3" style="xhtml" />
<jdoc:include type="message" />
<jdoc:include type="component" />
<jdoc:include type="modules" name="position-2" style="none" />
<!-- End Content -->
</main>
<?php if ($this->countModules('position-7')) : ?>
<div id="aside" class="span3">
<!-- Begin Right Sidebar -->
<jdoc:include type="modules" name="position-7" style="well" />
<!-- End Right Sidebar -->
</div>
<?php endif; ?>
</div>
</div>
</div>
<!-- Footer -->
<footer class="footer" role="contentinfo">
<div class="container<?php echo ($params->get('fluidContainer') ? '-fluid' : ''); ?>">
<hr />
<jdoc:include type="modules" name="footer" style="none" />
</div>
</footer>
<jdoc:include type="modules" name="debug" style="none" />
</body>
</html>
Quello modificato:
Codice:
<?php
/**
* @package Joomla.Site
* @subpackage Templates.protostar
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/** @var JDocumentHtml $this */
$app = JFactory::getApplication();
$user = JFactory::getUser();
// Output as HTML5
$this->setHtml5(true);
// Getting params from template
$params = $app->getTemplate(true)->params;
// 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 = $app->get('sitename');
if ($task === 'edit' || $layout === 'form')
{
$fullWidth = 1;
}
else
{
$fullWidth = 0;
}
// Add JavaScript Frameworks
JHtml::_('bootstrap.framework');
// Add template js
JHtml::_('script', 'template.js', array('version' => 'auto', 'relative' => true));
// Add html5 shiv
JHtml::_('script', 'jui/html5.js', array('version' => 'auto', 'relative' => true, 'conditional' => 'lt IE 9'));
// Add Stylesheets
JHtml::_('stylesheet', 'template.css', array('version' => 'auto', 'relative' => true));
JHtml::_('stylesheet', 'templatepers.css', array('version' => 'auto', 'relative' => true));
// Use of Google Font
if ($this->params->get('googleFont'))
{
JHtml::_('stylesheet', '//fonts.googleapis.com/css?family=' . $this->params->get('googleFontName'));
$this->addStyleDeclaration("
h1, h2, h3, h4, h5, h6, .site-title {
font-family: '" . str_replace('+', ' ', $this->params->get('googleFontName')) . "', sans-serif;
}");
}
// Template color
if ($this->params->get('templateColor'))
{
$this->addStyleDeclaration('
body.site {
border-top: 3px solid ' . $this->params->get('templateColor') . ';
background-color: ' . $this->params->get('templateBackgroundColor') . ';
}
a {
color: ' . $this->params->get('templateColor') . ';
}
.nav-list > .active > a,
.nav-list > .active > a:hover,
.dropdown-menu li > a:hover,
.dropdown-menu .active > a,
.dropdown-menu .active > a:hover,
.nav-pills > .active > a,
.nav-pills > .active > a:hover,
.btn-primary {
background: ' . $this->params->get('templateColor') . ';
}');
}
// Check for a custom CSS file
JHtml::_('stylesheet', 'user.css', array('version' => 'auto', 'relative' => true));
// Check for a custom js file
JHtml::_('script', 'user.js', array('version' => 'auto', 'relative' => true));
// Load optional RTL Bootstrap CSS
JHtml::_('bootstrap.loadCss', false, $this->direction);
// Adjusting content width
if ($this->countModules('position-7') && $this->countModules('position-8'))
{
$span = 'span6';
}
elseif ($this->countModules('position-7') && !$this->countModules('position-8'))
{
$span = 'span9';
}
elseif (!$this->countModules('position-7') && $this->countModules('position-8'))
{
$span = 'span9';
}
else
{
$span = 'span12';
}
// Logo file or site title param
if ($this->params->get('logoFile'))
{
$logo = '<img src="' . JUri::root() . $this->params->get('logoFile') . '" alt="' . $sitename . '" />';
}
elseif ($this->params->get('sitetitle'))
{
$logo = '<span class="site-title" title="' . $sitename . '">' . htmlspecialchars($this->params->get('sitetitle'), ENT_COMPAT, 'UTF-8') . '</span>';
}
else
{
$logo = '<span class="site-title" title="' . $sitename . '">' . $sitename . '</span>';
}
?>
<!DOCTYPE html>
<html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<jdoc:include type="head" />
</head>
<body class="site <?php echo $option
. ' view-' . $view
. ($layout ? ' layout-' . $layout : ' no-layout')
. ($task ? ' task-' . $task : ' no-task')
. ($itemid ? ' itemid-' . $itemid : '')
. ($params->get('fluidContainer') ? ' fluid' : '');
echo ($this->direction === 'rtl' ? ' rtl' : '');
?>">
<!-- Body -->
<div class="body" id="top">
<div class="container<?php echo ($params->get('fluidContainer') ? '-fluid' : ''); ?>">
<!-- Header -->
<header class="header" role="banner">
<div class="header-inner clearfix">
<a class="brand pull-left" href="<?php echo $this->baseurl; ?>/">
<div class="header-search pull-right">
<jdoc:include type="modules" name="position-0" style="none" />
</div>
</div>
</header>
<?php if ($this->countModules('position-1')) : ?>
<nav class="navigation" role="navigation">
<div class="navbar pull-left">
<a class="btn btn-navbar collapsed" data-toggle="collapse" data-target=".nav-collapse">
<span class="element-invisible"><?php echo JTEXT::_('TPL_PROTOSTAR_TOGGLE_MENU'); ?></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
</div>
<div class="nav-collapse">
<jdoc:include type="modules" name="position-1" style="none" />
</div>
</nav>
<?php endif; ?>
<jdoc:include type="modules" name="banner" style="xhtml" />
<div class="row-fluid">
<?php if ($this->countModules('position-8')) : ?>
<!-- Begin Sidebar -->
<div id="sidebar" class="span3">
<div class="sidebar-nav">
<jdoc:include type="modules" name="position-8" style="well" />
</div>
</div>
<!-- End Sidebar -->
<?php endif; ?>
<main id="content" role="main" class="<?php echo $span; ?>">
<!-- Begin Content -->
<jdoc:include type="modules" name="position-3" style="xhtml" />
<jdoc:include type="message" />
<jdoc:include type="component" />
<jdoc:include type="modules" name="position-2" style="none" />
<!-- End Content -->
</main>
<?php if ($this->countModules('position-7')) : ?>
<div id="aside" class="span3">
<!-- Begin Right Sidebar -->
<jdoc:include type="modules" name="position-7" style="well" />
<!-- End Right Sidebar -->
</div>
<?php endif; ?>
</div>
</div>
</div>
<!-- Footer -->
<footer class="footer" role="contentinfo">
<div class="container<?php echo ($params->get('fluidContainer') ? '-fluid' : ''); ?>">
<hr />
<jdoc:include type="modules" name="footer" style="none" />
</div>
</footer>
<jdoc:include type="modules" name="debug" style="none" />
</body>
</html>
Grazie. | | |
| Copyright | E' un termine di lingua inglese che letteralmente significa diritto di copia. | | |
| | |
| | |
| CSS | Fogli di Stile | | |
| | |
| | |
| Array | E' una struttura dati complessa usata in molti linguaggi di programmazione | | |
| | |
| | |
| Javascript | JavaScript è un linguaggio di scripting orientato agli oggetti comunemente usato nei siti web | | |
| | |
| | |
| Google | Google (pronuncia gùgol) è un motore di ricerca per Internet. | | |
| | |
| | |
| Joomla | Joomla è un CMS per costruire siti internet | | |
| | |
| | |
| Open Source | Letteralmente tradotto significa Codice Aperto | | |
| | |
| | |
| Open source | Letteralmente tradotto significa Codice Aperto | | |
| | |
| | |
| Tag | tag sono le marcature del linguaggio che permettono la formattazione della pagina | | |
| | |
| | |
| Font | Font in informatica è l'insieme di caratteri di stampa con caratteristiche formali omogenee. | | |
| | |
| | |
| Str_replace | Str_replace è una funzione di PHP case sensitive che restituisce una stringa, o una matrice, sostituendo il valore di un parametro con tutte le occorrenze contenute nella variabile. | | |
| | |
| | |
| PHP | E' una piattaforma trasversale lato server scripting language utilizzata per la creazione di pagine web dinamiche | | |
| | |
| | |
| List | List è un costrutto di PHP utile per assegnare dei valori ad una lista di variabili, così come fossero un array. | | |
| | |
| | |
| Framework | Letteralmente 'struttura', 'intelaiatura': è un'estensione di un linguaggio di programmazione già esistente. Consiste di una collezione di classi, metodi e oggetti che estendono le potenzialità di una sintassi. | | |
| | |
| | |
| html5 | Detto anche 'Web Applications 1.0', è la nuova release, attualmente ancora catalogata come bozza, del linguaggio di markup HTML. Introduce molte novità in termini di nuovi elementi e di funzionalità applicative. | | |
| | |