Minute HTML control in iRev

Sivakatirswami katir at hindu.org
Tue Nov 3 23:46:57 EST 2009


Sarah Reichelt wrote:
>> but what would be "neat" easier and clearer would be (this is a fantasy
>> chunk.. but gives you the idea...)
>>
>>
> 
> 
> Nothing "fantasy" about this. I do it all the time and I reckon it is
> a lot easier than trying to quote the html so it can go into a put
> statement. So:
> 
> <?rev if x = 3 then ?>
>     <h1>x = 3</h1>
> <?rev else ?>
>     <h2>x <> 3</h2>
> <?rev end if ?>
> 
> is perfectly valid iRev code.
> It can get a bit messy, but format as neatly as you can, indent and
> add blank lines so that it stays readable.
> 
> Cheers,
> Sarah


Confirmed, it works... simply marvelous!

<body style="background-image: 
url(/resources/lexicon/images/backgrounds/<?rev put tBackground ?>); 
background-repeat: repeat;">

<?rev if len(tDefinition) > 350 then ?>
	<div style="margin: 15px;padding:2px 15px 2px 15px;">
	<img 
src="http://www.himalayanacademy.com/resources/lexicon/images/backgrounds/EyeGlass.jpg" 
style="float:left; margin-right:12px;" />

<?rev else ?>
       <div style="margin: 15px;background-color: #FFFFFF;padding:2px 
15px 2px 15px;opacity: 0.90">

<?rev end if ?>

<h1 style="margin-top:0;text-shadow: +10% +10% 10% 
rgb(153,153,153);"><?rev put tWord ?>:</h1>
<p style:"font-size: 115%;"> <?rev put tDefinition ?> </p>
</div>
<div style="float:right;margin-right:15px; background-color: 
#FFFFFF;padding:2px 4px;opacity: 0.70;"><p style=" 
text-size:50%;margin:0;"><a href="/resources/lexicon/RandomWord.irev" 
target="word-to-ponder">One More</a></p></div>

</body>



More information about the use-livecode mailing list