[pmwiki-users] thoughts on PTVs, (:include:) and editing forms
Patrick R. Michaud
pmichaud at pobox.com
Tue Nov 13 08:39:38 CST 2007
On Tue, Nov 13, 2007 at 02:14:59PM +0000, Hans wrote:
> I am working on making Fox capable of editing sections or parts of
> a page, so for instance an edit link in a messag epost will open an
> edit form with the message content for editing, and saving it will
> replace the content with the new one.
>
> I discovered that I need a very different approach to handle the
> editing of content within a PTV, than content within a section marked
> with anchors. And I like to see a way to combine these two.
>
> AFAIK we can include page sections using (:include PageName#section:),
> and a multiline PTV with {PageName$:ptv}
>
> But to grab such a page part to put into a textarea field needs two
> different ways (and (:input textarea:) cannot handle multi-line input at
> present, so I am using (:textarea).....(:textareaend:) markup)
Actually, (:input textarea:) *can* handle multiline input, at
least from page text variables.
For example, to load the contents of $:XYZ from a page into a
textarea, one can use:
(:input defaults source=Group.Page:)
(:input textarea name=$:XYZ :)
The (:input defaults source=...:) line grabs all of the PTVs
from Group.Page and uses them as the default values for any
input controls of the same name.
> [...] Can I treat anchor links as PTVs, can I
> define a PTV pattern which would use content from one anchor up to the
> next?
Hmm, a very interesting idea! If I understand correctly, you're
suggesting that we use [[#anchor]] as defining a multiline page
text variable that extends to the next anchor. Then one could
use {PageName$:anchor} to retrieve the text of the [[#anchor]]
section of PageName.
And in a form, we would then be able to do
(:input defaults source=Group.Page:)
(:input textarea name=$:anchor :)
to be able to pre-fill a textarea with the contents of the [[#anchor]]
section of Group.Page.
It sounds like it might work... but I'll have to think about it
a bit to see what we might be overlooking. It could have some
negative impacts on the backend, where we wouldn't have any clear
indication that $:anchor was intended to be delimited with [[#anchor]]
and not (:anchor: ... :).
Pm
More information about the pmwiki-users
mailing list