Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Coffee corner » [Skylark][witz] How would you do this
[Skylark][witz] How would you do this [message #51794] Fri, 31 May 2019 22:49 Go to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
Suppose in a witz

<a href=$Handler(v)>$Title</a>


Will produce in the resulting html document something like this

<a href="/display/1">Some Report</a>


My intended result is something like

<a href="/display/1.pdf#page=3">Some Title</a>


Basically, I need to put some text in the quoted text created by $Handler(v).

In my case $v and $Title are actually key and value of an entry in a ValueMap. I have attempted to make $v = "1.pdf#page=3", but don't know how to prevent it from being HTML escaped.

What's the suggested way of achieving the intended result?

[Updated on: Fri, 31 May 2019 22:50]

Report message to a moderator

Re: [Skylark][witz] How would you do this [message #51799 is a reply to message #51794] Sun, 02 June 2019 14:11 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
I use javascript to resolve the issue. Something like

$for(i in MyMap )
<a href="#" onclick='window.open($MyHandler(i._key)+"#page=3&view=FitH","_blank")'>$i</a><br/>$endfor

Re: [Skylark][witz] How would you do this [message #51800 is a reply to message #51794] Sun, 02 June 2019 17:56 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Lance,

Sorry for late reply... I believe that proper way to solve is to either

1) use raw function from witz standard library in your template

or

2) use Raw() in your code, to let the engine know that your value should not be escaped

I haven't use this in quite a long time, so I'm not exactly sure if it really fits into your scenario. But it should still work in general case.

Best regards,
Honza
Re: [Skylark][witz] How would you do this [message #51804 is a reply to message #51800] Tue, 04 June 2019 15:01 Go to previous message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
Hi Honza,

Thank you for the reply.

I actually tried raw() but cannot achieve what I intended. I tried various ways but could not figure it out.
Previous Topic: Adding Version Information & Icons to app's exe file
Next Topic: Map implementation
Goto Forum:
  


Current Time: Tue Mar 19 07:21:47 CET 2024

Total time taken to generate the page: 0.01374 seconds