Skip to content
Code-Schnipsel Gruppen Projekte
Commit 9eb4c8ad erstellt von Michael Danielczok's avatar Michael Danielczok
Dateien durchsuchen

feat: mor demo brick for product landing page

Related: #8
Übergeordneter e6313e37
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
1 Merge Request!24feat: product landing page demo data
Pipeline-Nr. 11596 bestanden
...@@ -26,44 +26,26 @@ public static function siteCreateChildEnd(Edit $Site): void ...@@ -26,44 +26,26 @@ public static function siteCreateChildEnd(Edit $Site): void
$BrickManager = QUI\Bricks\Manager::init(); $BrickManager = QUI\Bricks\Manager::init();
$Project = $Site->getProject(); $Project = $Site->getProject();
/** foreach (self::getDemoBricksData($Site) as $data) {
* START - ADD ONE BRICK TO THE site $brickDataToSave = [
*/ 'attributes' => $data['attributes']
];
// $Brick = new QUI\Bricks\Brick([
// 'type' => 'content',
// 'title' => 'Mein neuer Inhalt; Für Seite: ' . $Site->getId() . ' - ' . QUI\Utils\Uuid::get(),
// 'description' => '(generierter baustein)',
// 'content' => 'Dies ist ein test'
// ]);
//
// $brickId = $BrickManager->createBrickForProject($Project, $Brick);
// muss gemacht werden, damit der brick für alle bausteinzonen verwendet werde kann
// sonst wird er der seite nicht hinzugefügt
// $BrickManager->saveBrick($brickId, [
// 'areas' => 'headerSuffix,contentPrefix,leftSidebar,rightSidebar,contentSuffix,footerPrefix,footer,' .
// 'productSidebarPrefix,productSidebarSuffix,productCategoryPrefix,productCategorySuffix'
// ]);
// add brick to site
// self::addBrickToSite($Site, $brickId, 'contentPrefix');
if (isset($data['settings'])) {
$brickDataToSave['settings'] = $data['settings'];
}
$Brick = new QUI\Bricks\Brick($brickDataToSave);
foreach (self::getDemoBricksData($Site) as $data) {
$Brick = new QUI\Bricks\Brick($data['attributes']);
$brickId = $BrickManager->createBrickForProject($Project, $Brick); $brickId = $BrickManager->createBrickForProject($Project, $Brick);
$BrickManager->saveBrick($brickId, ['areas' => $data['attributes']['areas']]);
// Assign the data here first
$BrickManager->saveBrick($brickId, $brickDataToSave);
// add brick to site // add brick to site
self::addBrickToSite($Site, $brickId, $data['assignedBrickArea']); self::addBrickToSite($Site, $brickId, $data['assignedBrickArea']);
} }
/**
* END - ADD ONE BRICK TO THE site
*/
// save site // save site
$Site->save(QUI::getUsers()->getSystemUser()); $Site->save(QUI::getUsers()->getSystemUser());
} }
...@@ -113,31 +95,112 @@ public static function getDemoBricksData(Edit $Site) ...@@ -113,31 +95,112 @@ public static function getDemoBricksData(Edit $Site)
return [ return [
[ [
'attributes' => [ 'attributes' => [
'type' => 'content', 'type' => '\\QUI\\PresentationBricks\\Controls\\WallpaperTextArrow',
'title' => 'Mein neuer Inhalt; Für Seite: ' . $Site->getId() . ' - ' . QUI\Utils\Uuid::get(), 'title' => 'Produkt Landingpage - Header (mit Produktbild) - ' . QUI\Utils\Uuid::get(),
'description' => '(generierter baustein)', 'description' => '(Generierter Baustein für Seite ' . $Site->getId() . ')',
'content' => 'Dies ist ein test', 'content' => "<h1>Produkt Landing Page<br />\nf&uuml;r einen besonderer Artikel</h1>\n\n<p>Phasellus tempus. Integer tincidunt. Nam eget dui.. Praesent metus tellus, elementum eu, semper a, adipiscing nec, purus.</p>\n\n<p>&nbsp;</p>\n\n<p><a class=\"btn btn-primary btn-large btn-lg\" data-qui-productlandingpage-cta=\"1\" href=\"#\">Jetzt bestellen <i class=\"fa-solid fa-cart-shopping\"></i></a></p>\n",
'areas' => 'headerSuffix' 'areas' => 'headerSuffix'
], ],
'settings' => [
'classes' => 'demo__product-landing-page__brick__header',
'image' => $placeholderImage,
'general.fullWidth' => 1,
'general.noSpacing' => 1
],
'assignedBrickArea' => 'headerSuffix' 'assignedBrickArea' => 'headerSuffix'
], ],
[ [
'attributes' => [ 'attributes' => [
'type' => '\\QUI\\PresentationBricks\\Controls\\WallpaperTextArrow', 'type' => '\\QUI\\Gallery\\Controls\\Logo\\Slider',
'title' => 'Produkt Landingpage - Header (mit Produktbild) - ' . QUI\Utils\Uuid::get(), 'title' => 'Produkt Landingpage - Logos - ' . QUI\Utils\Uuid::get(),
'description' => '(Generierter Baustein für Seite ' . $Site->getId() . ')', 'description' => '(Generierter Baustein für Seite ' . $Site->getId() . ')',
'content' => "<h1>Produkt Landing Page<br />\nf&uuml;r einen besonderer Artikel</h1>\n\n<p>Phasellus tempus. Integer tincidunt. Nam eget dui.. Praesent metus tellus, elementum eu, semper a, adipiscing nec, purus.</p>\n\n<p>&nbsp;</p>\n\n<p><a class=\"btn btn-primary btn-large btn-lg\" data-qui-productlandingpage-cta=\"1\" href=\"#\">Jetzt bestellen <i class=\"fa-solid fa-cart-shopping\"></i></a></p>\n", 'content' => "",
'areas' => 'headerSuffix', 'areas' => 'headerSuffix'
'settings' => [ ],
'classes' => 'demo__product-landing-page__brick__header', 'settings' => [
'image' => $placeholderImage, 'classes' => 'demo__product-landing-page__brick__logo',
'general.fullWidth' => 1, 'max' => 7,
'general.noSpacing' => 1 'template' => 'default',
] 'desktopHeight' => '60',
'mobileHeight' => '100',
'order' => 'random',
], ],
'assignedBrickArea' => 'headerSuffix' 'assignedBrickArea' => 'headerSuffix'
], ],
[
'attributes' => [
'type' => '\\QUI\\Bricks\\Controls\\BoxContentAdvanced',
'title' => 'Produkt Landingpage - Boxen mit Icon - ' . QUI\Utils\Uuid::get(),
'description' => '(Generierter Baustein für Seite ' . $Site->getId() . ')',
'content' => "",
'areas' => 'headerSuffix'
],
'settings' => [
'classes' => 'demo__product-landing-page__brick__boxes',
'template' => 'boxWithShadow',
'centerText' => true,
'entriesPerLine' => 4,
'entries' => "[{\"entryTitle\":\"Ut non enim eleifend\",\"entrySubTitle\":\"\",\"entryImage\":\"fa fa-anchor-circle-check\",\"entryUrl\":\"\",\"entryOrder\":\"\",\"entryContent\":\"<p>Curabitur turpis. Maecenas nec odio et ante tincidunt tempus.</p>\"},{\"entryTitle\":\"Nam ipsum risus\",\"entrySubTitle\":\"\",\"entryImage\":\"fa fa-bar-chart\",\"entryUrl\":\"\",\"entryOrder\":\"\",\"entryContent\":\"<p>Sed hendrerit. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.</p>\"},{\"entryTitle\":\"Vestibulum fringilla pede\",\"entrySubTitle\":\"\",\"entryImage\":\"fa fa-arrow-trend-up\",\"entryUrl\":\"\",\"entryOrder\":\"\",\"entryContent\":\"<p>In turpis. Praesent nec nisl a purus blandit viverra.</p>\"},{\"entryTitle\":\"Fusce risus nisl\",\"entrySubTitle\":\"\",\"entryImage\":\"fa fa-envelopes-bulk\",\"entryUrl\":\"\",\"entryOrder\":\"\",\"entryContent\":\"<p>Phasellus viverra nulla ut metus varius laoreet.</p>\"}]"
],
'assignedBrickArea' => 'headerSuffix'
],
[
'attributes' => [
'type' => '\\QUI\\Bricks\\Controls\\TextAndImageMultiple',
'title' => 'Produkt Landingpage - Features (Text und Bilder) - ' . QUI\Utils\Uuid::get(),
'description' => '(Generierter Baustein für Seite ' . $Site->getId() . ')',
'content' => "<h2 style=\"text-align: center;\">In consectetuer turpis ut velit</h2>\n\n<p style=\"max-width: 60ch; text-align: center; margin-inline: auto;\">Morbi nec metus. Quisque id mi. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi. Praesent nec nisl a purus blandit viverra. Nulla consequat massa quis enim.</p>\n",
'areas' => 'headerSuffix'
],
'settings' => [
'textPosition' => 'center',
'imagePosition' => 'imageRightAlternately',
'textRatio' => '50',
'maxImageWidth' => '500',
'entriesPerLine' => 4,
'entries' => "[{\"image\":\"image.php?id=205&project=cologne\",\"text\":\"<h3>Phasellus viverra nulla ut metus</h3>\n\n<p>Duis leo. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Donec mi odio, faucibus at, scelerisque quis, convallis in, nisi. Sed in libero ut nibh placerat accumsan. Phasellus volutpat, metus eget egestas mollis, lacus lacus blandit dui, id egestas quam mauris ut lacus.</p>\n\",\"isDisabled\":0},{\"image\":\"image.php?id=205&project=cologne\",\"text\":\"<h3>Duis vel nibh at velit</h3>\n\n<p>In auctor lobortis lacus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras ultricies mi eu turpis hendrerit fringilla.&nbsp;</p>\n\n<ul>\n\t<li>Ut non enim eleifend felis pretium feugiat.</li>\n\t<li>Fusce vulputate eleifend sapien.</li>\n\t<li>Fusce neque.</li>\n\t<li>Quisque id odio.</li>\n\t<li>Curabitur suscipit suscipit tellus.</li>\n</ul>\n\n<p><a class=\\\"btn btn-primary btn-large btn-lg\\\" href=\\\"#\\\" data-qui-productlandingpage-cta=\\\"1\\\">Jetzt bestellen <i class=\\\"fa-solid fa-cart-shopping\\\"></i></a></p>\n\",\"isDisabled\":0}]"
],
'assignedBrickArea' => 'headerSuffix'
],
[
'attributes' => [
'type' => '\\QUI\\PresentationBricks\\Controls\\WallpaperText',
'title' => 'Produkt Landingpage - Slogan - ' . QUI\Utils\Uuid::get(),
'description' => '(Generierter Baustein für Seite ' . $Site->getId() . ')',
'content' => "<p style=\"text-align: center;\"><span style=\"font-size:22px;\"><em>Phasellus viverra nulla ut metus varius laoreet. Aenean massa. Quisque libero metus, condimentum nec.</em></span></p>\n",
'areas' => 'headerSuffix'
],
'settings' => [
'minHeight' => '400px',
"bg-color" => "#f5f5f5",
"content-position" => "center",
'contentMaxWidth' => '600',
'fontColor' => '',
'general.fullWidth' => 1,
'general.noSpacing' => 1
],
'assignedBrickArea' => 'headerSuffix'
],
[
'attributes' => [
'type' => '\\QUI\\Bricks\\Controls\\Slider\\CustomerReviewsSlider',
'title' => 'Produkt Landingpage - Kunden Rezensionen - ' . QUI\Utils\Uuid::get(),
'description' => '(Generierter Baustein für Seite ' . $Site->getId() . ')',
'content' => "",
'areas' => 'headerSuffix,footerPrefix'
],
'settings' => [
'template' => 'templateOne',
'perView' => 3,
'gap' => 40,
'autoplay' => true,
'delay' => 5000,
'showArrows' => false,
'sliderHeight' => 'fixed',
'entries' => "[{\"image\":\"image.php?id=125&project=cologne\",\"customerName\":\"John Doe\",\"addition\":\"\",\"url\":\"\",\"urlTitle\":\"\",\"review\":\"<p>Vivamus laoreet. Praesent blandit laoreet nibh. Maecenas malesuada. Morbi vestibulum volutpat enim. Pellentesque dapibus hendrerit tortor.</p>\n\",\"isDisabled\":0},{\"image\":\"image.php?id=117&project=cologne\",\"customerName\":\"Peter Young\",\"addition\":\"\",\"url\":\"\",\"urlTitle\":\"\",\"review\":\"<p>Vestibulum suscipit nulla quis orci. Phasellus nec sem in justo pellentesque facilisis. Duis leo. Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Vestibulum rutrum, mi nec elementum vehicula.</p>\n\",\"isDisabled\":0},{\"image\":\"image.php?id=118&project=cologne\",\"customerName\":\"Ann Parks\",\"addition\":\"\",\"url\":\"\",\"urlTitle\":\"\",\"review\":\"<p>Ut leo. Etiam rhoncus. Ut id nisl quis enim dignissim sagittis. Nullam accumsan lorem in dui.</p>\n\",\"isDisabled\":0},{\"image\":\"image.php?id=123&project=cologne\",\"customerName\":\"Katrin Strong\",\"addition\":\"\",\"url\":\"\",\"urlTitle\":\"\",\"review\":\"<p>Vestibulum ullamcorper mauris at ligula. Proin faucibus arcu quis ante. Quisque libero metus, condimentum nec, tempor a, commodo mollis, magna. Cras ultricies mi eu turpis hendrerit fringilla. Sed fringilla mauris sit amet nibh.</p>\n\",\"isDisabled\":0}]"
],
'assignedBrickArea' => 'headerSuffix'
]
]; ];
} }
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren