Hello,
I have the following setup:
I have a form named "application" which holds data about an application. When a new entry is created, this form creates a new page tree for the new entry by using several IFTTTs macros. The pages themselves are using templates, which are passed to the IFTTT in the macro body. The form also creates entries for all sub forms.
I have a second form named "common" which holds some specific data about the applications, which are in the first form. The common form works as sub form of the application form. One of the stored fields in the common form is "page" where I store the confluence page on which the view is located.
So when I create an application I get a application form entry, a corresponding common form entry and a page for the common data. This setup works fine so far.
Now my new requirement is this:
I need to gather additional contact information to my common data. This data shall be organized or structured in a certain way (or in other words: I don't want to allow free text). To achieve this I created a second form named contacts which holds classic contact information like firstname, lastname, phone number, etc.
My requirement would be to use something like nested forms where I create a new application entry which creates a new commin entry and when I edit a common entry I can create a new contact entry "on-the-fly". But as this is not possible with Confiforms (no nested forms), I decided to try another way. My idea is this:
This seemed to work, but I have a problem now. Because I use a page template in the initial creation of the common page the [entry._page] variable gets evaluated in that situation and I get a wrong page in my contact view filter. This results in an empty contact view as no entry has that page id.
I also tried a form filter macro, but in the end it was the same problem with the evaluation of the [entry._page] before the page is shown. But I do not want to show any form filter macro to the user (but i guess it can be set invisible).
My questions are now:
edit: As this setup is quite big I did not create a working example or attached storage format code. If this is necessary I can provide this.
You can use asEntryRef function in your template, so when the page gets created the function gets evaluated and you get the output as [entry._page]
[entry.id.asEntryRef(entry._page)]
(instead of [entry._page])
Alex
Hi Alex,
I just found that too. It works as intended! I hoped I would be faster than you with my answer, but I had no chance :D
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Jens,
Is it possible to use page title instead of page id?
Another possible solution is to use the Table Filter macro with the @pageTitle variable.
And one more tip: maybe you could lookup two tables like in these examples.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.