Gossamer Forum
Home : Products : Gossamer Forum : Development, Plugins and Globals :

Unloading post_attachments values in a Template

Quote Reply
Unloading post_attachments values in a Template
Hello,

In the subscription to forums I want the daily email to actually contain a link to the attachments (if any) on a post to the forum.

So using the Dump template function I have a very impressive list of available variables.

eg post_loop reports

$VAR = [
{
'forum_id_fk' => '7',
'post_anonymous_email' => undef,
'post_attachments' => [
{
'post_id_fk' => '25',
'postatt_content' => 'image/gif',
'postatt_filename' => 'h_title_logo.gif',
'postatt_filename_escaped' => 'h_title_logo.gif',
'postatt_id' => '14',
'postatt_size' => '1272'
}
],
'post_date' => \'Oct 22, 2003, 11:50 AM',
'post_deleted' => '0',
etc etc.

Now I can unload <%post_date%> etc but for the life of me can't get hold of variables inside post_attachments associative array such as postatt_filename

I've tried <%$post_attachment->{postatt_filename}%> and
<%$post_attachment{postatt_filename}>%

Can someone tell me the correct syntax to unload these variables inside an associate array?

Thanks
Quote Reply
Re: [dougrobb] Unloading post_attachments values in a Template In reply to
A simple example:
Code:
<%loop post_attachment%>
<%postatt_filename%>
<%endloop%>

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Unloading post_attachments values in a Template In reply to
Great thanks I would never have got that!

Last edited by:

dougrobb: Oct 22, 2003, 6:49 AM