Hi, I was wondering if there is a shorcode for the user email, know know like [+uid+] is for the user id?
Any help would be appreciated.
I think it is [(emailsender)] but I don’t find it in the documentation
-
☆ A M B ☆
- 24,524 Posts
[(emailsender)] is a system variable, and is for the default email address of the system administrator.
What you are asking about is a placeholder, and those are totally dependent on what the snippet you are using it with provides.
Erm...well I’m running a web hosting company, and i’ve just transfered to MODx. My forms that i have designed take in the User ID, and contact email and automatically stick them into the text boxes provided and if they want to change teh email they can but the User Name and ID wont be allowed to change.
Any way of doing that or is it all in my head?
-
☆ A M B ☆
- 24,524 Posts
Try examining the eForm, the default contact form and the RegisterX snippets for how to use placeholders in your form template, send mail and access the database. The snippet you create would be able to do anything with the POST values that you like, including updating specific fields in the database.
Here’s a couple of links to information on disabling form fields:
http://www.quirksmode.org/js/disabled.html and
http://www.cs.tut.fi/~jkorpela/forms/readonly.html
I also want to retrieve a manager user’s email adress by some nifty placeholder!
-
MODX Staff
- 730 Posts
@feary: what snippet(s) are you running on the page where you want your nifty placeholder?
-
MODX Staff
- 730 Posts
Here’s code for a very rudimentary snippet - call it anything you want. After you include this snippet in your template (sometimes I just run a snippet like this at the top of a template so that various placeholders are set), then voila, the placeholder is available anywhere in your html.
<?php
/**
* set a placeholder
*
* this example sets mgrEmail
*/
$modx->setPlaceholder('mgrEmail', $_SESSION['mgrEmail']);
?>
To include the placeholder in your html after the snippet is called, it’s
Email: <input name="email" value="[+mgrEmail+]" />