Ok Danke schön... das habe ich soweit hinbekommen....was ich aber eigentlich will ist ein background image einzufügen nun brauch ich ja den pfad zum Bild....aber den bekomm ich irgendwie nicht richtig ausgelesen....
dca
PHP-Code:
<?php
/**
* sv-bootstrap-contao
* @author Sebastian Vogt
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
*/
foreach($GLOBALS['TL_DCA']['tl_page']['palettes'] as $name => $palette){
if($name === '__selector__'){
continue;
}
$GLOBALS['TL_DCA']['tl_page']['palettes'][$name] = str_replace
(
'{publish_legend}',
//'{bootstrapContao_legend:hide},iconClass,onlyIcon,bscHeadline,bscDivider;{publish_legend}',
'{bootstrapContao_legend:hide},bscDivider,onlyIcon,iconClass,bscHeadline,bscBackgroundImage,test;{publish_legend}',
$palette
);
}
$GLOBALS['TL_DCA']['tl_page']['fields']['iconClass'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_page']['iconClass'], /* Hier geben wir die Variable an, welche später in der Language-Datei/n definiert wird. */
'exclude' => false,
'search' => true, /*das Feld kann im Backend durchsucht werden*/
'inputType' => 'text', /* Feldtyp */
'eval' => array('mandatory'=>false, 'maxlength'=>255,'tl_class'=>'w50 m12'), /*evaluation, siehe offizielle Contao-Manual */
'sql' => "varchar(255) NOT NULL default ''" /* schließlich die SQL- Vorgaben */
);
$GLOBALS['TL_DCA']['tl_page']['fields']['onlyIcon'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_page']['onlyIcon'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'w50 m12'),
'sql' => "char(1) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_page']['fields']['bscHeadline'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_page']['bscHeadline'],
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('tl_class' => 'w50 m12', 'maxlength' => 255),
'sql' => "char(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_page']['fields']['bscDivider'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_page']['bscDivider'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'w50 m12'),
'sql' => "char(1) NOT NULL default ''"
);
// bscBackgroundImage
$GLOBALS['TL_DCA']['tl_page']['fields']['bscBackgroundImage'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_page']['bscBackgroundImage'],
'exclude' => true,
'inputType' => 'fileTree',
'eval' => array('filesOnly'=>true, 'fieldType'=>'radio', 'mandatory'=>false, 'tl_class'=>'clr'),
'sql' => "binary(16) NULL"
);
fe_page
PHP-Code:
<?php
/**
* sv-bootstrap-contao
* @author Sebastian Vogt
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
*/
?>
<?php
define("THEME_PATH", "files/themes/bootstrap-contao/");
define("ASSETS_PATH", THEME_PATH . "assets/");
define("BOOTSTRAP_PATH", THEME_PATH . "bootstrap/");
define("MODULE_PATH", "system/modules/sv-bootstrap-contao/");
global $objPage;
$GLOBALS['TL_HEAD'][] = '<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">';
$GLOBALS['TL_HEAD'][] = '<link href="files/themes/bootstrap-contao/bootstrap/dist/css/bootstrap.css" rel="stylesheet">';
$GLOBALS['TL_BODY'][] ='<script src="files/themes/bootstrap-contao/bootstrap/dist/js/bootstrap.js"></script>';
if($this->layout->bscAddBlueimp){
$GLOBALS['TL_HEAD'][] = '<link rel="stylesheet" href="system/modules/sv-bootstrap-contao/assets/js/blueimp-gallery/css/blueimp-gallery.min.css">';
$GLOBALS['TL_BODY'][] = '<script src="system/modules/sv-bootstrap-contao/assets/js/blueimp-gallery/js/blueimp-gallery.min.js"></script>';
$GLOBALS['TL_BODY'][] = '<script src="system/modules/sv-bootstrap-contao/assets/js/blueimp-gallery/js/jquery.blueimp-gallery.min.js"></script>';
}
$GLOBALS['TL_BODY'][] = '<script src="files/themes/bootstrap-contao/bootstrap/js/app.js"></script>';
?>
<!DOCTYPE html>
<html lang="<?php echo $this->language; ?>">
<head>
<meta charset="<?php echo $this->charset; ?>">
<title><?php echo $this->pageTitle; ?> - <?php echo $this->mainTitle; ?></title>
<base href="<?php echo $this->base; ?>">
<meta name="robots" content="<?php echo $this->robots; ?>">
<meta name="description" content="<?php echo $this->description; ?>">
<meta name="keywords" content="<?php echo $this->keywords; ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<?php echo $this->viewport; ?>
<?php echo $this->framework; ?>
<?php echo $this->stylesheets; ?>
<?php echo $this->mooScripts; ?>
<?php echo $this->head; ?>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body id="top"
class="{{ua::class}}<?php if ($this->class): ?> <?php echo $this->class; ?><?php endif; ?>"<?php if ($this->onload): ?> onload="<?php echo $this->onload; ?>"<?php endif; ?><?php if($objPage->bscBackgroundImage): ?> style="backgroundImage:url('<?php echo deserialize($objPage->bscBackgroundImage, true); ?>'); background-repeat: no-repeat; background-size: cover;"<?php endif; ?>>
<div id="wrapper">
<header id="header">
<div class="inside">
<?php echo $this->header; ?>
</div>
</header>
<div id="container" class="container">
<div class="inside row">
<div>
<?php
$objFile = \FilesModel::findByPk($objPage->bscBackgroundImage);
echo $objFile;
?>
</div>
<div id="main" class="col-sm-8">
<div class="inside row">
<?php echo $this->main; ?>
</div>
</div>
<div class="divider visible-xs col-xs-12">
<hr/>
</div>
<aside id="right" class="col-sm-4">
<div class="inside row">
<div class="col-sm-12">
<?php echo $this->right; ?>
</div>
</div>
</aside>
</div>
</div>
<footer id="footer">
<div class="inside">
<?php echo $this->footer; ?>
</div>
</footer>
</div>
<?php if($this->layout->bscAddBlueimp): ?>
<div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls">
<div class="slides"></div>
<h3 class="title"></h3>
<a class="prev">‹</a>
<a class="next">›</a>
<a class="close">×</a>
<a class="play-pause"></a>
<ol class="indicator"></ol>
</div>
<?php endif; ?>
<?php echo $this->mootools; ?>
<?php if (!$this->disableCron): ?>
<script>
<?php if ($this->layout->addJQuery): ?>
setTimeout(function () {
jQuery.ajax("system/cron/cron.txt", {complete: function (e) {
var t = e.responseText || 0;
parseInt(t) < Math.round(+(new Date) / 1e3) -<?php echo $this->cronTimeout; ?> && jQuery.ajax("system/cron/cron.php")
}})
}, 5e3)
<?php else: ?>
setTimeout(function () {
(new Request({url: "system/cron/cron.txt", onComplete: function (e) {
e || (e = 0), parseInt(e) < Math.round(+(new Date) / 1e3) -<?php echo $this->cronTimeout; ?> && (new Request({url: "system/cron/cron.php"})).get()
}})).get()
}, 5e3)
<?php endif; ?>
</script>
<?php endif; ?>
</body>
</html>
steh grad völlig aufm schlauch dabei ist doch heut garnicht montag
Lesezeichen