commands and value links

Norbert Hartl norbert at hartl.name
Fri Oct 8 12:58:35 MEST 2010


On 08.10.2010, at 11:38, Lukas Renggli wrote:

> And in fact you don't need to use a value link for triggering a
> command, a normal link with the command parameter is enough:
> 
>   */some/page/to/edit|command=Edit*
> 
> Note that in both cases this goes through the security system.
> 
Ok, everytime I think I have a useful idea it is already there and better implemented :) It is nice that I can do it either one or the other way. But the link text is always the title of the target structure. I need the link label to be displayed. In the second approach can do it manually with *Label>/some...* (does not work with the first approach *Label>value:...*. Is there a way to display the link label? 

thanks,

norbert


> 
> On 8 October 2010 11:36, Lukas Renggli <renggli at gmail.com> wrote:
>> Actually this is already implemented, for example:
>> 
>>     *value:structure|link|command=Remove*
>> 
>> Also works with all other value-links that list or return structures,
>> e.g. children, references, parent, previous, random, siblings, find,
>> ...
>> 
>> Lukas
>> 
>> On 8 October 2010 11:27, Norbert Hartl <norbert at hartl.name> wrote:
>>> I'm trying to create a value link that can display a single command inside a document. But I struggled to create a proper link for the command. This seems only possible if you have a pier context and renderer at the same time which is not really the case as long as you are staying inside PRValueLink.
>>> 
>>> The only solution I could come up with is the following:
>>> 
>>> PRValueLink>>commandIn: aContext
>>>        <value: 'command' comment: 'Display command as link'>
>>>        (PRCommand withAllConcreteClasses
>>>                detect: [ :each | each label = (self parameterAt: 'label' ) ]
>>>                ifNone: [ ^ nil ])
>>>                        ifNotNilDo: [ :commandClass |
>>>                                ^ [ :html |
>>>                                        html anchor
>>>                                                goto: (aContext command: commandClass new);
>>>                                                with: commandClass label]].
>>>        ^ nil
>>> 
>>> I have the impression there might be a solution without using a block. Any ideas? Or is it ok the way it is?
>>> 
>>> thanks,
>>> 
>>> Norbert
>>> 
>>> 
>>> _______________________________________________
>>> Magritte, Pier and Related Tools ...
>>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>>> 
>> 
>> 
>> 
>> --
>> Lukas Renggli
>> www.lukas-renggli.ch
>> 
> 
> 
> 
> -- 
> Lukas Renggli
> www.lukas-renggli.ch
> 
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.iam.unibe.ch/pipermail/smallwiki/attachments/20101008/fc8d240f/attachment.html>


More information about the smallwiki mailing list