> ## Content Index
> Fetch the complete content index at: https://www.bramadams.dev/llms.txt
> Use this file to discover other available public pages before exploring further.

# Getting Dv and Templater to Freeze Lists into Html
- URL: https://www.bramadams.dev/202212172005/
- Published: 2023-02-01T00:14:46.000Z
- Updated: 2023-02-01T00:14:46.000Z
- Author: Bram Adams
- Tags: obsidian, programming

## v1

```js
<%*
const dv = this.app.plugins.plugins["dataview"].api ;
const te = await dv.queryMarkdown(`TABLE resources as Resources WHERE  contains(projects, "Migration from 2022 to 2023")`)
tR += te.value
%>

```

reference notes for v2

```js
<%*  
const dv = app.plugins.plugins["dataview"].api;  
const ingr = tp.frontmatter.ingredients;  
let sortedIngr = ingr.sort();  
var arr = [];  
	for (i=0; i < sortedIngr.length; i++) {  
	var name = sortedIngr[i];  
	var link = '<a href="https://bram-adams.ghost.io/' + name + '">' + name + '</a>'  
	arr.push(link);  
	}  
let dvList = dv.markdownList(arr);  
tR += dvList;  
%>

```

## v2 (did Not compile)

```js
<%*
const dv = this.app.plugins.plugins["dataview"].api ;
const projectsFM = tp.frontmatter.projects; // look for projects in frontmatter

console.log(projectsFM)
const projectName = "Migration from 2022 to 2023"
const arr = [];

for (let i = 0; i < projectsFM.length; i++) {
	if (projectsFM[i] === projectName) { 
		arr.push(`<a href="https://bram-adams.ghost.io/${projectsFM[i]}">${projectsFM[i]}</a>`)
	}
}

let dvList = dv.markdownList(arr);
tR += dvList;
%>

```

## v3 (works!)

*(command: templater -> replace template in modal then remove backticks -- should probably be done only on archive)*

```js
<%*
const dv = this.app.plugins.plugins["dataview"].api ;
const arr = await dv.queryMarkdown(`LIST where contains(projects, "Migration from 2022 to 2023")`)
tR += arr.value
%>

```