arnaucube
arnaucube/konstruiPublic Self-hosted repository
multi repeatJSON
arnaucode arnaucode@gmail.com
Wed, 11 Oct 2017 13:02:30 +0200
commit

94863dae3a07153a497f01999fd5385827fa5242

parent

9d654445f41bf29030856f06e00c73ce766f54a7

2 files changed, 5 insertions(+), 2 deletions(-)

jump to
M .gitignore → .gitignore

@@ -1,2 +1,3 @@

/webInput /webOutput +/webInputOK
M templating.go → templating.go

@@ -88,8 +88,10 @@

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, "")