From Account@zae.uni-wuerzburg.de Thu Jun 21 12:08:15 2012 From: Account To: xwiki-users@xwiki.org Subject: [xwiki-users] Link in a Livetable (build with AppWithinMinutes) Date: Thu, 21 Jun 2012 14:05:07 +0200 Message-ID: <4FE32A130200009000002AAF@zaes01.zae.uni-wuerzburg.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4053147413116820628==" --===============4053147413116820628== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi, i want to use the AppWithinMinutes-App to build a database of chemicals which= we have in our labs. As one column i want to have a link to the wikipedia pa= ge of that chemical and i want the link to be displayed and clickable in the = table, not only on the page of each entry. To do so i added a Short Text - field for this, but when i add an entry, it's= only a link when i type it in the form [[http://de.wikipedia.org/wiki/Zinkfl= uorid]] and this only on the entry page. In the table it's a trimmed version = (for example "org/wiki/Zinkfluorid") and it's no link. But when i type in [[L= ink>>http://de.wikipedia.org/wiki/Zinkfluorid]] it doesn't work, it's no link= anymore and the code is not interpreted. How can i solve this problem? Thanks, zae. --===============4053147413116820628==-- From mariusdumitru.florea@xwiki.com Thu Jun 21 14:30:01 2012 From: Marius Dumitru Florea To: xwiki-users@xwiki.org Subject: Re: [xwiki-users] Link in a Livetable (build with AppWithinMinutes) Date: Thu, 21 Jun 2012 17:27:14 +0300 Message-ID: In-Reply-To: <4FE32A130200009000002AAF@zaes01.zae.uni-wuerzburg.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7301058137450042974==" --===============7301058137450042974== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Currently the easiest solution is to use a Large String property type because its content is rendered and so the URL will be transformed in a link. If you want to keep the Short Text property, you can do like this: (1) Edit the application home page in wiki edit mode and make this changes: - 'shortText1': {'type': 'text', 'size': 10, 'filterable': true, 'sortable': true, 'html': false}, + 'shortText1': {'type': 'text', 'size': 10, 'filterable': true, 'sortable': true, 'html': true}, (where 'shortText1' is the ID/name of your property holding the URL) - 'resultPage' : 'AppWithinMinutes.LiveTableGenerator', + 'resultPage' : 'MyCustomLiveTableResults', (2) Create MyCustomLiveTableResults page in the application space with this wiki content: ----------8<---------- {{include document=3D"XWiki.LiveTableResultsMacros" /}} {{velocity}} #if($xcontext.action =3D=3D 'get' && "$!{request.outputSyntax}" =3D=3D 'plain= ') $response.setContentType('application/json') #set($map =3D {}) #gridresult_buildJSON("$!request.classname" $request.collist.split(',') $ma= p) ## Transform the URL property in a link. #foreach($row in $map.get('rows')) #set($url =3D $escapetool.xml($row.get('shortText1_value'))) #set($discard =3D $row.put('shortText1', "$url")) #end #set($json =3D $jsontool.serialize($map)) ## We have to escape the translation key because it appears as JSON value in the output. #set($escapedEmptyValueTranslationKey =3D $escapetool.javascript("${request.transprefix}emptyvalue")) $json.replace($escapedEmptyValueTranslationKey, '-') #end {{/velocity}} ---------->8---------- See http://extensions.xwiki.org/xwiki/bin/view/Extension/Livetable+Macro for more details. Hope this helps, Marius On Thu, Jun 21, 2012 at 3:05 PM, Account wro= te: > Hi, > i want to use the AppWithinMinutes-App to build a database of chemicals whi= ch we have in our labs. As one column i want to have a link to the wikipedia = page of that chemical and i want the link to be displayed and clickable in th= e table, not only on the page of each entry. > To do so i added a Short Text - field for this, but when i add an entry, it= 's only a link when i type it in the form [[http://de.wikipedia.org/wiki/Zink= fluorid]] and this only on the entry page. In the table it's a trimmed versio= n (for example "org/wiki/Zinkfluorid") and it's no link. But when i type in [= [Link>>http://de.wikipedia.org/wiki/Zinkfluorid]] it doesn't work, it's no li= nk anymore and the code is not interpreted. > How can i solve this problem? > Thanks, > zae. > > _______________________________________________ > users mailing list > users(a)xwiki.org > http://lists.xwiki.org/mailman/listinfo/users --===============7301058137450042974==--