Heh, sure they are all just templates ;-)
Thats the power of the system hehehe, simplicity!
I didn’t use modx a lot, but I think this one is usefull too:
- When creating a template, give a tabpage/selectbox/other to choose from the available TV’s, instead of going to each and every TV you used in your template
- Another tip, when a document isn’t published, the preview functionality should work, now it doesn’t....
- Email TV, use encoding (see code below) to display a clickable link instead of plain text
- Image TV, is it possible to set options like: align=’right’ ? Would make it more usefull. Also, if no image is supplied, a red x is shown in IE, what about not including the code at all, or perhaps inserting a 1 pixel transparant gif instead?
Hmm, need to gonna use modx more to give more feedback, be prepared ;-)
Remon
php code for email encoding:
/**
* Encode email addresses to make it harder for spammers to harvest them.
*
* Usage:
* Make a new snippet and give it a sensible name, like "DisplayEmail"
* Call it everywhere in you code like this if you want the email-link
* the same name as the email addres:
*
* [[[email protected]]]
*
* or with a link name specified:
*
* [[[email protected]&name=My name here]]
*
*
* Modified version of the Spam-me-not by Remon Sijrier of the:
*
* Spam-me-not PHP version by Rolf Offermanns
* inspired by the Spam-me-not JavaScript by Andreas Neudecker
*
* version: 2003-09-28
*
* Spam-me-not Javascript Homepage:
*
*? ? ?http://www.zapyon.de/
*
*/
$nametoshow = isset($name) ? $name : $address;
$mailaddress = isset($address) ? $address : "";
$originalString = "mailto:";
$originalString .= $mailaddress;
$encodedString = "";
$nowCodeString = "";
$randomNumber = -1;
$originalLength = strlen($originalString);
$encodeMode = $mode;
for ( $i = 0; $i < $originalLength; $i++) {
$encodeMode = rand(1,2);
switch ($encodeMode) {
case 1: // Decimal code
$nowCodeString = "&#" . ord($originalString[$i]) . ";";
break;
case 2: // Hexadecimal code
$nowCodeString = "&#x" . dechex(ord($originalString[$i])) . ";";
break;
default:
return "ERROR: wrong encoding mode.";
}
$encodedString .= $nowCodeString;
}
return "<a href=\"".$encodedString."\">".$nametoshow."</a>";