[pmwiki-users] giving a new page an automatic prefix/suffix

Sivakatirswami katir at hindu.org
Wed Jan 24 19:18:52 CST 2007


Kathryn Andersen wrote:
> Hello again, folks!
> 
> I have NewPageBoxPlus set up for my users, and they like it, but there's
> one thing that it won't do -- and I'm not sure if anything else will do
> it either.

> What is needed is to have a way of having a user give a new page name,
> to create a new page, but instead of creating the page that they give,
> the page name has a prefix (or a suffix).  For example, if the prefix
> was "Foo", then a new page which they entered as "NewPage" wouldn't be
> called "NewPage", it would be called "FooNewPage".
> 
> This would be really useful, as one could set up a framework where users
> could create new pages which were a meaningful subset of pages in that
> group, and they could be listed with a pagelist automatically.
> 
> And no, making a new group called "Foo" is not a helpful solution.
> 
> Kathryn Andersen

First one wants to know:

Where and and how does the page subset prefix string
"Foo" get generated?

Is it
a) a separate user entry?
b) some invisible  default based on the $Author?
c) Pre established list of prefixes selectable from a option menu?
d) Admin creates the first $Group.FooHomePage as a set up  task
for each new subset?

or what? and (side issue) I'm interested in how you are constraining
page names.
(if you are...) I have users linking strings like
[[Notes on how to groom care for and feed your Poodle before the DogShow]]

and end up with

PetCare.NotesOnHowToGroomCareForAndFeedYourPoodleBeforeTheDogShow

which is causing some grief as we now get 350 pixel
wide option select boxes on in pagelist pull down menus
which expand to accomodate the longest page name
(is there a way to prevent that? but still show the full length
name on mouse down?)

ooops, that's a separate issue.. back to prefixes, page subsets:

Hmm, this is very close  to "home" with what I'm also working with.
It basically is akin to the path I've taken  to generate
a hierarchical groups with what I am calling "stem"
(you are calling it prefix)

(see other thread:
Hierarchical Pages Revisited [Was: Navigation to "Sub-Groups"]

"Hierarchical Groups Revisited

MailList-Maintenance.somepage
MailList-Invitations.somepage

But, in many contexts, ( in fact most often)
subsets of pages in a single group would be  preferred...
as the proliferation of
groups wants to be constrained. or I will probably only
allow generation of "sub-groups" be done by admin,
so then we need to give users a way to create their
little "subset-of-pages-domains" using your prefix idea.
If you thrown in a delimiter (I'm using dash -)
then you have some powerful programmatical
ways of parsing subsets for whatever reason...

See Dan's code for "exploding" a string containing "-"
in that example.. for groups.

Just throwing ideas around here.

With "stems" for common groups and prefixes for subsets of
pages, we could have a complete framework for hierarchical
group-page setups...

The UI would need to offer a list of prefixes to choose from, if
for example in a collaborative group, one user wants to add
a page to an existing subset of pages. By using stems in groups
it is automatic, because if  a user is in  a subgroup, Pmwiki's
default behavior is the new
page will be in that sub group. But if  you are in

group

PetCare.*

and I want to add a new page, ShaveAndShampoo with Prefix "Poodle"
to generate

PetCare.Poodle-ShaveAndShampoo

The issue will be.... from where and  how do we get, the Prefix "Poodle"?

then what about new subset creation?
Do we allow new subset creation by users? e.g. I want to add
prefix "Fish"  for new pages on Koi, but "Fish" set does not
yet exist... what then?

PetCare.Fish-CullingDullKoi

then "Fish" needs to be dynamically added to the available prefixes for
the next user...or by admin? either way, I think we are definitely
need to establish a delimiter convention if we see the UI
being this flexible... and we write recipes for it.

I think Dan's code for exploding (what is that? generating an array with
delimiters?)
the group strings based on delimiter dash (hyphen) could be easily
applied to
names also, then you put fill these prefixes into a pull down menu.

Something like:

input.... "select a sub set"   # where the list is parsing existing
prefixes of
pages in a group, but would need to collapse dups.. where we have

$Group.$Prefix[-]$Name

input "Enter a Page name"

and a new pages is generated in your subset.

And then we have the issue of adding subsets (new prefixes) to the frame
work.
you would need a way to add new prefixes (unless you want to leave that
up  to Admin, who simply manually generate a new "home" page for a sub
set, which would then automatically
become available in the option select list of prefixes.

$Group.Bar-HomePage

or you could have a special page/form just of this purpose where prefixes
are added, one by one.. and users go there to set up a new "home page" for
$Group.NewSubset-HomePage.. to get things started...

Keep me posted on this one! I need it...

Sivakatirswami






More information about the pmwiki-users mailing list