Plugin

Archived
Forum
(read-only)

Directory Contents

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From koivi

     

How do I Pass in a template variable?

General

UKFreelancer
UKFreelancer

Hi,

How do I pass in a template variable for the source directory?

e.g.

{exp:channel:entries channel=“clients” disable=“member_data|categories|pagination|trackbacks” sort=“asc” }
{exp:directory_contents:links src=“uploads/clients/{client_templategroup}” images_inline=“yes”}
  {DC_img_url}
{/exp:directory_contents:links}
{/exp:channel:entries}


UKFreelancer.

koivi
# 1
Developer
koivi

I actually do that with one of projects right now:

{exp:channel:entries channel="clients" dynamic="no" entry_id="{embed:entry_id}"}
{exp
:directory_contents:links
 src
="projects/{url_title}"
 
css_id="project-files-list"
 
inline_images="yes"
}
<div><a href="{DC_img_url}" rel="prettyPhoto"><img src="{DC_img_url}" /></a></div>
{/exp:directory_contents:links}
{
/exp:channel:entries} 

I haven’t had any problems with it (that’s right from the template). Have you checked that {client_templategroup} is defined before using it?