Seaside: paragraphs and anchors

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

Seaside: paragraphs and anchors

Postby TriSebastian » Wed Dec 15, 2010 3:22 pm

Hi All,

I have a general Seaside question and hope somebody of you might already have found a solution on this.

I have a site with static text (paragraphs) in it. Some sinble words in the text are ment to be links (anchors).
Codeing doing this might look like:

html paragraph:[
html text:'bala bla bla bla'.
html anchor url: 'someUrl'; with: 'blub.'
html text:'bala bla bla bla'.
].

Now the question ;-)
What if I now want to get all my static strings into/from a DB?

Is there a way to have the following or similar codeing instead?

html paragraph: myDBText.

-> Links should become automatically extracted and shown as linked text.
Therefore no need to know about the structure of the DB-Text? And no need to implement html text:/anchor: combinations suitable to every single text on my page....

I expect the answer is rather simple, isn't it?

Thanks
Sebastian
TriSebastian
 
Posts: 76
Joined: Sun Jul 20, 2008 9:40 pm
Location: Nanaimo, BC, Canada

Re: Seaside: paragraphs and anchors

Postby jtuchel » Thu Dec 16, 2010 12:32 am

Hi Sebastian,

funny you mention this. I was just playing around with ideas of "storing" html pages for use in seaside. My first idea was to save some kind of meta-format (like wiki-syntax) and then convert this to components during the render phase.

But the more I think about it, the real way of storing html fragments is to store them as a tree of objects, just like the resulting DOM. The reason I a think so is that as soon as you need a little more than just rendering a few tags, you end up building up soething that resembles the DOM anyways. As soon as AJAX/Javascript comes into play, you really need DOM elements that you can get a hold of.

So from what I've learned so far, you should not go for a new pseudos-syntax, but for a real object structure, like objects that store a url (or a selector for callbacks) and text to display. These know how to render themselves - and if you choose a clever design, this is also open for extensions like tooltip text, Javascript and the like.

Doing TSTCPW in this case is not a good idea.

Just my 2cts.
jtuchel
[|]
 
Posts: 245
Joined: Fri Oct 05, 2007 1:05 am
Location: Ludwigsburg, Germany


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron