Menu

What is content fragment in AEM?


  • Content fragment is only content without any styling, or you could say it is pure text without formatting.
  • Content fragment is simple, and have only structure of the content. This structure could be paragraph, input field; which separate the multiple copy of text and input parameters at one place.
  • Structure of the content fragment is define in the model.
  • Create a content fragment model to create a new structure of your content fragment.
  • Content fragment is just only a component.
  • Using content fragment you can design undecided content, and use later on according to your requirement.
  • Content fragment is stored as an asset in DAM (digital asset management).
  • Content fragment will be always implemented as an asset.
  • Content fragment can have variation, which means you can create different variation of the same content for different platform.
  • Content fragment summarize your content at one place, so you can access the complete content in just one go.

See also:

Mohsin Naqvi - Tumhe jab ru baru dekha karenge

‏تمہیں جب رُوبرو دیکھا کریں گے
یہ سوچا ہے،بہت سوچا کریں گے

نظر میں چودھویں کا چاند ہوگا
سمندر کی زباں بولا کریں گے

نہ آئے گا کوئی الزام تجھ پر
ہم اپنے آپ کو رسوا کریں گے

اس الجھن میں کٹی ہے عمر محسنؔ
کہ پل دو پل میں ہم کیا کیا کریں گے ؟

محسن نقوی--

Create JS Object from JSON text

How to traverse on JSON (JavaScript object notation) object using JavaScript and how to traverse JSON array using JavaScript?

Below is the simple HTML and JavaScript based program, which have a JSON data object and further that json object have json array. Using JavaScript we will read that json data one by one and generate output for end user, and later that output we will show on html page.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<html>
<body>
<h2>Create JS Object from JSON String</h2>
 <p id="output">
 </p>
<script>
var txt = '{"employees":[' +
'{"firstName":"Rashid","lastName":"Jorvee" },' +
'{"firstName":"Java","lastName":"Script" },' +
'{"firstName":"Node","lastName":"JS" }]}';


var jsonData = JSON.parse(txt);
var output="";
for (var i = 0; i < jsonData.employees.length; i++) {
    var counter = jsonData.employees[i];
    console.log(counter.firstName);
    output += "First name: " +  counter.firstName +  ", Last Name: " +counter.lastName +"<br />";
 document.getElementById("output").innerHTML = output;
   
}

</script>
</body>
</html>

Output:

Create JS Object from JSON String

First name: Rashid, Last Name: Jorvee
First name: Java, Last Name: Script
First name: Node, Last Name: JS

Output on browser console: 

console output on browser debugger console
console output on browser debugger console