I'm trying to add a new field named "AlternateLink" to our news page types.
Currently the "Read More" button goes to the full article page with the following:@a href="@%# GetDocumentUrl() %@" class="button pull-right"@Read More@/a@
I've updated it to:@a href="@%# IfEmpty(Eval("AlternateLink",true), GetDocumentUrl(), Eval("AlternateLink",true)) %@" class="button pull-right"@Read More@/a@
but even with a link in the Alternate Link field (see attached image), it always links to the full article page instead of the alternate link.I tried the same IfEmpty statement with other existing field names such as "NewsTitle" or "NewsImage" and those seem to work so the issue seems to be "AlternateLink" field name.I created a field with the ID of "AlternateLink" as a text box. Am I missing another step to make it capture the value?EDIT: AlternateLink is the only new thing I'm adding. All of the existing values (NewsTeaser, NewsTitle, NewsSummary, etc.) all work. Full code: @div class="blog-post col-md-12 clearfix"@
@cms:Media ID="mTeaser" runat="server" Url='@%# Eval("NewsTeaser") %@' Class="img-responsive" /@
@h2 class="blog-title"@@%# Eval("NewsTitle",true) %@@/h2@
@div class="post-info"@
@i class="fa fa-clock-o"@@/i@@%# GetDateTime("NewsReleaseDate", "MMMM dd, yyyy") %@
@/div@
@p@@%# Eval("NewsSummary") %@@/p@
@a href="@%# IfEmpty(Eval("AlternateLink",true), GetDocumentUrl(), Eval("AlternateLink",true)) %@" class="button pull-right"@Read More@/a@
@span class="hr col-md-12 col-sm-12 col-xs-12"@@/span@
@/div@
↧