在 Seaside 中使用图像作为可点击项目制作超链接

Lon*_*vid 3 html smalltalk seaside

我正在使用 Instantiation VisualAge Smalltalk Seaside 建立一个网站。我知道以下内容。

renderContentOn: html
  html anchor
    url: 'http://www.seaside.st';
    with: 'Visit the Seaside'.
Run Code Online (Sandbox Code Playgroud)

但是,我想创建一个链接,其中图像是可点击的项目和下面的一些描述性文本。我目前正在做的是在 html 中构建它并让 Seaside 呈现代码。我想使用 Seaside 以与上述相同的方式构建项目,但找不到任何提示。我使用的代码是这样的:

html html: '<a
href="http://www.mywebsite.com:8080/Show some details?', imagePath, '"><img
style="border: 0px solid ;  
  text-align: right;height: 130px;" alt=""
src=" http://www.mywebsite.com:8080/images/',  imagePath, '"></a>
<br> some text'
Run Code Online (Sandbox Code Playgroud)

有更好的(和更多的 Smalltalk)方式吗?


“显示一些细节”是我草率的打字。当然,它是一个有效的类名。

但是,我已经尝试过此操作,但遵循“html text: 'Some text'”。它应该只显示文本,它还显示当前页面类 - 所以,如果我的类是 DPAClassName 所以 url: ' http://www.mywebsite.com:8080/Show some details?, imagePath'; 变成

url: ' http://www.mywebsite.com:8080/DPAClassName ?, imagePath';

显示屏显示文本 'Some Text 但如下: 'Some Text'DPAClassName

ema*_*olo 7

最关键的是在with:消息发送到任何标记anchorimageparagraph等),你可以通过任何渲染的对象吧。在您的第一个示例中,您传递了 a String,但您也可以传递 aBlockClosure或任何其他理解renderOn:.

所以,总结一下,相当于你想要的是:

    html anchor
      url: 'http://www.mywebsite.com:8080/Show some details?, imagePath';
      with: [
         html image
           style: 'border: 0; height: 130px;'
           url: 'http://www.mywebsite.com:8080/images/',  imagePath ].
    html break.
    html text: 'Some text'.
Run Code Online (Sandbox Code Playgroud)

作为旁注,我认为Show some detailsURI的部分是有问题的,以及在没有命名参数的情况下传递 imagePath。但这肯定超出了您的问题范围。