I am doing help section like a website for commercial software. For this purpose the website will actually be installed locally with the software and not on the server, so I can not use the server tool to create the database I use javascript, jquery and CSS (any SQL or PHP) I am
In order to make repeated text sections easily replaceable, I need some form of text, I can modify jQuery or jQuery via javascript manually or
For example: We say that the same text description of a specific software asset is displayed in 5 different pages and is displayed several times on the same page. Such details will be later modified by the software developer, which will access it from the page (using pop-up text input), and that amendment must be applied to the entire website for that property.
Again, keep in mind that this website will be stored locally on disk.
You need a JavaScript templating engine. One of the first and good people is that you can use it to make layout once and apply the layouts of all the data you have, so that you can separate the data and presentation.
This is the base layout for your item:
& lt; Div class = "entry" & gt; & Lt; H1 & gt; {{Title}} & lt; / H1> & Lt; Div class = "body" & gt; {{Body}} & lt; / Div & gt; & Lt; / Div & gt;
If you have multiple items, you can use JSON as a feed:
[{title: "My Post 1" , Body: "This is my first post!"}, {Title: "My old post", body: "This is my first post!" }, {Title: "My latest post", body: "This is my first post!" }, {Title: "My new post", body: "This is my first post!" }]
And you can apply the same layout for all four positions! The code above is executed on the client side, as follows:
& lt; Div class = "entry" & gt; & Lt; H1 & gt; My post 1 & lt; / H1> & Lt; Div class = "body" & gt; This is my first post! & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "entry" & gt; & Lt; H1 & gt; My old post & lt; / H1> & Lt; Div class = "body" & gt; This is my first post! & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "entry" & gt; & Lt; H1 & gt; My latest post & lt; / H1> & Lt; Div class = "body" & gt; This is my first post! & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "entry" & gt; & Lt; H1 & gt; My new post & lt; / H1> & Lt; Div class = "body" & gt; This is my first post! & Lt; / Div & gt; & Lt; / Div & gt;
For more information about compiling a template, see the execution.
Comments
Post a Comment