BlogSphere - Feature Request: Make PermaLink values editable for static pagesCreated on |
May 18, 2003 |
Last modified on |
May 29, 2003 |
Created by |
John Smart |
Last modified by |
Declan Lynch |
Status |
Added to app |
For example, I'd like my "About Us" page to be domain.com/blogsphere.nsf/plinks/AboutUs instead of of domain.com/blogsphere.nsf/plinks/JSMT-5MNRGB.
As long as the validtion formula prevented duplicates and illegal characters, I don't think it would introduce any problems.
Here's some code I've seen (I didn't write this and haven't bothered to optimize it yet) that may work very well for this purpose. It was written for a field name of PageName and there's a computed for display after validation field called tmpOldPage hidden on the form.
isNew := @IsNewDoc;
isBlank := PageName = "";
notStillTheSame := !(PageName = tmpOldPageName);
unSafeChars := "\"": "\\" : ";" : "/" : "?" : ":" : "@" : "=" : "&" : "<" : ">" : "#" : "%" : "{" : "}" : "|" : "^" : "~" : "[" : "]" : "`" : @NewLine;
asciiRendered := @Ascii(PageName;[AllInRange]);
nonPrintable := (! isBlank) & (asciiRendered = "");
fallBack := asciiRendered != PageName;
unSafe := @Contains(PageName;unSafeChars);
lkup := @DbLookup("":"NoCache";"":"";"pages";PageName;2);
lkupOK :=!@IsError(lkup);
lkupIsDup := @If(lkupOK;
@Elements(lkup) > 1;
@False
);
lkupIsMe := @If(lkupOK;
lkup = @Text(@DocumentUniqueID);
@False
);
@If(!@IsDocBeingSaved;
@Success;
isBlank;
@Failure("You must enter a page name");
lkupIsDup;
@Failure("The new Page's name is a duplicate. Enter a unique page name.");
lkupIsMe;
@Success;
notStillTheSame & lkupOK;
@Failure("The new Page's name is a duplicate. Enter a unique page name.");
unSafe;
@Failure("The page name contains a character that is unsafe for URLs");
nonPrintable;
@Failure("The page name contains a non-printable character that is not allowed for URLs");
fallBack;
@Failure("The page name contains a non-ASCII character that is not allowed for URLs");
@Success
)
Taken Actions by OwnersDocuments