Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Article Manager 1:
Using conditional statements

 

 


solitary
New User

Sep 30, 2002, 10:37 AM

Post #1 of 2 (1911 views)
Shortcut
Using conditional statements Can't Post

Is there anyway to use conditionals, such as IF, and ELSE with AM templates?

I want to remove extra breaks under headlines if $art_summary$ is empty. I've thought of a way to do this with JS, however, I wonder if there may be a simpler way to do it.


Damon
Staff / Moderator


Oct 1, 2002, 12:54 PM

Post #2 of 2 (1889 views)
Shortcut
Re: [solitary] Using conditional statements [In reply to] Can't Post

Hi,

No simply way (that I'm aware of) to remove the extra line breaks under the headlines if $art_summary$ field is left empty but here is a JavaScript solution. You mentioned that you had thought of a way to do this with JavaScript so I'm including the code below for anyone else that is interested in removing the extra line space.

1. Make a backup of your /templates/index/default.html template file

2. To remove the empty lines if the summary field is left empty, replace all the following lines:

<font class="arttext">$art_summary$</font><br>

with

<font class="arttext">$art_summary$</font>
<script>
if ('$art_summary$' != '') {
document.write('<br>');
}
</script>
<noscript>
<br>
</noscript>

One thing to note that if the visitor doesn't have JavaScript enabled in their browser, they will see the extra line break.

--------------------------------------------------- 
Cheers
Damon Edis
interactivetools.com

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