html tag calculation

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

html tag calculation

Postby megaquests » Tue Mar 16, 2004 1:14 pm

Hi
Any chance you can help with this one?
Jan recently showed us how to use a calculation to add html tags either side of a shippet of html content stored in a database, so that we can display the html in a servoy client.

But I don't seem to be getting the code right?

return "<html><body>"%htmltext%"</body></html>";

"htmltext" is the name of our column containing the html code with out html tags. Eg: <h1 class="style2">Test content </h1>

The problem seems to be that the "htmltext" does not concatonate..
All that displays in the client is: NaN

I've tried
return "<html><body>"%htmltext%"</body></html>";
return "<html><body>"%%htmltext%%"</body></html>";
And many more variations.. Can you see where we are going wrong?

Many thanks
Eugene
megaquests
 
Posts: 91
Joined: Mon Mar 01, 2004 1:09 pm
Location: Brighton, UK

Postby Harjo » Tue Mar 16, 2004 3:02 pm

try this:

return "<html>" + htmltext + "</html>";

also look in de CRM demo, You see a lot of examples there!
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby IT2Be » Tue Mar 16, 2004 3:05 pm

Eugene, you should set it to:

Code: Select all
return "<html>%%htmltext%%</html>";


your column should hold the tags in the following format:

Code: Select all
"<h1 class='style2'>Test content </h1>"
.

You have to use hanging comma's within the string to get it right.

Remember to tick the displayTags property of the column that shows the html.

[/code]
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

calculation

Postby megaquests » Tue Mar 16, 2004 4:04 pm

many thanks guys

return "<html>" + htmltext + "</html>";
did the trick...

:D

do you know if this method is the best one to use to mail merge into the parth of an image in order to construct a url from different parts of a database?
megaquests
 
Posts: 91
Joined: Mon Mar 01, 2004 1:09 pm
Location: Brighton, UK

Postby IT2Be » Tue Mar 16, 2004 6:01 pm

I don't understand your question completely. What are you trying to archieve...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

concatonate image

Postby megaquests » Tue Mar 16, 2004 6:36 pm

thanks Marcel..
this is more of less what i meant
return "<html><img src='http://www.URL.com/users/"+ id + "/photo1.jpg'</html>";

this seems to work but is probably not the best way to do it..? :roll:
thanks
eugene
megaquests
 
Posts: 91
Joined: Mon Mar 01, 2004 1:09 pm
Location: Brighton, UK

Postby IT2Be » Wed Mar 17, 2004 5:48 pm

Well, it is a very fine way if you want to show that image depending on the content of the current record (or whatever)...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany


Return to Web Development

Who is online

Users browsing this forum: No registered users and 3 guests