Skip to content

Commit

Permalink
Merge pull request #188 from quantacms/aldo-dev
Browse files Browse the repository at this point in the history
Better default generic profile
  • Loading branch information
dariokf committed Nov 2, 2018
2 parents 95b3410 + a89353d commit 0cf5e93
Show file tree
Hide file tree
Showing 32 changed files with 127 additions and 67 deletions.
4 changes: 0 additions & 4 deletions engine/modules/core/node/Node.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -482,10 +482,6 @@ class Node extends JSONDataContainer {
if (!empty($this->lineage)) {
return;
}
// Homepage should not have a lineage. TODO: correct?
if ($this->isHome()) {
return;
}

$fullpath = str_replace($this->env->dir['docroot'], '', $this->path);
$bca = explode('/', $fullpath);
Expand Down
4 changes: 2 additions & 2 deletions engine/modules/core/node/node.qtags.inc
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ function qtag_LINK($env, $target, &$attributes) {
}

// Check if there is "target" attribute.
if (isset($attributes['target'])) {
$link_target = 'target="' . $attributes['target'] . '"';
if (isset($attributes['link_target'])) {
$link_target = 'target="' . $attributes['link_target'] . '"';
}

// TODO: make just a big variable "data".
Expand Down
8 changes: 8 additions & 0 deletions profiles/generic/_components/_content-advanced/tpl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- This template is a bit more complex, includes title, teaser, a thumbnail, body and BACK button... -->
<h1>[TITLE]</h1>
<h2>[TEASER]</h2>
[THUMBNAIL|box=30xauto|centered]
[BODY]
[LIST]

[WRAPPER|wrapper_class=text-center:{BACK|title=Back to previous page...}]
3 changes: 3 additions & 0 deletions profiles/generic/_components/_content-basic/tpl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- This is a very basic template, including just title and body... -->
<h1>[TITLE]</h1>
[BODY]
6 changes: 6 additions & 0 deletions profiles/generic/_components/_content-blog/tpl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- Add the title -->
<h1>[TITLE]</h1>
<!-- Add the teaser -->
<h2>[TEASER]</h2>
<!-- Add a blog of elements -->
[BLOG|grid=content-blog p-x p-y3]
6 changes: 6 additions & 0 deletions profiles/generic/_components/_content-carousel/tpl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- Add the title -->
<h1>[TITLE]</h1>
<!-- Add the body -->
[BODY]
<!-- Add a carousel of elements -->
[CAROUSEL|grid=content-carousel p-x p-y3]
4 changes: 0 additions & 4 deletions profiles/generic/_components/_content-example/tpl.html

This file was deleted.

2 changes: 0 additions & 2 deletions profiles/generic/_components/_content/tpl.html

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
<p>Footer info here...</p>
My Agency SRL<br />
2414 S 14th St.<br />
Juicy City, NE 68108<br />
&phone; [PHONE:+1 332 33232]<br />
&#9993; [EMAIL:myagency@juicy.it]
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[MENU|menu_class=menu menu-vertical|links={LINK|title=Main page:home}---{LINK:about-grid}]
[MENU|menu_class=menu menu-vertical|links={LINK|title=Main page:home}---{LINK:fruits}---{LINK:animals}---{LINK:about-grid}]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Here you could put some other promo.
5 changes: 3 additions & 2 deletions profiles/generic/_components/_footer/_footer-blocks/tpl.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[WRAPPER|wrapper_class=grid-span-md-6:{CONTENT:_footer-1}]
[WRAPPER|wrapper_class=grid-span-md-6:{CONTENT:_footer-2}]
[CONTENT|grid=grid-span-md-4|grid_id=footer-1:_footer-1]
[CONTENT|grid=grid-span-md-4|grid_id=footer-2:_footer-2]
[CONTENT|grid=grid-span-md-4 p-x p-y|grid_id=footer-3:_footer-3]
2 changes: 1 addition & 1 deletion profiles/generic/_components/_footer/_footer-end/tpl.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
&copy;YEAR Agency info ... [OPERATIONS|prefix= - ][LOGIN|prefix= - ][REGISTER|prefix= - ]
&copy;2018 My Agency info SRL [OPERATIONS|prefix= - ][LOGIN|prefix= - ][REGISTER|prefix= - ]
5 changes: 1 addition & 4 deletions profiles/generic/_components/_footer/tpl.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
[WRAPPER|wrapper_html_tag=section|wrapper_class=grid grid-start-lg-3 grid-span-lg-8 p-y3 text-md-left:{CONTENT:_footer-blocks}]
[WRAPPER|wrapper_class=footer-end p-y p-x:{CONTENT:_footer-end}]



[WRAPPER|wrapper_class=footer-end p-y p-x:{CONTENT:_footer-end}]
2 changes: 1 addition & 1 deletion profiles/generic/_components/_header/tpl.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[CONTENT:_logo]
[MENU|menu_class=menu|links={LINK|title=Main page:home}---{LINK:about-grid}]
[MENU|menu_class=menu|links={LINK|title=Main page:home}---{LINK:fruits}---{LINK:animals}---{LINK:about-grid}]
2 changes: 1 addition & 1 deletion profiles/generic/_example_data/animals/cat/data_en.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"permissions":{"node_add":"admin","node_edit":"admin","node_delete":"admin","node_view":"anonymous"},"teaser":"A Cat","author":"administrator","body":"<p>Cat<\/p>","title":"Cat","thumbnail":"cat.jpg","timestamp":1515862800,"status":"node-status-published","files":["cat.jpg"],"weight":"50"}
{"permissions":{"node_add":"admin","node_edit":"admin","node_delete":"admin","node_view":"anonymous"},"teaser":"Cats, also called domestic cats, are carnivorous mammals, of the family Felidae.","author":"administrator","body":"<p>The cat (Felis catus, or Felis silvestris catus, literally \"woodland cat\"), often referred to as the domestic cat to distinguish from other felids and felines, is a small, typically furry, carnivorous mammal. It is often called house cat when kept as indoor pet or feral\/feral domestic cat when wild. It is often valued by humans for companionship and for its ability to hunt vermin. There are more than seventy cat breeds recognized by various cat registries.<\/p><p><br><\/p><p>Cats are similar in anatomy to the other felids, with a strong flexible body, quick reflexes, sharp teeth and retractable claws adapted to killing small prey. Cat senses fit a crepuscular and predatory ecological niche. Cats can hear sounds too faint or too high in frequency for human ears, such as those made by mice and other small animals. They can see in near darkness. Like most other mammals, cats have poorer color vision and a better sense of smell than humans. Cats, despite being solitary hunters, are a social species, and cat communication includes the use of a variety of vocalizations (mewing, purring, trilling, hissing, growling and grunting) as well as cat pheromones and types of cat-specific body language.<\/p>","title":"Cat","thumbnail":"cat.jpg","timestamp":1515862800,"status":"node-status-published","files":["cat.jpg"],"weight":"50"}

This file was deleted.

2 changes: 1 addition & 1 deletion profiles/generic/_example_data/animals/data_en.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"permissions":{"node_add":"admin","node_edit":"admin","node_delete":"admin","node_view":"anonymous"},"teaser":null,"author":"administrator","body":"<p>A list of animals:<\/p><p>[LIST]<\/p>","title":"Animals","thumbnail":null,"timestamp":1541162160,"status":"node-status-published"}
{"permissions":{"node_add":"admin","node_edit":"admin","node_delete":"admin","node_view":"anonymous"},"teaser":"A blog about your favorite pets.","author":"administrator","body":"","title":"Animals","thumbnail":null,"timestamp":1541162160,"status":"node-status-published"}
4 changes: 4 additions & 0 deletions profiles/generic/_example_data/animals/tpl--.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!-- This template will apply to sub-items of "animals" (i.e. "maine-coon", "labrador") -->
[BREADCRUMB]

