Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Removed data-v-type from component template to avoid conflict with type parameter

givanzadd21c057a21
diff --git a/app/template/components/post.tpl b/app/template/components/post.tpl
index 1c23f9b..1e8b806 100755
--- a/app/template/components/post.tpl
+++ b/app/template/components/post.tpl
@@ -3,7 +3,6 @@
//editor info
@post|data-v-id = $post['post_id']
-@post|data-v-type = 'post'
@post|before = <?php
diff --git a/app/template/components/posts.tpl b/app/template/components/posts.tpl
index 2641d47..b13afb9 100755
--- a/app/template/components/posts.tpl
+++ b/app/template/components/posts.tpl
@@ -3,8 +3,7 @@
@post = [data-v-component-posts] [data-v-post]
//editor info
-@post|data-v-id = $post['post_id']
-@post|data-v-type = 'post'
+@post|data-v-id = $post['post_id']
//search
@posts [data-v-search] = $posts['search']
@@ -31,8 +30,8 @@
$_default = (isset($vvveb_is_page_edit) && $vvveb_is_page_edit ) ? [0 => []] : [];
$_posts = empty($posts['post']) ? $_default : $posts['post'];
//$pagination = $this->posts[$_posts_idx]['pagination'];
-$count = 0;
-foreach ($_posts as $index => $post) {?>
+$index = 0;
+foreach ($_posts as $id => $post) {?>
//editor attributes
@@ -63,7 +62,7 @@ foreach ($_posts as $index => $post) {?>
@post [data-v-post-excerpt] = <?php if (isset($post['excerpt'])) echo($post['excerpt']);?>
@post|after = <?php
- $count++;
+ $index++;
}
$current_component = $previous_component;
diff --git a/app/template/components/product.tpl b/app/template/components/product.tpl
index 384e1c2..c5cc18f 100755
--- a/app/template/components/product.tpl
+++ b/app/template/components/product.tpl
@@ -3,7 +3,6 @@
@product|data-v-id = $product['product_id']
-@product|data-v-type = 'product'
@product|before = <?php
$vvveb_is_page_edit = Vvveb\isEditor();
@@ -20,7 +19,6 @@ $_pagination_limit = isset($product['limit']) ? $product['limit'] : 5;
//editor attributes
@product|data-v-id = $product['product_id']
-@product|data-v-type = 'product'
//manual echo to avoid html escape
@product [data-v-product-content] = <?php echo($product['content']);?>
diff --git a/app/template/components/products.tpl b/app/template/components/products.tpl
index 4a6fa97..928ab93 100755
--- a/app/template/components/products.tpl
+++ b/app/template/components/products.tpl
@@ -34,7 +34,7 @@
@product|before = <?php
if ($prods) {
- foreach ($prods as $index => $prod) { $index++;?>
+ foreach ($prods as $id => $prod) { ?>
@product [data-v-product-*]|innerText = $prod['@@__data-v-product-(*)__@@']
@product a[data-v-product-*]|href = $prod['@@__data-v-product-(*)__@@']
@@ -42,7 +42,6 @@ if ($prods) {
//editor attributes
@product|data-v-id = $prod['product_id']
- @product|data-v-type = 'product'
//title attributes
@product [data-v-product-alt]|alt = $prod['name']
@@ -119,9 +118,10 @@ if ($prods) {
//echo description directly to avoid htmlspecialchars escape
@product [data-v-product-content] = <?php echo($prod['content']);?>
- @product|after = <?php
+ @product|after = <?php
+ $index++;
}
}
$current_component = $previous_component;
-?>
\ No newline at end of file
+?>