[solved] Form Brower Full View Template help

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
sagedel
Forum Members
Forum Members
Posts: 20
Joined: Fri Aug 24, 2007 3:50 pm

[solved] Form Brower Full View Template help

Post by sagedel »

I would like to create a very customized template for form browser's full view, but I can't figure out how.

I would compare what I want to do with the templates in form builder with the field tags that are given. In form builder, I basically used an html template and stuck the little smarty tags that were provided in for each field where I needed them to go.

Is there a way to do this in form browser as well? I tried copying and pasting my code from the form builder template into the form browser full view template, but that solution would have been too easy, the field tags don't work and nothing is displayed.

Any help would be most appreciated.
Last edited by sagedel on Tue Oct 21, 2008 3:19 pm, edited 1 time in total.
sagedel
Forum Members
Forum Members
Posts: 20
Joined: Fri Aug 24, 2007 3:50 pm

Re: Form Brower Full View Template help

Post by sagedel »

No one has any ideas on this one? I'm surprised that there wouldn't be an easy solution for this.
sagedel
Forum Members
Forum Members
Posts: 20
Joined: Fri Aug 24, 2007 3:50 pm

[SOLVED] Re: Form Brower Full View Template help

Post by sagedel »

Well... after much poking around and educating myself, I got this to work. I'm hoping this will help someone else who gets the jist of it but just can't get over that last hump to figure it out.

I am a total smarty noob and not that great at PHP so this was a bit of a challenge. I did figure out though that you can display one field in a template (instead of looping through them all) with a couple of modifications to the smarty {section} tag.

My form had a field called "employee name" and it was the first field in the sort order, so I stuck this in my template:

{section name=foo start=1 loop=$count max=1}
{$resp->values[$smarty.section.foo.index]|escape}
{/section}

the start= part tells the loop which field to start on. The number corresponds with the sort order number you set in the form browser tab. So if you wanted to display your field that is #7 in the sort order you would put start=7.

the max= part tells it to loop once (i.e. just show the one field entry). if you set it to a different number, it will start with the number you select for start= and the show the next however many fields you choose.

So, to put each field into an html template you would just paste the above code into each slot that a field is supposed to go, and then modify it according to that field's sort order.
Post Reply

Return to “Modules/Add-Ons”