I don't know why, but this problem is becoming a bit of a headache!  The
more I thought about it, the more complex it got.

Code wise, it worked easily in passdata, and even more easily in
savedata--because it uses the same kind of processing flow. But never felt
right semantically.

Using the indexing system functions didn't work well because they didn't
really have the right hooks and would require a rewrite of the whole thing.

So I thought about adding it to info as an extra command option. Doing it
in that way involved essentially writing everything from scratch and quite
a bit of code. Plus it seemed odd to have the info command work differently
than the info function (where stash doesn't make sense). Plus I didn't have
any ready tools like the log flags, which gave me some functionality I
wanted for my commenting system.

Then I went back to your first suggestion: log. A good option for me after
doing some tinkering. Basically, I added an option for negative trims, ie:
flags="trim=-5" which trims out all but the last 5 values. This worked
elegantly for my commenting system which only keeps recent comments, But
then I realized I couldn't go back and overwrite an existing entry which I
need for other things.

Which left me about ready to pull my hair out!!!

In the end, I decided I wasn't sure why I even needed it... Could just use
existing features depending on how I wanted to do the stash. ie:

[command log value='{id}: {=field1} | {=field2}' page=whatever
flags=whatever]  (great for commenting system)
or
[command info field={id} value='{=field1} | {=field2}' page=whatever]
 (great for stashin, or updating info)
or even
[command index my.page]  (use this, or as a function, with a data indexing
rule, or let auto indexing take care of things).

So in the end, I think that's what I'm going to do.  Nothing!  (except
enhance the log function with negative trims, and allow it to hide line
breaks with lines=false)

Cheers,
Dan

P.S. I did have some problem with the log function--largely because it is
designed to do too many things, but that's another issue...

P.P.S. I got a commenting system to work just this easy:

forum.footer
[if exists comments.{p}][(search query=comments.{p} template=comment
sort=false)]
[form]
Add comment:
[box content rows={+rows} cols={+cols}][box]
[submit COMMENT]
[command authkey comment]
[command log page=comments.{p} value='{now}: {id} | {=content}' lines=false]
[form]

template.comment
<box>
**//Posted by [[~{+#1}]] on <(time {+field})>
{+#2}
</box>






On Tue, Feb 18, 2014 at 2:11 AM, mz <[email protected]> wrote:

> This seems to be a good solution.
> Now we have these categories to write something on a page:
> - create and log for unstructured data
> - savedata, info, index for structured data.
>
> I suppose I would be able to choose different page names besides of index?
>
> Greetings, Martin
>
> Am Sonntag, 16. Februar 2014 19:56:24 UTC+1 schrieb Dan:
>>
>> All right. I wrested with this quite awhile--esp since I had already
>> changed the code on my server, but realized you were right. :)
>>
>> After much thinking it occurred to me we could / should use the index
>> command/function
>>
>> We already have:
>> <(index list=members)>  // processes pages on site.index.list, using
>> members index rule
>> <(index member.1,member.2)>  // processes these to pages using any
>> appropriate index rule
>>
>> No we could just add
>> <(index member.1,member.2 mode=data 
>> legend=title,email,phone,address,city,state,zip
>> index=index.members)>
>>
>> This is essentially the same as stash but gives us the advantage of being
>> able to fully tap into any indexing mode.
>>
>> What do you think?
>>
>> Cheers,
>> Dan
>>
>>
>>
>> On Mon, Feb 10, 2014 at 12:37 PM, mz <[email protected]> wrote:
>>
>>> A semantic purist would say: If it's got nothing to do with data fields,
>>> keep away from savedata.
>>> What do you think about log? Log flags could be useful here, too.
>>>
>>> Greetings, Martin
>>>
>>> Am Montag, 10. Februar 2014 02:54:01 UTC+1 schrieb Dan:
>>>
>>>> Hey, just thought I'd ask for some feedback on the stash feature.
>>>>
>>>> Right now you can do
>>>>
>>>> [command passdata field1,field2 mode=stash field={p}]
>>>>
>>>> And it creates an info line like that can be used for all kinds of info
>>>> processing:
>>>>
>>>> some.page: field1 | field2
>>>>
>>>> However, after much reflection it doesn't make sense to keep it in the
>>>> passdata command--as it's not really passing data to the the next page
>>>> (like mode=cookie, mode=post or default mode=get). Rather, it is saving
>>>> data. So I'm inclined to change the savedata command to allow for this
>>>> instead
>>>>
>>>> [command savedata field1,field2 stash=some.index field={p}]
>>>>
>>>> Really seems to fit better. It wouldn't affect the normal use of
>>>> savedata which looks like this:
>>>>
>>>>  [command savedata field1,field2 page=some.page)]
>>>>
>>>> Anyway, just thinking out loud. :)  This features still pretty new.
>>>> Hope no one has gotten too invested in the current syntax.
>>>>
>>>>  Cheers,
>>>> Dan
>>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "BoltWire" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>>
>>> Visit this group at http://groups.google.com/group/boltwire.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "BoltWire" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/boltwire.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"BoltWire" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/boltwire.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to