So now I can create a listing page like the above page with the API content. And I will pass the query string value while we click on each item to redirect to the Detail Page.
Here we have two challenges.
Is it possible to create User-Friendly Urls/ SEO URLs for each detail page instead of query string?
Is it possible to add custom OG/Meta Title and OG/Meta Description in each detail page with these Javascript Variables?
<p id=“body_text”>
</p>
<script>
fetch(‘https://www.mynewsdesk.com/services/pressroom/list/zer0r_Gd0PCxImHUtPl4rA/’)
.then(response=>response.text())
.then(data=>{
const parser = new DOMParser();
const xmlDOM = parser.parseFromString(data,“text/xml”);
let items = xmlDOM.getElementsByTagName(‘item’);
for (i = 0, len = items.length; i < len; i++) {
debugger;
let item = items[i];
var News_body= item.getElementsByTagName(“body”)[0].childNodes[0].nodeValue;
console.log(item);