EllisLab text mark
Advanced Search
     
Show link based on content being present
Posted: 21 February 2012 01:42 PM   [ Ignore ]
Joined: 2009-01-08
57 posts

I am trying to set up the media center on our churches website to display 2 links based on content being present

here is the code currently

<div class="homeDiscoverCol2">
<
div id="descrColumn"><div class="headDate"><?=strftime('%A, %B %e',$currentVidDate);?></div>
<
h1><?=ucwords($currentVidTitle);?></h1>
<
h2><?=ucwords($currentVidSpeaker);?></h2>
<
div class="headDescr"><?=$currentVidDescription;?></div>
<
div class="headDescr">{if field_id_124 != ''}<a href="http://www.phoenixfirst.org/images/uploads/handouts/['field_id_124']"><strong>DOWNLOAD NOTES →</strong></a>{/if} • {if field_id_126 != ''}<a href="http://www.phoenixfirst.org/images/uploads/handouts/['field_id_126']"><strong>DOWNLOAD AUDIO →</strong></a>{/if}</div

This code appears here http://www.phoenixfirst.org/media/video-new/faithworks-part-4
next to the player.

I currently have files loaded in Field 124 & 126 but the links are not showing up.

Any help would be greatly appreciated.

Thanks!

 
Posted: 22 February 2012 04:34 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2011-11-25
7174 posts

Hello Phoenix First,

I appreciate your posting your question on the forums.

I am going to move this over to the Development and Programming forum where the community can offer you some help.

Cheers,

 Signature 

Recent version: EE 2.5.4 | Forum Module 3.1.10 | MSM 2.1.4 | 2.x Bug Tracker | Version Upgrade

 
Posted: 23 February 2012 07:29 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2006-04-15
12649 posts

Not too sure why this is being moved over to Development & Programming as it sounds like you just want to show a link based on whether a field has content or not?

If that’s correct then you should just be able to do like you have above except provide the correct name for the field, so :

{if name_of_my_field_here != ""}<a href="http://www.phoenixfirst.org/images/uploads/handouts/{name_of_my_field_here}">Download Notes</a

You don’t ever use the field_id_124 syntax inside a Channel Entries tag to retrieve the information but the actual field name that you set when you created the field.

Is that what you’re looking for here at all?

Apologies if not and I’ve misread the post above.

Best wishes,

Mark

 

 Signature 

Shopping Cart Plugin | Full List Of Add-Ons | About Me
——————————————————————————————
2.x Bug Tracker | Upgrade Errors

 
Posted: 24 February 2012 12:50 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Joined: 2009-01-08
57 posts

Those are fields where files are uploaded so that people can download notes or audio to go with the video they are viewing.

So what it needs to do is show a link to download that file if it’s present.