FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Print photos
#1
I need to print uploaded photos.
When i open submission to print, now we saw only uploaded photos names. It is possible to change smarty printing template to print out photos with other submissons data?
Reply
#2
Hi Valch,

Sorry for the wait.

Yes, it is possible - but it'll require a bit of programming. You'll need to output that URL within an <img src="..." /> tag, instead of just outputting the single value. I don't suppose you have a programming stashed away in a closet somewhere that you'd have access to...? Wink

- Ben

Reply
#3
(Sep 19th, 2011, 12:42 PM)Ben Wrote: Hi Valch,

Sorry for the wait.

Yes, it is possible - but it'll require a bit of programming. You'll need to output that URL within an <img src="..." /> tag, instead of just outputting the single value. I don't suppose you have a programming stashed away in a closet somewhere that you'd have access to...? Wink

- Ben

Thanks for replay, may be you can help with this code programming. It's be a helpfully resource for others. On forum I saw that many peoples asking this question, but no ideas, concreate answer... how...

Create new export type, but how look smarty template for printing images.It's a question...
Reply
#4
BEN please help with smarty template code...
Reply
#5
Hi Valch,

Sorry for the wait!

To output an image as an actual image instead of just the URL/filename, you'll need something like this. I made it as simple as possible. This is based on the "table format" HTML/Printer-friendly Export Type.

Code:
<h1>{$form_name} - {$view_name}</h1>

<table cellpadding="2" cellspacing="0" width="100%" class="print_table">
<tr>
  {foreach from=$display_fields item=column}
    <th>{$column.field_title}</th>
  {/foreach}
</tr>
{strip}
{foreach from=$submissions item=submission}
  {assign var=submission_id value=$submission.submission_id}
  <tr>
    {foreach from=$display_fields item=field_info}
      {assign var=col_name value=$field_info.col_name}
      {assign var=value value=$submission.$col_name}
      <td>
        {if $field_info.field_name == "field2"}
          <img src="http://www.yoursite.com/folder/{$value}" />
        {else}
          {smart_display_field form_id=$form_id view_id=$view_id
            submission_id=$submission_id field_info=$field_info
            field_types=$field_types settings=$settings value=$value}
        {/if}
      </td>
    {/foreach}
  </tr>
{/foreach}
{/strip}
</table>

The important bit is this:
Code:
{if $field_info.field_name == "field2"}
          <img src="http://www.yoursite.com/folder/{$value}" />
        {else}
          {smart_display_field form_id=$form_id view_id=$view_id
            submission_id=$submission_id field_info=$field_info
            field_types=$field_types settings=$settings value=$value}
        {/if}

That looks at the current field name. If it's "field2" (which here, contains the image field - you will need to change that to whatever field name your image field(s) have).

You'll also need to update the URL to the file as well.

Hope this helps -

Ben
Reply
#6
Thanks Ben, it's work. Only small thing - i have a 4 photo fields. Near the photos we see also photo names fotoname.jpg., only near the last photo image name are not showing. I think that is small correction, but i don't know how. For better understand I add a photo .

And second thing - how can we change the pront friendly code for printing only concrete,fixed colums with data. On one export type i want this option. (i have a database with 25 colums, but for printing wont to 1, 2, 4, 5 column).

A big thanks


Attached Files Thumbnail(s)
   
Reply
#7
Hi Valch,

Quote:Only small thing - i have a 4 photo fields. Near the photos we see also photo names fotoname.jpg., only near the last photo image name are not showing. I think that is small correction, but i don't know how. For better understand I add a photo.

To display the photo name as well as the image, you just need to add a {$value} after the <img /> tag. I don't quite follow though, you've done that, but it doesn't display for the final image?

Quote:And second thing - how can we change the pront friendly code for printing only concrete,fixed colums with data. On one export type i want this option. (i have a database with 25 colums, but for printing wont to 1, 2, 4, 5 column).

Good question! The Export Manager is designed to work dynamically: it always exports whatever content is found in the form View that you're currently using. You actually can't tell it to always export the same group of fields for every View.

The only way around this that I can think of is to create a totally new Export Group, then add your Export Type to that. Lastly, change the permissions on the Export Group so that it only shows for the View(s) that you want.

Sorry I couldn't be more help!

- Ben

Reply
#8
(Oct 2nd, 2011, 10:51 AM)Ben Wrote: Hi Valch,

Quote:Only small thing - i have a 4 photo fields. Near the photos we see also photo names fotoname.jpg., only near the last photo image name are not showing. I think that is small correction, but i don't know how. For better understand I add a photo.

To display the photo name as well as the image, you just need to add a {$value} after the <img /> tag. I don't quite follow though, you've done that, but it doesn't display for the final image?

Quote:And second thing - how can we change the pront friendly code for printing only concrete,fixed colums with data. On one export type i want this option. (i have a database with 25 colums, but for printing wont to 1, 2, 4, 5 column).

Good question! The Export Manager is designed to work dynamically: it always exports whatever content is found in the form View that you're currently using. You actually can't tell it to always export the same group of fields for every View.

The only way around this that I can think of is to create a totally new Export Group, then add your Export Type to that. Lastly, change the permissions on the Export Group so that it only shows for the View(s) that you want.

Sorry I couldn't be more help!

- Ben

On first question i think we don't understand each other. I would like to that the field names (photonames foto.jpg) are not showing like on last photo field. On the first till third field - field names are showing How i can remove this one.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)