We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24253
    • 125 Posts
    Hi,

    I’m not sure if this is mentioned somewhere else, or if I missed something, but are Document types in the make?

    For example, I would love to make a template, using TV’s for the layout and lastly attach these to a Document type which should have the ability to default set for example the:
    - the Parent Id
    - Publish date = current date, unpublish date = current data + x days
    - Cached/searchable
    - Maybe access permissions
    - etc...

    When creating a new document, one could choose from a list of available document types, fill in the information and hit save. Must be the ultimate user experience smiley
    It’s kinda what I need for my website, editors can use the system but easily mess things up, with this editors can very quickly add stuff without forgetting to set the unpublish date etc since they are set by default....

    Best,

    Remon

    P.S.
    I’m so pleased by this great piece of work, please keep going ;-)
      • 32963
      • 1,732 Posts
      You wish is my command smiley

      This has been serveral times before so now it’s a must for MODx.


        xWisdom
        www.xwisdomhtml.com
        The fear of the Lord is the beginning of wisdom:
        MODx Co-Founder - Create and do more with less.
        • 24253
        • 125 Posts
        Quote from: xwisdom at Jun 08, 2005, 06:01 PM

        You wish is my command smiley

        Haha, really?? tongue

        It’s really fantastic how nice this is all gonna be ;-)

        Just wondering, is there allready a way to do something like this:

        for each document in folder
        ? ?output .= document->getOutput;

        return output;

        So a page can easily collect all documents of a certain type, like say, news entries, or small advertisings etc...

        Perhaps this is a bit offtopic, but I had this idea to make a template to _only_ makup the document part, not to be it a template for the whole site.
        Now special layouts had to be created by snippets who requested all kind of document information from the database and put it in html code, or used style sheet code for the layout etc.
        With TV things can be done so much easier if the above is possible smiley

        Thanks,

        Remon
        • Interesting you mention that Remon. smiley

          I’m a big fan of simplifying things on the usability side while maintaining total flexibility whenever possibility. In that regard, the new system should just have templates, period. Not strictly limited to page or layouts. So you may in fact see the realization of templates for entire pages along with templates for parts of pages (in contextual terms, Page Templates and Content Templates ... PTs and CTs).

          But they’re all just templates. wink

          This should be coupled with some minor changes to the Template Variables (TVs ... or in the effort to call them simply what they are for first-timers: just Custom Felds that can be used in various places throughout the system). The change will involve making all TVs accessible to everything unless specifically restricted to a specific tempalte. That way it’s easier to duplicate Tempaltes and have all TVs/Custom Fields be accessible by new or duplicated templates.

          In the end, it’s about making the system easier to use and easier to understand. Keep the suggestions, feedback, commentary and requests coming, please!
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 24253
            • 125 Posts
            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 smiley

            - 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>";
            
              • 6661
              • 119 Posts
              Quote from: R.S. at Jun 09, 2005, 10:40 AM


              - 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 smiley

              - 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?


              I’m liking all of this, particularly the image TV and how to handle TVs when not present in general. Some TVs/content elements should be able to be set as mandatory and many template languages have ways of handling conditionality. If only Smarty were a little snappier (from what I understand), it could take care of these sorts of things.

              Dave