We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34162
    • 1 Posts
    This is an auto-generated topic for <a href="http://modxcms.com/extras/package/567">A 1.0.1-beta</a> by yurik.

    Brief Description:
    Easy way to get and output fields of any document. Snippet uses light template system that allows to format fields output how you like.
      • 25902
      • 27 Posts
      Heyas, I can get some fields like pagetitle, longtitle, etc to output nicely, but pub_date, createdby and others would output 0. Would it be possible to have it able to generate author, published date and author photo?

      Thanks.
        • 11681
        • 98 Posts
        I have interpreted the documentation supplied HERE and transformed it into colloquial U.S. English as best I can. I belive the documentation is incomplete, particularly with regard to examples.
        Instructions

        Installation
        =======
        1. Create new snippet with name "A" and description "Easy way to get and output fields of any document."
        2. Paste snippet code and save.

        Description of snippet’s parameters
        ======================
        doc - ID/alias of document
        id - If set, swithes snippet into placeholder output mode and creates placeholders prefixed with id value
        fields - Comma-separated list of the fields you want to get
        output mode - Switches snippet to use predefined setting (now there is only one predefined mode - ’link’)
        s - Separator to delimit list of field values (when using output of multiple fields without formatting)
        tpl - Template (string) in internal light format. Use %fieldname% construction for output formatting. Look at examples to understand this technology better. In this template you must replace "=" "%%", because there are some cases when MODx cannot correctly run the snippet with the symbol "=" in parameters.

        Use examples
        ========
        Output description of page with ID=2: Output longtitle using alias of document
        Some ways to build links to document:
        Examples with output formatting: [!A? &doc=`11` &mode=`link` &tpl=`%pagetitle%`!]
        [!A? &doc=`11` &fields=`pagetitle,longtitle,url` &tpl=`%pagetitle%`!]
        Link to blog: [+b_pagetitle+]
        If this still interests you, yurik, would you please work with me to improve the documentation of this interesting snippet?

        Thanks!
          I looked just like that in 1964.