Create new entry with data partially filled from uri

chrisj

New Member
I have a page which summarises a load of data from the database, and I want to put links on this summary page to link to the "add new entry" form (and also to allow editing as well as adding new). However, I want to pass some of the data from my summary page, and hide it from the user entry... Hiding the data is easy, however is there a simple way to link to a form from another page while passing information. (I'm sure there must be, but I can't find anything on the forum).

Thanks
Chris
 
Append
&your-full-element-name=your-default-value
to your URL.
The element may be hidden but must be editable for the user. If it's not you have to use the default "eval" to get and return the URL param via php code.
 
Great - thanks. I note that this doesn't work with a 'databasejoin' element (I guess I'd need to pass the joined label rather than the reference which is less robust). Given I want to hide this anyway, I can just use a 'field'...

One further question if you don't mind - how do I hide this element from the form, and still have it filled in? If I set the element to unpublished, then it's not filled in when the database is updated and I can't find another way to hide it from the form. I assume your comment about "must be editable by the user" refers to the users access privileges?

Thanks.
Chris
 
You can append _raw to the element name to set the value rather than the label.

&mytable___joinelement_raw=123

You can use a custom CSS to hide elements which don't have a specific 'hide' setting. Inspect your page and find the class for the fabrikElementContainer div, it should be your full element name with fb_el_ prepended. Then just add a custom CSS to your template foler (see wiki for details, tl/dr just copy custom_css_example.php to custom_css.php and edit it) and add ...

.fb_el_yourtable___yourelement {
display: none
}

We'll probably be adding the ability to hide any element type soon, when I get a chance to review and merge this PR:

https://github.com/Fabrik/fabrik/pull/1603

... from @Jaanus

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top