mirror of
https://github.com/arnaucube/konstrui.git
synced 2026-02-06 19:16:41 +01:00
multi repeatJSON
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
/webInput
|
||||
/webOutput
|
||||
/webInputOK
|
||||
|
||||
@@ -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, "")
|
||||
|
||||
Reference in New Issue
Block a user