[MAIN|grid=grid-start-lg-3 grid-span-lg-8 p-x p-y3:_content-basic]
2 changes: 2 additions & 0 deletions profiles/generic/_example_data/animals/tpl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!-- This is the template for the animals page -->
[MAIN|grid=grid-start-md-3 grid-start-lg-4 grid-span-md-8 grid-span-lg-6 p-x p-y0:_content-blog]
2 changes: 1 addition & 1 deletion profiles/generic/_example_data/fruits/banana/data_en.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"permissions":{"node_add":"admin","node_edit":"admin","node_delete":"admin","node_view":"anonymous"},"name":"banana","teaser":"Bananas are tasty fruits. They are green when unripe and turn yellow as they ripen. They have a nice, relaxing flavour.","author":"administrator","body":"<p>Banana is the common name for a type of herb and also the name for the herbaceous plants that grow this herb. These plants belong to the genus Musa. They are native to the tropical region of Southeast Asia. There are about 110 different species of banana.<\/p><p>It is thought that bananas were grown for food for the first time in Papua New Guinea.[1] Today, they are cultivated in tropical regions around the world.[2]<\/p><p>Most banana plants are grown for their herbs, but some are grown as ornamental plants, or for their fibres.[3] In parts of Africa, beer has been made by fermenting the juice of certain cultivars, known as beer bananas.[3] The ash of banana can be used to make soap.[3] In Asia, bananas are often planted to provide shade to plants that like shade, for example coffee, cocoa, nutmeg or black pepper.[3] Because of this, banana plants can often be found in plantations of other crops.<\/p><p>Some kinds, or cultivars, of banana have a firmer, starchier fruit. These kinds are called plantains. Plantains are mostly used for cooking or fibre. The sweet, soft bananas that are used for desserts are called dessert bananas.<\/p>","title":"Banana","thumbnail":"banana.png","timestamp":1515862800,"status":"node-status-published"}
{"permissions":{"node_add":"admin","node_edit":"admin","node_delete":"admin","node_view":"anonymous"},"name":"banana","teaser":"Bananas are tasty fruits. They are green when unripe and turn yellow as they ripen. They have a nice, relaxing flavour.","author":"administrator","body":"<p>Banana is the common name for a type of herb and also the name for the herbaceous plants that grow this herb. These plants belong to the genus Musa. They are native to the tropical region of Southeast Asia. There are about 110 different species of banana.<\/p><p>It is thought that bananas were grown for food for the first time in Papua New Guinea. Today, they are cultivated in tropical regions around the world.<\/p><p>Most banana plants are grown for their herbs, but some are grown as ornamental plants, or for their fibres. In parts of Africa, beer has been made by fermenting the juice of certain cultivars, known as beer bananas. The ash of banana can be used to make soap. In Asia, bananas are often planted to provide shade to plants that like shade, for example coffee, cocoa, nutmeg or black pepper. Because of this, banana plants can often be found in plantations of other crops.<\/p><p>Some kinds, or cultivars, of banana have a firmer, starchier fruit. These kinds are called plantains. Plantains are mostly used for cooking or fibre. The sweet, soft bananas that are used for desserts are called dessert bananas.<\/p>","title":"Banana","thumbnail":"banana.png","timestamp":1515862800,"status":"node-status-published"}
2 changes: 1 addition & 1 deletion profiles/generic/_example_data/fruits/data_en.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"permissions":{"node_add":"admin","node_edit":"admin","node_delete":"admin","node_view":"anonymous"},"teaser":null,"author":"administrator","body":"<h2>...as seen using the list qtag [LIST|showtag:fruits]<\/h2><p>[LIST|box=100xauto:fruits]<\/p><h2>...as seen using the blog qtag [BLOG|showtag:fruits]<\/h2><p>[BLOG|box=100xauto:fruits]<\/p><h2>...as seen using the carousel qtag [CAROUSEL|showtag:fruits]<\/h2><p>[CAROUSEL|box=100xauto:fruits]<\/p><h2>...as seen as you wish it to be seen!<\/h2><p><br><\/p>","title":"Fruits","thumbnail":null,"timestamp":1541161740,"status":"node-status-published"}
{"permissions":{"node_add":"admin","node_edit":"admin","node_delete":"admin","node_view":"anonymous"},"teaser":null,"author":"administrator","body":"<p>...Here is a simple carousel of Fruits. They look tasty and fresh.&nbsp;<\/p><p>If you do like fruits as much as I do, [ADD|title=add:fruits] some new one to the basket :-)&nbsp;<\/p><p><br><\/p>","title":"Fruits","thumbnail":null,"timestamp":1541161740,"status":"node-status-published"}
2 changes: 2 additions & 0 deletions profiles/generic/_example_data/fruits/tpl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!-- This is the template for the fruits page -->
[MAIN|grid=grid-start-md-3 grid-start-lg-4 grid-span-md-8 grid-span-lg-6 p-x p-y0:_content-carousel]
3 changes: 2 additions & 1 deletion profiles/generic/_example_data/tpl--.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- This template will apply to sub-items of "animals" and "fruits" (i.e. "cat", "apple") -->
[BREADCRUMB]

