External link

3 posts by 2 authors in: Forums > CMS Builder
Last Post: July 17, 2012   (RSS)

By Jesus - July 16, 2012

Hello... another question here.

In AM2, I sued to have external field for notices on another site and I used like this:

<td valign="top" width="50%">
<!-- templateIf : $article.externalLink$ eq "" -->
<a href="$published.articlePage.url$" title="$article.title$"><h3>$article.title$</h3></a>
<a href="$published.articlePage.url$" title="$article.PromoTitle$">$article.PromoTitle$</a>
<span id="sumario">$article.summary$ <a href="$published.articlePage.url$" style="color:#04B431;" title="Presione aqui para ingresar ">Presione aqui para ingresar</a></span>
<!-- /templateIf -->
<!-- templateIf : $article.externalLink$ ne "" -->
<a href="$article.externalLink$" title="$article.title$"><h3>$article.title$</h3></a>
<a href="$article.externalLink$" title="$article.PromoTitle$">$article.PromoTitle$</a>
<span id="sumario">$article.summary$ <a href="$article.externalLink$" style="color:#04B431;" title="Presione aqui para ingresar ">Presione aqui para ingresar</a></span>
<!-- /templateIf -->


How can I implement this on CMS Builder?

I think I can insert a text field on the table but, how can I create the IF statement on my code in order to show external link or article link.

Thanks!

Jesus

Re: [Jesus] External link

By Jason - July 16, 2012

Hi Jesus,

What you can do is have a field in your article section called "external_link". You can then check to see if there is a value or not like this:

<?php if ($record['external_link']): ?>
<a href = "<?php echo $record['external_link'];?>">
<?php else: ?>
<a href = "<?php echo $record['_link'];?>">
<?php endif ?>

<?php echo $record['title'];?></a>


Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/