Browse Source

multi repeatJSON

master
arnaucode 6 years ago
parent
commit
94863dae3a
2 changed files with 5 additions and 2 deletions
  1. +1
    -0
      .gitignore
  2. +4
    -2
      templating.go

+ 1
- 0
.gitignore

@ -1,2 +1,3 @@
/webInput
/webOutput
/webInputOK

+ 4
- 2
templating.go

@ -88,8 +88,10 @@ func konstruiRepeatJSONPartTwo(templateContent string, entries []dataEntry, json
return templateContent
}
func konstruiRepeatJSON(templateContent string) string {
if strings.Contains(templateContent, "<konstrui-repeatJSON") {
dataPath, _ := getTagParameters(templateContent, "konstrui-repeatJSON", "repeatJSON", "nil")
for strings.Contains(templateContent, "<konstrui-repeatJSON") {
tlines := getLines(templateContent)
tp := locateStringInArray(tlines, "konstrui-repeatJSON")
dataPath, _ := getTagParameters(tlines[tp[0]], "konstrui-repeatJSON", "repeatJSON", "nil")
dataPath = strings.Replace(dataPath, "\n", "", -1)
entries, jsonData := getDataFromJson(rawFolderPath + "/" + dataPath)
templateContent = konstruiRepeatJSONPartTwo(templateContent, entries, jsonData, "")

Loading…
Cancel
Save