 | |  |
 |

wendy
User
Nov 12, 2008, 2:16 PM
Post #1 of 3
(382 views)
Shortcut
|
|
Link article title to article attachment
|
Can't Post
|
|
Hi - I'm trying to link an article title directly to an uploaded file, if there is an uploaded file, or to an external link, if there is an external link. The external link part is working but the file attachment part is not. I'm using the following code: <!-- template insert : $articleList$ --> <!-- templatecell : articleRow --> <!-- templateIf : $article.externalLink$ eq "" --> <a href="$published.articlePage.url$"> <!-- /templateIf --> <!-- templateIf : $article.externalLink$ ne "" --> <a href="$article.externalLink$"> <!-- /templateIf --> $article.title$ </a> <!-- /templatecell : articleRow --> <!-- templatecell : article.attachments.row --> <!-- templateIf : $article.attachments$ ne "" --> <a href="$file.weburl$">$article.title$</a>] <!-- /templateIf --> <!-- templateIf : $article.attachments$ eq "" --> <a href="$published.articlePage.url$"> <!-- /templateIf --> <!-- /templatecell : article.attachments.row --> Thanks for your help, as always.
|
|
|  |
 |

Donna
Staff
/ Moderator

Nov 12, 2008, 4:04 PM
Post #2 of 3
(381 views)
Shortcut
|
|
Re: [wendy] Link article title to article attachment
[In reply to]
|
Can't Post
|
|
Hi Wendy, What you've basically got right now is... "If there's externalLink is empty, print the published page URL. If the externalLink isn't empty, print the external link." There's no mention of the attachment within the article row at all. So, you need to add a templateIf that says "If there's an attachment, publish this instead." The tricky part is that you've now got three different "conditions", so one thing you might want to do instead is setup a "What kind of field this is" dropdown. Then, setup the logic so that it says, "If the field type is Attachment, use this code. If the field type is an external link, use this code. Or if the field type is a regular article, use this code." Does that make sense? Let me know if that works for you. :) Donna
Hire me! Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.
|
|
|  |
 |

wendy
User
Nov 12, 2008, 4:58 PM
Post #3 of 3
(380 views)
Shortcut
|
|
Re: [Donna] Link article title to article attachment
[In reply to]
|
Can't Post
|
|
Thanks Donna. Where would I set up that drop down field? In the Admin? What code would I put in the template? W
|
|
|  |
|