Ok thanks for your comment 😉
First my Struct-Schema in shortened version. I think these are the important informations.
The key information is that the lookup-variable lkupkomm
links to the first text-variable komm
{
"structversion": "2021-01-31",
"schema": "projects",
"columns": [
{
"colref": 1,
"sort": 10,
"label": "Komm",
"class": "Text",
},
{
"colref": 2,
"sort": 20,
"label": "Name",
"class": "Text",
},
{
"colref": 3,
"sort": 1000,
"label": "lkupkomm",
"class": "Lookup",
"config": {
"schema": "projects",
"field": "komm",
}
}
]
}
With that in mind:
First Start page: Here I create a new projects.
The page is located here: :projects
====== Projects ======
---- struct table ----
schema: projects
cols: %title%, Komm, Name
csv: 0
----
==== Create new project ====
<form>
action template templates:new-project projects: :
struct_field "projects.Komm" @
struct_field "projects.Name" submit
</form>
The template it uses is located in templates:new-project
It directly creates sublinks in the target-namespace projects:
====== @@projects.Komm@@ - @@projects.Name@@ ======
===== applicable documents =====
* [[projects:@@projects.Komm@@:1|Information1]]
* [[projects:@@projects.Komm@@:2|Information2]]
* ...
Until here everything works good. Now I want to create the documents in the sublinks.
The documents are defined in another namespace.
It uses a template out of the template folder and it can only create the page in a project-page i already defined before. Because it uses the lookup-variable lkupkomm
where you only can choose the predefined projects.
Location for example: quality-handbook:informations:1
==== Information1 ====
*some general definitions*
==== Create new Information1 for project ====
<form>
action template templates:1 "projects:@@projects.lkupkomm@@:1"
struct_field "projects.lkupkomm"
struct_fieldhidden "projects.name" "=["""",0]" /*This is not functioning*/
struct_fieldhidden "projects.name" "=[""projects@@projects.lkupkomm@@:"",0]" /*This is not functioning, too*/
...
and in 'templates:1'
====== 01 Information ======
Project: @@projects.name@@
Komm.: @@projects.lkupkomm@@
of course the @@projects.lkupkomm@@
is correctly working and the new page is in the right namespace beneath the correct project but the projects.name
has no functionality. It is filled with "=["",0]"
or "=["projects@@projects.lkupkomm@@:",0]"
but not with a database-value.
My solution-ideas:
1) I already thought about renaming my project-pages and only give them the project-name so i could be able to use the placeholder @NSBASE@ in my template:1
but for other documents i definitely need more than 2 variables.
2) And it would also be possible to generate for every variable a second lookup-variable so the user has to pick every variable of a project in quality-handbook:informations:1
to create a new document but than the user can make mistakes.
So my understanding of what should somehow be possible:
Either it has to be possible that the bureaucracy form can access corresponding variables when selecting a specific project or it should be possible to have placeholders that access the struct-information of the target-namespace.
But maybe I'm not on the right way so I hope you can help 😉