Welcome to Squishdot Websites Squishdot How-To
 about
 search
 post article
 Documentation
 Mailing Lists
 Bug Tracking
 Development
 Installation
 Upgrading
 Download
 admin
 rdf

 main


How to Default the Tile and Email Address on Postings
How-To Posted by on Tuesday July 13, 11:02AM, 2004
from the getting-my-hands-dirty dept.
The "Title" and "Email" boxes on the Posting form (for both Articles and Replies) need to default the user's details (Full Name and Email Address).

This is a requirement from our management :-(

I have added a TinyTablePlus object to the root Squishdot Site Folder called "user_details", with these columns: logonname fullname emailaddress

(All edits of the site will be by authenticated users)

How can I get the posting form to look up the users' logonname (i.e. "markm", and put the relevant fullname and emailaddress into the Name and Email boxes (i.e. "Mark Matthews" and "" ????

Also, I may have to make these same boxes read only as well.

<  |  >

 

Related Links

The Fine Print: The following comments are owned by whoever posted them.
( Reply )

Re: How to Default the Tile and Email Address on P
by on Thursday July 15, 09:51PM, 2004
You'll have to find the way to query a TinyTable yourself, I'm afraid I don't know...

After that, insert the required code into the posting form and put it into a hidden input instead of displaying a visible input (->learn more about html ;-)

This doesn't really prevent them from changing things, but will be good enough for most people ;-)
[ Reply to this ]
Re: How to Default the Tile and Email Address on Postings
by on Monday July 19, 02:03PM, 2004
Here's how i made this work;

Note: All our zope site users users registered in the ZMI at "Root\acl_users" have names in the format "markm" or "fredb"

First, I made a TinyTable object on the root of the site, i.e. at "ZMI\Root\MySquishdotSite" called "user_details" with columns "logonname fullname emailaddress", and sample data like this;
"markm", "mark Matthews", ""
"fredb", "fred bloggs", ""

Second, to show the login data in the Right Hand Side of the screen below the Rightbbox Methods, in the "Root\MySquishdotSite\misc_methods" folder i made a new DTML Method called "user_detail_info" wit the following script:









User Details

Logged On As










Second (cont) I added this script into the index_html() object's script after it does the rightbox stuff;







Now, the above shows how to get the users' login name, and do lookups based on that. So next was how to use this in the posting windows? well...

Third, to use this in the addPostingForm() I changed the script (in both places where it created the Input controls) to look like this;






Your Email address
(Required if reply notification is checkedOptional)







Basically, you are wrapping up the old script on this object wherever it used to say



and



with the above script.

[ Reply to this ]
The Fine Print: The following comments are owned by whoever posted them.
( Reply )

Powered by Zope  Squishdot Powered
  "Any system that depends on reliability is unreliable." -- Nogg's Postulate
All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest ©1999 , ©2000-2002 .