[MAIN|grid=grid-start-lg-3 grid-span-md-8 p-x p-y3:_content-example]
[MAIN|grid=grid-start-lg-3 grid-span-lg-8 p-x p-y3:_content-advanced]
3 changes: 0 additions & 3 deletions profiles/generic/_example_data/tpl-.html

This file was deleted.

60 changes: 53 additions & 7 deletions profiles/generic/assets/css/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* GENERAL */

body {
font-family: Arial, Helvetica, sans-serif;
color: #333;
Expand All @@ -11,29 +13,27 @@ a {
/* HEADER */

header {
background: #eee;
background: #f3f3f3;
}

header nav a {
color: #666;
text-transform: uppercase;
padding: 5px;
}



/* 1st SIDE */

#side-first {
background: #ddd;
background: #fffacd;
}

/* 2nd SIDE */

#side-second {
background: #bbb;
background: #f4f8ff;
}


/* FOOTER */

footer {
Expand All @@ -54,6 +54,52 @@ footer a {
color: #ddd;
}

nav.menu.menu-vertical li+li {
/* SMALL STYLING FOR EXAMPLES */

.blog-thumb {
margin-top: 10px;
margin-bottom: 10px;
}

.list-blog-item {
border-bottom: 1px dashed #ddd;
padding-bottom: 10px;
margin-bottom: 10px;
}

.blog-preview {
margin-bottom: 10px;
}

.blog-title {
padding: 10px;
font-size: 1.4em;
}

h1 {
margin-bottom: 20px;
margin-top: 20px;
}

body.page-animals {
background: url(https://t3.ftcdn.net/jpg/01/01/56/18/240_F_101561831_VwcFxxCBpUqBxpppW8abJmcNOKOXzUOL.jpg);
}

body.page-fruits {
background: #fff2c9;
}

body.page-animals main,
body.page-fruits main {
background: #fff;
}

body.page-animals .content-blog {
margin-top: 15px;
padding-top: 15px;
border-top: 1px solid #aaa;
}

#footer-3 {
background: #6f6f6f;
}
2 changes: 1 addition & 1 deletion profiles/generic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<!-- Site's header -->
[HEADER:_header]

<!-- Currently viewed node's content -->
[CONTENT|grid_id=grid-main|grid=grid grid-container]

Expand Down
2 changes: 1 addition & 1 deletion profiles/generic/pages/about-grid/data_en.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"permissions":{"node_add":"admin","node_edit":"admin","node_delete":"admin","node_view":"anonymous"},"teaser":null,"author":"administrator","body":"<p>The GRID system is based on <a href=\"https:\/\/www.w3schools.com\/css\/css_grid.asp\" target=\"_blank\">CSS Grid<\/a>.&nbsp;<\/p><p>To know the basics about css grid visit this link: <a href=\"https:\/\/www.w3schools.com\/css\/css_grid.asp\" target=\"_blank\"><\/a><a href=\"https:\/\/www.w3schools.com\/css\/css_grid.asp\">https:\/\/www.w3schools.com\/css\/css_grid.asp<\/a><\/p><h2>Using Grid with qTags<\/h2><p>Doing grids in Quanta is easy, thanks to qTags.&nbsp;<\/p><p>By adding grid parameters to your qTags, in facts, you can create complex layouts without even writing a single line of CSS.<\/p><p>A grid in Quanta has 12 columns by default.&nbsp;<\/p><p>Each element (qTag) contained inside a grid can have a customized &nbsp;position, column span, row span, etc.&nbsp;<\/p><p>Any element (including the body) having the class \"grid\" will become a 12-columns grid by default.<\/p><p>By setting this class, the element becomes a grid container, and direct sons will be the grid cells. A grid cell, can of course be a grid itself.<\/p><p><br><\/p><h2>Grid attributes - reference chart<\/h2><p>The grid system in Quanta is thought mobile-first - so the default definitions (column span, etc.) will apply to all resolutions, from mobile on. Then you can define two different definitions for tablet \/ medium screens (md) and desktop\/laptop\/large screens (lg), as follows:<\/p><p><br><\/p><table><tbody><tr><td><strong>Attribute name (css class)<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><tr><td>grid<\/td><td>Makes the qTag a \"grid\" (12x12 by default)&nbsp;<\/td><\/tr><tr><td>grid-span-X<\/td><td>Defines the column span of the grid&nbsp;<\/td><\/tr><tr><td>grid-span-md-X<\/td><td>Defines the column span of the grid in MEDIUM screens<\/td><\/tr><tr><td>grid-span-lg-X<\/td><td>Defines the column span of the grid in LARGE screens<br><\/td><\/tr><tr><td>grid-row-span-X<br><\/td><td>Defines the row span of the grid<br><\/td><\/tr><tr><td>grid-row-span-md-X<br><\/td><td>Defines the row span of the grid in MEDIUM screens<br><\/td><\/tr><tr><td>grid-row-span-lg-X<br><\/td><td>Defines the row span of the grid in LARGE screens<br><\/td><\/tr><tr><td>p-0<\/td><td>Defines a zero-padding cell item<\/td><\/tr><tr><td><br><\/td><td><br><\/td><\/tr><\/tbody><\/table><h2><br><\/h2><h2>Examples<\/h2><p>A grid example with a LIST qtag:<\/p><pre>[LIST|showtag|grid=grid|grid_list_item=grid-span-4:fruits]<\/pre><p>[LIST|grid=grid|grid_list_item=grid-span-4:fruits]<\/p><p><br><\/p><p>A grid example with BLOG qtag:<\/p><pre>[BLOG|showtag|grid=grid|grid_list_item=grid-span-4:fruits]<\/pre><p>[BLOG|grid=grid|grid_list_item=grid-span-4:fruits]<\/p><p><br><\/p><p>A grid example with LIST qtag and a style template:<\/p><pre>[LIST|showtag||tpl=image_title_linked|grid=grid|grid_list_item=grid-span-4:animals]<\/pre><p>[LIST||tpl=image_title_linked|grid=grid|grid_list_item=grid-span-4:animals]<\/p>","title":"About Grid","thumbnail":null,"timestamp":1541094900,"status":"node-status-published"}
{"permissions":{"node_add":"admin","node_edit":"admin","node_delete":"admin","node_view":"anonymous"},"teaser":null,"author":"administrator","body":"<p>This is a page about Fruits and Animals.&nbsp;<\/p><p><span style=\"background-color: initial; text-align: initial;\">We have added it as an example for you to learn doing grids in Quanta - that's actually easy.&nbsp;<\/span><\/p><p>By adding grid parameters to your qTags, in facts, you can create complex layouts without even writing a single line of CSS.<\/p><p>A grid in Quanta has 12 columns by default.&nbsp;<\/p><p>Each element (qTag) contained inside a grid can have a customized &nbsp;position, column span, row span, etc.&nbsp;<\/p><p>Any element (including the body) having the class \"grid\" will become a 12-columns grid by default.<\/p><p>By setting this class, the element becomes a grid container, and direct sons will be the grid cells. A grid cell, can of course be a grid itself.<\/p><h2><br>Examples<\/h2><p>A grid example with a LIST qtag:<\/p><pre>[LIST|showtag|grid=grid|grid_list_item=grid-span-4:fruits]<\/pre><p>[LIST|grid=grid|grid_list_item=grid-span-12 grid-span-md-4:fruits]<\/p><p><br><\/p><p>A grid example with BLOG qtag:<\/p><pre>[BLOG|showtag|grid=grid|grid_list_item=grid-span-4:fruits]<\/pre><p>[BLOG|grid=grid|grid_list_item=grid-span-12 grid-span-md-4:fruits]<\/p><p><br><\/p><p>A grid example with LIST qtag and a style template:<\/p><pre>[LIST|showtag|tpl=image_title_linked|grid=grid|grid_list_item=grid-span-4:animals]<\/pre><p>[LIST|tpl=image_title_linked|grid=grid|grid_list_item=grid-span-md-4 grid-span-12:animals]<\/p>","title":"About Grid","thumbnail":null,"timestamp":1541094900,"status":"node-status-published"}
2 changes: 1 addition & 1 deletion profiles/generic/pages/home/data_en.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"teaser":null,"author":"administrator","body":"<p>Welcome in your new QUANTA Homepage. That's where everything begins...<\/p>","title":"Your Homepage","thumbnail":null,"timestamp":1541086800,"status":"node-status-published","permissions":{"node_add":"admin","node_edit":"admin","node_delete":"admin","node_view":"anonymous"}}
{"teaser":null,"author":"administrator","body":"<p>Welcome in your brand new QUANTA Homepage. That's where everything begins!<\/p><p>To have you started soon, we created for you some sample content such as a [LINK|title=animal blog:animals] and a [LINK|title=fruits carousel:fruits].<\/p><p>All the documentation you need to get started is in the [LINK|link_target=blank|protocol=https|title=Quanta website:www.quantacms.com\/documentation].<\/p><p><br><\/p>","title":"Your Homepage","thumbnail":null,"timestamp":1541086800,"status":"node-status-published","permissions":{"node_add":"admin","node_edit":"admin","node_delete":"admin","node_view":"anonymous"}}

0 comments on commit 0cf5e93

Please sign in to comment.