Powerful and easy to use cms to build websites, blogs or ecommerce stores.
HTML backendblogblog-engineblog-platformbloggingcmscontent-managementcontent-management-systemecommerceecommerce-platformno-codepage-builderphpphp-cmsphp7php8self-hostedshopping-cartweb-applicationwebsite-builder
Post component
givanzb7d19ff6bbdb
diff --git a/public/js/vvvebjs/components/content/index.js b/public/js/vvvebjs/components/content/index.jsindex 0e0d9c0..dcc08d4 100755--- a/public/js/vvvebjs/components/content/index.js+++ b/public/js/vvvebjs/components/content/index.js@@ -19,6 +19,7 @@*/import {postsComponent} from './posts.js';+import {postComponent} from './post.js';import {categoriesComponent} from './categories.js';import {archivesComponent} from './archives.js';import {recentPostsComponent} from './recentPosts.js';@@ -32,6 +33,7 @@ import {currencyComponent} from './currency.js';Vvveb.Components.add("content/posts", postsComponent);+Vvveb.Components.add("content/post", postComponent);Vvveb.Components.add("content/categories", categoriesComponent);Vvveb.Components.add("content/archives", archivesComponent);//Vvveb.Components.add("content/recentPosts", recentPostsComponent);@@ -46,6 +48,7 @@ Vvveb.Components.add("content/currency", currencyComponent);Vvveb.ComponentsGroup['Content'] = ["content/posts",+ "content/post","content/categories","content/archives",// "content/recentPosts",diff --git a/public/js/vvvebjs/components/content/post.js b/public/js/vvvebjs/components/content/post.jsnew file mode 100644index 0000000..93980aa--- /dev/null+++ b/public/js/vvvebjs/components/content/post.js@@ -0,0 +1,64 @@+/**+ * Vvveb+ *+ * Copyright (C) 2021 Ziadin Givan+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <https://www.gnu.org/licenses/>.+ *+ */++import {ServerComponent} from '../server-component.js';++let template =+`<div data-v-component-post="post" data-v-post_id="1">+ <h2 data-v-post-name>Post name</h2>+ <img class="img-fluid" src="media/posts/6.jpg" alt="">+ <div data-v-post-content>Post content</div>+</div>+`;++class PostComponent extends ServerComponent{+ constructor () {+ super();++ this.name = "Post";+ this.attributes = ["data-v-component-post"],++ this.image ="icons/post.svg";+ this.html = template;++ this.properties = [{+ name: "Post name <span class='text-muted'>(autocomplete)</span>",+ key: "post",+ group:"autocomplete",+ htmlAttr:"data-v-post_id",+ inline:false,+ col:12,+ inputtype: AutocompleteInput,+ data: {+ url: "/admin/?module=editor/autocomplete&action=posts&type=",+ },++ }];+ }++ init(node) {+ }+}++let postComponent = new PostComponent;++export {+ postComponent+};