We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31654
    • 238 Posts
    Is it possible to use a custom date TV to set the archive dates. Currently I can only use publishedon but I have a custom TV (set to date) called EventStartTime which I use for an events calendar.

    I’ve tried:
    [[!Archivist? &target=`28` &parents=`7` &sortBy=`EventStartTime`]] 


    I though using get page with TV’s set to 1 might help but sadly I get the same error:
     [[!getPage?
      &element=`Archivist`
      &elementClass=`modSnippet`
      &cache=`0`
      &pageVarKey=`page`
      &parents=`7`
      &includeTVs=`1`
      &includeContent=`1`
      &showHidden=`1`
      &target=`28`
      &sortBy=`EventStartTime`
    ]]


    The error I get is:

    2010-11-12 16:13:05] (ERROR @ /index.php) Error 42S22 executing statement: Array ( [0] => 42S22 [1] => 1054 [2] => Unknown column 'EventStartTime' in 'field list' ) 


    Any help would be most appreciated.
      Web Development, Web Hosting & Search Engine Marketing by:

      Vitalized | UK
      w. www.vitalized.co.uk

      Website Design | Search Engine Marketing (SEM) | UK MODx web hosting, secure, fast & 100% MODx compatible

      Vitalized | Australia
      w. www.vitalized-australia.com.au

      Website Design | Search Engine Marketing (SEM) | Australian MODx web hosting, secure, fast & 100% MODx compatible
      • 28215
      • 4,149 Posts
      Don’t use &sortBy when sorting with TVs in getPage (which wraps getResources). Use:

      &sortbyTV=`EventStartTime` &sortdirTV=`ASC`

        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 31654
        • 238 Posts
        Thanks for the suggestion but it now just defaults to the ’publishedon’ date so events, completely ignoring the &sortbyTV. So pages created in September for events in October are appearing the September archive. I need the archiver to archive based on the EventStartTime (which is a date TV)
          Web Development, Web Hosting & Search Engine Marketing by:

          Vitalized | UK
          w. www.vitalized.co.uk

          Website Design | Search Engine Marketing (SEM) | UK MODx web hosting, secure, fast & 100% MODx compatible

          Vitalized | Australia
          w. www.vitalized-australia.com.au

          Website Design | Search Engine Marketing (SEM) | Australian MODx web hosting, secure, fast & 100% MODx compatible
          • 8168
          • 1,118 Posts
            [list][list][list]Shaun,

            Is it possible to use Archivist to list items as below:

            [list]
          • 2010

          • November
          • September
          • July
          [/li]
          [li][/li]
          [/list]



          • 2010

          • December
          • October
          • May
          [/li]
          [li][/li]
          [/list]

          For example - This way one could make the years accordion containers to show / hide older items... Any ideas on how this might be possible using Archivist?


          Cheers,

          dubbs.[/list][/list]
            • 31654
            • 238 Posts
            Quote from: Vitalized at Nov 16, 2010, 09:16 AM

            Thanks for the suggestion but it now just defaults to the ’publishedon’ date so events, completely ignoring the &sortbyTV. So pages created in September for events in October are appearing the September archive. I need the archiver to archive based on the EventStartTime (which is a date TV)

            IS anyone able to help?... Is it a bug?
              Web Development, Web Hosting & Search Engine Marketing by:

              Vitalized | UK
              w. www.vitalized.co.uk

              Website Design | Search Engine Marketing (SEM) | UK MODx web hosting, secure, fast & 100% MODx compatible

              Vitalized | Australia
              w. www.vitalized-australia.com.au

              Website Design | Search Engine Marketing (SEM) | Australian MODx web hosting, secure, fast & 100% MODx compatible
              • 8168
              • 1,118 Posts
              Sorry the formatting of my post went off!

              What I meant was a parent LI with the year, then all children LIs from that year by month e.g...

              * 2010
              * November (2)
              * May (2)

              * 2009
              * December (3)
              * July (1)
              * February (5)



              Cheers,

              dubbs.
                • 10378
                • 375 Posts
                Quote from: dubbs at Nov 24, 2010, 06:12 AM
                Sorry the formatting of my post went off!

                What I meant was a parent LI with the year, then all children LIs from that year by month e.g...

                * 2010
                * November (2)
                * May (2)

                * 2009
                * December (3)
                * July (1)
                * February (5)



                Cheers,

                dubbs.


                Very late answer - I know - but maybe It will help others too:

                Snippet config:

                [[!Archivist?
                    &parents=`[[++id_of_parent_container]]`
                    &target=`[[++id_of_archive_landing_page]]`
                    &limit=`0`
                    &groupByYear=`1`
                    &tpl=`ArchivistRowTpl`
                    &yearGroupTpl=`ArchivistYearGroupTpl`
                ]]
                


                ArchivistRowTpl chunk:

                <li class="arc-row"><a href="[[+url]]">[[+month_name_abbr]] <span>([[+count]])</span></a></li>
                
                


                ArchivistYearGroupTpl chunk:

                <ul class="arc-year-group">
                    <li class="arc-year-group-row">
                        <a href="[[+url]]">[[+year]]</a>
                        <ul class="arc-group">
                            [[+row]]
                        </ul>
                    </li>
                </ul>
                
                  Freelancer @bitego http://www.bitego.com
                  ---
                  GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
                  More infos here: http://www.bitego.com/extras/goodnews/
                  • 36671 ☆ A M B ☆
                  • 120 Posts
                  I am trying to use Archivist for the first time but the getArchives page is returning an array.

                  The archive navigation itself is working (and thanks to Gadgetto's post above I have it grouped by year) but my output when I select an archive is as follows:

                  November 2012 Archives
                  Array
                  (
                  [tpl] =>
                  [tplOdd] =>
                  [tplFirst] =>
                  [tplLast] =>
                  [sortby] => publishedon
                  [sortbyTV] =>
                  [sortbyTVType] => string
                  [sortbyAlias] =>
                  [sortbyEscaped] => 0
                  [sortdir] => DESC
                  [sortdirTV] => DESC
                  [limit] => 5
                  [offset] => 0
                  [tvFilters] =>
                  [tvFiltersAndDelimiter] => ,
                  [tvFiltersOrDelimiter] => ||
                  [depth] => 10
                  [parents] => 22
                  [includeContent] =>
                  [includeTVs] =>
                  [includeTVList] =>
                  [showHidden] => 1
                  [showUnpublished] =>
                  [showDeleted] =>
                  [resources] =>
                  [processTVs] =>
                  [processTVList] =>
                  [prepareTVs] => 1
                  [prepareTVList] =>
                  [tvPrefix] => tv.
                  [idx] => 1
                  [first] => 1
                  [last] => 1
                  [toPlaceholder] => archives
                  [toSeparatePlaceholders] =>
                  [debug] =>
                  [where] => ["FROM_UNIXTIME(`publishedon`,\"%Y\") = \"2012\"","FROM_UNIXTIME(`publishedon`,\"%m\") = \"11\""]
                  [dbCacheFlag] => 0
                  [context] =>
                  [tplCondition] =>
                  [tplOperator] => ==
                  [conditionalTpls] =>
                  [filterField] => publishedon
                  [filterPrefix] => arc_
                  [tagKey] => tags
                  [tagKeyVar] => key
                  [tagRequestParam] => tag
                  [tagSearchType] => contains
                  [odd] => 1
                  [id] => 253
                  [type] => document
                  [contentType] => text/html
                  [pagetitle] => A Whole New Look Appassionata online & live in the shop
                  [longtitle] => Just in time for you at Christmas
                  [description] =>
                  [alias] => a-whole-new-look-appassionata-online-and-live-in-the-shop
                  [link_attributes] =>
                  [published] => 1
                  [pub_date] => 0
                  [unpub_date] => 0
                  [parent] => 22
                  [isfolder] =>
                  [introtext] => And so it is Christmas....
                  [richtext] => 1
                  [template] => 11
                  [menuindex] => 3
                  [searchable] => 1
                  [cacheable] => 1
                  [createdby] => 1
                  [createdon] => 2012-11-28 04:28:40
                  [editedby] => 1
                  [editedon] => 2012-11-28 04:28:52
                  [deleted] =>
                  [deletedon] => 0
                  [deletedby] => 0
                  [publishedon] => 2012-11-28 10:28:00
                  [publishedby] => 1
                  [menutitle] =>
                  [donthit] =>
                  [privateweb] =>
                  [privatemgr] =>
                  [content_dispo] => 0
                  [hidemenu] => 1
                  [class_key] => modDocument
                  [context_key] => web
                  [content_type] => 1
                  [uri] => a-whole-new-look-appassionata-online-and-live-in-the-shop.html
                  [uri_override] => 0
                  [hide_children_in_tree] => 0
                  [show_in_tree] => 1
                  [properties] =>
                  )



                  My call is:

                  [[!getArchives?
                     &parents=`22`
                     &toPlaceholder=`archives`
                     &showHidden=`1` 
                  ]]
                   
                  <h2>[[+arc_month_name]] [[+arc_year]] Archives</h2>
                   
                  [[+archives]]





                  If I add &tpl=`newsArchiveTpl` into the getArchives call, I get:

                  ()



                  Any idea what I'm doing wrong? Thanks!
                    • 36671 ☆ A M B ☆
                    • 120 Posts
                    I am trying to use Archivist for the first time but the getArchives page is returning an array.

                    The archive navigation itself is working (and thanks to Gadgetto's post above I have it grouped by year) but my output when I select an archive is as follows:

                    November 2012 Archives
                    Array
                    (
                    [tpl] =>
                    [tplOdd] =>
                    [tplFirst] =>
                    [tplLast] =>
                    [sortby] => publishedon
                    [sortbyTV] =>
                    [sortbyTVType] => string
                    [sortbyAlias] =>
                    [sortbyEscaped] => 0
                    [sortdir] => DESC
                    [sortdirTV] => DESC
                    [limit] => 5
                    [offset] => 0
                    [tvFilters] =>
                    [tvFiltersAndDelimiter] => ,
                    [tvFiltersOrDelimiter] => ||
                    [depth] => 10
                    [parents] => 22
                    [includeContent] =>
                    [includeTVs] =>
                    [includeTVList] =>
                    [showHidden] => 1
                    [showUnpublished] =>
                    [showDeleted] =>
                    [resources] =>
                    [processTVs] =>
                    [processTVList] =>
                    [prepareTVs] => 1
                    [prepareTVList] =>
                    [tvPrefix] => tv.
                    [idx] => 1
                    [first] => 1
                    [last] => 1
                    [toPlaceholder] => archives
                    [toSeparatePlaceholders] =>
                    [debug] =>
                    [where] => ["FROM_UNIXTIME(`publishedon`,\"%Y\") = \"2012\"","FROM_UNIXTIME(`publishedon`,\"%m\") = \"11\""]
                    [dbCacheFlag] => 0
                    [context] =>
                    [tplCondition] =>
                    [tplOperator] => ==
                    [conditionalTpls] =>
                    [filterField] => publishedon
                    [filterPrefix] => arc_
                    [tagKey] => tags
                    [tagKeyVar] => key
                    [tagRequestParam] => tag
                    [tagSearchType] => contains
                    [odd] => 1
                    [id] => 253
                    [type] => document
                    [contentType] => text/html
                    [pagetitle] => A Whole New Look Appassionata online & live in the shop
                    [longtitle] => Just in time for you at Christmas
                    [description] =>
                    [alias] => a-whole-new-look-appassionata-online-and-live-in-the-shop
                    [link_attributes] =>
                    [published] => 1
                    [pub_date] => 0
                    [unpub_date] => 0
                    [parent] => 22
                    [isfolder] =>
                    [introtext] => And so it is Christmas....
                    [richtext] => 1
                    [template] => 11
                    [menuindex] => 3
                    [searchable] => 1
                    [cacheable] => 1
                    [createdby] => 1
                    [createdon] => 2012-11-28 04:28:40
                    [editedby] => 1
                    [editedon] => 2012-11-28 04:28:52
                    [deleted] =>
                    [deletedon] => 0
                    [deletedby] => 0
                    [publishedon] => 2012-11-28 10:28:00
                    [publishedby] => 1
                    [menutitle] =>
                    [donthit] =>
                    [privateweb] =>
                    [privatemgr] =>
                    [content_dispo] => 0
                    [hidemenu] => 1
                    [class_key] => modDocument
                    [context_key] => web
                    [content_type] => 1
                    [uri] => a-whole-new-look-appassionata-online-and-live-in-the-shop.html
                    [uri_override] => 0
                    [hide_children_in_tree] => 0
                    [show_in_tree] => 1
                    [properties] =>
                    )



                    My call is:

                    [[!getArchives?
                       &parents=`22`
                       &toPlaceholder=`archives`
                       &showHidden=`1` 
                    ]]
                     
                    <h2>[[+arc_month_name]] [[+arc_year]] Archives</h2>
                     
                    [[+archives]]





                    If I add &tpl=`newsArchiveTpl` into the getArchives call, I get:

                    ()



                    Any idea what I'm doing wrong? Thanks!
                      • 10378
                      • 375 Posts
                      Here is the snippet call I'm using:

                      Hint: the showhidden=1 property is used because I'm fetching resources from an Articles container!
                      The list of resources is rendered with pagination.

                          <div id="newscontainer">
                              [[!getPage?
                                  &element=`getArchives`
                                  &tpl=`NewsRowTpl`
                                  &parents=`_your_parents_here_`
                                  &showHidden=`1`
                                  &limit=`7`
                                  &pageVarKey=`page`
                                  &includeTVs=`1`
                                  &processTVs=`1`
                                  &toPlaceholder=`archives`
                                  &cache=`0`
                              ]] 
                              <h2>News for [[+arc_month_name]] [[+arc_year]]</h2>
                              [[+archives]]
                          </div>
                          <ul id="newspaging">
                              [[!+page.nav]]
                          </ul>
                      


                      And here is the chunk part NewsRowTpl

                      <div class="newsitem">
                          <h3><a href="[[~[[+id]]]]">[[+pagetitle]]</a></h3>
                          <p class="postmeta">
                              <span class="pm-author">[[+createdby:userinfo=`fullname`]]</a></span>,
                              am <span class="pm-date">[[+publishedon:strtotime:date=`%d.%m.%Y`]]</span>
                              | <span class="pm-comments"><a href="[[~[[+id]]]]#comments">Comments ([[!QuipCount? &thread=`article-b[[+parent]]-[[+id]]`]])</a></span>
                              | <span class="pm-clicks">Clicks: [[+tv.clickCounter]] mal</span>
                          </p>
                          <p class="introtext">
                              [[+introtext]]
                          </p>
                      </div>
                      
                        Freelancer @bitego http://www.bitego.com
                        ---
                        GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
                        More infos here: http://www.bitego.com/extras/goodnews/