Page 1 of 1

[SOLVED] Listit2 Select File problems

Posted: Sat Mar 07, 2015 12:19 pm
by chillifish
I'm trying to link to a file with Listit2. The default template doesn't work, so I've tried doing it as below, however, the file doesn't appear. Can anyone tell me what I'm doing wrong? ???

Code: Select all

<!-- item -->
<div class="item">
	{if !empty($item->fielddefs)}
	<div class="item-properties">
			<span class="name">{$item->title}</span>
			{if !empty($item->qualifications)}
			<span class="qualifications">{$item->qualifications}</span>
			{/if}
			{if !empty($item->job_title)}
			<br />
			<span class="job-title">{$item->job_title}</span>
			{/if}
			{if !empty($item->m)}
			<br />
			<span class="mobile">M: {$item->m}</span>
			{/if}
			{if !empty($item->t)}
			<br />
			<span class="telephone">T: {$item->t}</span>
			{/if}
			{if !empty($item->e)}
			<br />
			<span class="email">E: {$item->e}</span>
			{/if}
			{if !empty($item->resume)}
			<br />
			<a href="{$fielddef->GetImagePath(true)}/{$fielddef.value}"><span class="resume">{$fielddef.value}</span></a>
			{/if}
	</div>
	{/if}
</div>
<!-- item //-->
Edited because I put in the default template by mistake.

Re: Listit2 Select File problems

Posted: Sat Mar 07, 2015 1:54 pm
by chillifish
This is working, but how do I get the path to the file?

Code: Select all

<!-- item -->
<div class="item">
	{if !empty($item->fielddefs)}
	<div class="item-properties">
			<span class="name">{$item->title}</span>
			{if !empty($item->qualifications)}
			<span class="qualifications">{$item->qualifications}</span>
			{/if}
			{if !empty($item->job_title)}
			<br />
			<span class="job-title">{$item->job_title}</span>
			{/if}
			{if !empty($item->m)}
			<br />
			<span class="mobile">M: {$item->m}</span>
			{/if}
			{if !empty($item->t)}
			<br />
			<span class="telephone">T: {$item->t}</span>
			{/if}
			{if !empty($item->e)}
			<br />
			<span class="email">E: {$item->e}</span>
			{/if}
			{if !empty($item->resume)}
			<br />
			<a href=""><span class="resume">{$item->resume}</span></a>
			{/if}
	</div>
	{/if}
</div>
<!-- item //-->

Re: Listit2 Select File problems

Posted: Sat Mar 07, 2015 2:11 pm
by chillifish
Tried the following after reading this, but doesn't work either:

Code: Select all

<a href="{$item->fielddefs.resume.dir}/{$item->resume}"><span class="resume">{$item->resume}</span></a>

Re: Listit2 Select File problems

Posted: Sat Mar 07, 2015 3:39 pm
by chillifish
Found my answer here.

Code: Select all

<a href="{uploads_url}/{$item->fielddefs.resume->GetOptionValue('dir')}/{$item->resume}"><span class="resume">{$item->resume}</span></a>