Integration of Assetic in SmartyParser, extended it to Admin (we can now
use loops !), added the Thelia ControllerResolver and fixed config and routing accordingly.²:wq
This commit is contained in:
9
templates/smarty-sample/assets/css/style.less
Normal file
9
templates/smarty-sample/assets/css/style.less
Normal file
@@ -0,0 +1,9 @@
|
||||
body {
|
||||
font-size: 12px;
|
||||
font-family: Arial, helvetica, sans serif;
|
||||
background-image: url("../img/test-background.jpg");
|
||||
}
|
||||
|
||||
div {
|
||||
margin: 10px 0;
|
||||
}
|
||||
BIN
templates/smarty-sample/assets/img/logo-thelia-34px.png
Normal file
BIN
templates/smarty-sample/assets/img/logo-thelia-34px.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.4 KiB |
BIN
templates/smarty-sample/assets/img/test-background.jpg
Normal file
BIN
templates/smarty-sample/assets/img/test-background.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 59 KiB |
6
templates/smarty-sample/assets/js/jquery.min.js
vendored
Normal file
6
templates/smarty-sample/assets/js/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
0
templates/smarty-sample/i18n/en.php
Normal file
0
templates/smarty-sample/i18n/en.php
Normal file
1
templates/smarty-sample/i18n/fr.php
Normal file
1
templates/smarty-sample/i18n/fr.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php
|
||||
18
templates/smarty-sample/includes/footer.html
Normal file
18
templates/smarty-sample/includes/footer.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{* Include required JS files *}
|
||||
|
||||
{javascripts file='../assets/js/*'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$('#jquery_block').html("Jquery is now loaded.").hover(function() {
|
||||
$(this).css('font-weight', 'bold');
|
||||
}, function() {
|
||||
$(this).css('font-weight', 'normal');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
11
templates/smarty-sample/includes/header.html
Normal file
11
templates/smarty-sample/includes/header.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{intl l='Hi, I\'m a Thelia TPex template'}</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
{stylesheets file='../assets/css/*' filters='less,cssembed'}
|
||||
<link rel="stylesheet" href="{$asset_url}">
|
||||
{/stylesheets}
|
||||
</head>
|
||||
<body>
|
||||
@@ -1,61 +1,77 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<p>Category loop example</p>
|
||||
{loop type="category" name="catloop1"}
|
||||
{$__COUNT__}/{$__TOTAL__} : {$ID} {$TITLE} <br />
|
||||
nb child : {$NB_CHILD} <br /><br />
|
||||
{/loop}
|
||||
</div>
|
||||
{include file="includes/header.html"}
|
||||
<div>
|
||||
An image from asset directory :
|
||||
{images file='assets/img/logo-thelia-34px.png'}<img src="{$asset_url}" alt="{intl l='Thelia, solution e-commerce libre'}" />{/images}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p>Conditional example #1</p>
|
||||
<div>
|
||||
{intl l='An internationalized string'}
|
||||
</div>
|
||||
|
||||
{notempty name="catloop2"}
|
||||
Loop catloop2 is not empty: <ul>
|
||||
{loop type="category" name="catloop2" parent="12"}
|
||||
<li>{$__COUNT__}/{$__TOTAL__} : {$ID} {$TITLE}</li>
|
||||
{/loop}
|
||||
</ul>
|
||||
{/notempty}
|
||||
<div>
|
||||
jQuery data: <span id="jquery_block"></span>
|
||||
</div>
|
||||
|
||||
{empty name="catloop2"}
|
||||
<p>Loop catloop2 is empty</p>
|
||||
{/empty}
|
||||
<div>
|
||||
<p>Category loop example</p>
|
||||
<ul>
|
||||
{loop type="category" name="catloop1"}
|
||||
<li>{$__COUNT__}/{$__TOTAL__} : {$ID} {$TITLE}, children: {$NB_CHILD}
|
||||
{ifloop rel="inner1"}
|
||||
<ul>
|
||||
{loop type="category" name="inner1" parent="{$ID}"}
|
||||
<li>Sub cat {$ID} (parent is {$PARENT}): {$TITLE}</li>
|
||||
{/loop}
|
||||
</ul>
|
||||
{/ifloop}
|
||||
</li>
|
||||
{/loop}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<p>Conditional example #1</p>
|
||||
|
||||
<div>
|
||||
<p>Conditional example #2</p>
|
||||
{ifloop rel="catloop2"}
|
||||
Hey ! Loop catloop2 is not empty:
|
||||
<ul>
|
||||
{loop type="category" name="catloop2" parent="12"}
|
||||
<li>{$__COUNT__}/{$__TOTAL__} : {$ID} {$TITLE}</li>
|
||||
{/loop}
|
||||
</ul>
|
||||
{/ifloop}
|
||||
|
||||
{notempty name="catloop3"}
|
||||
Loop catloop3 is not empty: <ul>
|
||||
{loop type="category" name="catloop3" parent="0"}
|
||||
<li>{$__COUNT__}/{$__TOTAL__} : {$ID} {$TITLE}</li>
|
||||
{/loop}
|
||||
</ul>
|
||||
{/notempty}
|
||||
{elseloop rel="catloop2"}
|
||||
<p>Loop catloop2 is empty</p>
|
||||
{/elseloop}
|
||||
</div>
|
||||
|
||||
{empty name="catloop3"}
|
||||
<p>Loop catloop3 is empty</p>
|
||||
{/empty}
|
||||
<div>
|
||||
<p>Conditional example #2</p>
|
||||
|
||||
{empty name="catloop2"}
|
||||
<p>... but catloop2 is still empty :-)</p>
|
||||
{/empty}
|
||||
{ifloop rel="catloop3"}
|
||||
Loop catloop3 is not empty:
|
||||
<ul>
|
||||
{loop type="category" name="catloop3" parent="0"}
|
||||
<li>{$__COUNT__}/{$__TOTAL__} : {$ID} {$TITLE}</li>
|
||||
{/loop}
|
||||
</ul>
|
||||
{/ifloop}
|
||||
|
||||
</div>
|
||||
{elseloop rel="catloop3"}
|
||||
<p>Loop catloop3 is empty</p>
|
||||
{/elseloop}
|
||||
|
||||
<div>
|
||||
<p>Traditional for loop</p>
|
||||
{for $index=5 to 12 step 1}
|
||||
Compteur = {$index}<br />
|
||||
{/for}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
{elseloop rel="catloop2"}
|
||||
<p>... but catloop2 is still empty :-)</p>
|
||||
{/elseloop}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p>Traditional for loop</p>
|
||||
{for $index=5 to 12 step 1}
|
||||
Compteur = {$index}<br />
|
||||
{/for}
|
||||
</div>
|
||||
|
||||
{include file="includes/footer.html"}
|
||||
Reference in New Issue
Block a user