Well I don't know anything about php but lately I've been writing a lot of it. Here is a piece that helped me a lot. I put it at the end of the efg template list_fd_simple_default.xhtml:
Code:
<?php if ($intField == 0): ?>
{{insert_module::47}}
<?php endif; ?>
$intField is a local variable and if it doesn't get incremented from zero then the form had no data to write out. In that case I present a blank form for the user to fill in for the first time.
I have also added code to my efg template info_fd_table_default.xhtml that selects the avatar of the form's owner and displays it when the form is output to the front end. Working with the efg form and lister module was frustrating until I figured out that I had to save changes to my form as well as a save of the metadata of the top of the form. Both saves are necessary to get changes in the form structure to appear on the back end lister module.
I added so much code to info_fd_table_default.xhtml that I called it by a different name that I then chose as the template in the back end module configuration. However, when a front end user who is not logged in views the form, the module uses the original template. When a member is logged in then they get the results of my modified template with the extra code. So when a member who owns a form looks at their own form they see their avatar, but when a guest looks at them they don't get the avatar.
So I went back to the same name as the default for the template. But the public avatar is still not visible because the forms hidden field that contains the owners userid which is used to fetch the correct avatar, is not present in the guest output. So a logged in member who is the owner of a form, receives the hidden field and ses the avatar, but a guest doesn't get the hidden field and the avatar fetch fails. Why is the efg lister module presenting such different behavior to members and guests?
Bookmarks