Ditto - MODX Community Forums https://forums.modx.com/board/?board=70 <![CDATA[Ditto and Reflect for Evolution 1.4.0RC]]> https://forums.modx.com/thread/103124/ditto-and-reflect-for-evolution-1-4-0rc#dis-post-555066
I am running Evolution 1.4.0RC.

I am receiving the following error from my Reflect snippet call: The Ditto object is invalid. Please check it.

During my research I found a comment that said I should be using the latest/compatible versions of each snippet (Ditto and Reflect).

The version of Ditto that is installed is 2.1.2. (last update 30/03/2016)
The version of Reflect that is installed is 2.2 (last update 2016-11-21)

However, the version for Reflect that is listed on the site (http://extras.evolution-cms.com/packages/rabota-s-resursami/reflect.html) is 2.1.0 and the last update is 08-11-2017. The version for Ditto on the same site is 2.1.3 and the last update is 04.11.2017.

The Ditto version in the MODx Extras section of this website is 2.1.0, last update in 2008.

Could you tell me which are the latest versions, which versions are compatible and where they can be found?

Thanks!]]>
https://forums.modx.com/thread/103124/ditto-and-reflect-for-evolution-1-4-0rc#dis-post-555066 Thu, 09 Nov 2017 09:36:25 +0000 https://forums.modx.com/thread/103124/ditto-and-reflect-for-evolution-1-4-0rc#dis-post-555066
<![CDATA[Ditto &orderBy, work wrong]]> https://forums.modx.com/thread/102916/ditto-orderby-work-wrong#dis-post-554220
I try to list documents as news on my client site, but i have a problem with &orderBy option.
Look on my code below

[!Ditto? &parents=`6` &hideFolders='1' &depth='2' &display=`2` &tpl=`news` &dateSource=`pub_date` &dateFormat=`<span>%d-%m</span><span class="year">%Y</span>` &orderBy=`createdon DESC, pub_date DESC` &showInMenuOnly=`1`!]


I have some document with "Published Date" insert by myself manualy, instead new documents i create have "pub_date" attribute blank and list after this one with "Published Date" who has value.
Second option createdOn list newest documents as first and skips checking pub_date value.

Please help, and sorry for my english wink]]>
https://forums.modx.com/thread/102916/ditto-orderby-work-wrong#dis-post-554220 Fri, 29 Sep 2017 12:39:15 +0000 https://forums.modx.com/thread/102916/ditto-orderby-work-wrong#dis-post-554220
<![CDATA[Ditto filter OR]]> https://forums.modx.com/thread/101961/ditto-filter-or#dis-post-549734
Can I use filter Ditto with several criteria but with OR condition. I have:
&filter=`myfirstTV,text,2|mysecondTV,othertext,2`

Meams myfirstTV == text AND mysecondTV == othertext
But I want to use myfirstTV == text OR mysecondTV == othertext

Can you help me?]]>
https://forums.modx.com/thread/101961/ditto-filter-or#dis-post-549734 Tue, 28 Mar 2017 10:31:07 +0000 https://forums.modx.com/thread/101961/ditto-filter-or#dis-post-549734
<![CDATA[ [TIP] how to get use an 'alt' chunk every THIRD row]]> https://forums.modx.com/thread/42098/tip-how-to-get-use-an-alt-chunk-every-third-row?page=2#dis-post-545148 thought i would post this little snippet in case anyone else wanted use something similar to the alternative chunk (&tplAlt=`altChunk`) feature of Ditto, but every third time rather than every other time.

I needed this function as i have a list of many items which are floated across the page, with three to a row, and the last item in each row needed a class of ’last’ applied to the list element so as to apply some css which removes the right margin - hence keeping the items flush with the right hand side of the page. Although this example shows how to manipulate every third output from ditto his could easily be adapted to any other number easily if required.

So you need to set up a snippet to work out if we are on the third ’iteration’ of the ditto snippet:
<?php
// SNIPPET NAME: 'thirdLast'
// ditto iterations start from zero, so add 1 to start count from 1
$count = $iteration + 1;
// use modulus function to check if count is divisible by 3
if( ($count % 3) == 0 ) { return ' class="last"'; }

return;
?>


There is no need to use the ’&tplAlt’ parameter in Ditto. Simply modify your normal template chunk to include a call to your snippet like so:
<li [!thirdLast? &iteration=`[+ditto_iteration+]` !] >


Hope someone finds this useful! Any feedback welcome.

]]>
https://forums.modx.com/thread/42098/tip-how-to-get-use-an-alt-chunk-every-third-row?page=2#dis-post-545148 Tue, 20 Sep 2016 02:12:01 +0000 https://forums.modx.com/thread/42098/tip-how-to-get-use-an-alt-chunk-every-third-row?page=2#dis-post-545148
<![CDATA[How to insert web link (to send user to external page) in place of ditto button?]]> https://forums.modx.com/thread/100871/how-to-insert-web-link-to-send-user-to-external-page-in-place-of-ditto-button#dis-post-544794
I want users to be able to click on this link (orange "MORE" Button) and it send them to a different link. Right now it just opens up as the template i created for it.

Attached are one note clips of the settings i can change.

http://ragecycles.com/the-tuesday-ten.php


]]>
https://forums.modx.com/thread/100871/how-to-insert-web-link-to-send-user-to-external-page-in-place-of-ditto-button#dis-post-544794 Wed, 07 Sep 2016 05:41:34 +0000 https://forums.modx.com/thread/100871/how-to-insert-web-link-to-send-user-to-external-page-in-place-of-ditto-button#dis-post-544794
<![CDATA[Ditto 2.1.1 pagination issue with Evo 1.1.0]]> https://forums.modx.com/thread/100376/ditto-2-1-1-pagination-issue-with-evo-1-1-0#dis-post-542656 I have a pagination issue with Ditto 2.1.1 and Evo 1.1.0. No matter if the page is cachable or not (or if I use [!Ditto!] or [[Ditto]]), the pagination does not work. If you go to http://www.bad-karlshafen.de/index.php?id=802 and click the "Next" - Link ("Weiter"), you´ll get a URL like this:

http://www.bad-karlshafen.de/index.php?id=802?start=6

But, IMHO it should be something like this: http://www.bad-karlshafen.de/index.php?id=802&start=6.

What can I do?
Thanks!
Marcus]]>
https://forums.modx.com/thread/100376/ditto-2-1-1-pagination-issue-with-evo-1-1-0#dis-post-542656 Tue, 21 Jun 2016 06:08:30 +0000 https://forums.modx.com/thread/100376/ditto-2-1-1-pagination-issue-with-evo-1-1-0#dis-post-542656
<![CDATA[Ditto only listing three children]]> https://forums.modx.com/thread/99278/ditto-only-listing-three-children#dis-post-536898
I have a very strange issue with one production site : Ditto only outputs 3 children documents.
I checked the source code and it is not only a display issue; no more than 3 documents are output.

The same site exists as development site and Ditto displays there all children.

Here's the code:
<!--start of tabs area-->
<div class="onglets" >
  <ul class="tabs">
  [[Ditto &startId=`[*id*]` &tpl=`onglet`  &orderBy=`menuindex ASC` ]]
  </ul>

  <!-- tab panes -->
  [[Ditto &startId=`[*id*]` &tpl=`panneau_onglet_76_22`  &orderBy=`menuindex ASC` ]]

</div>
<!--end of tabs area-->


The production site is running MODX 1.0.15 on PHP 5.4.39.
The development site is running MODx 1.0.14 on PHP 5.2.17.

I can send the URLs as personal messages if someone wants to have a look; please send me a PM.

Thanks.]]>
https://forums.modx.com/thread/99278/ditto-only-listing-three-children#dis-post-536898 Tue, 12 Jan 2016 09:15:37 +0000 https://forums.modx.com/thread/99278/ditto-only-listing-three-children#dis-post-536898
<![CDATA[Please Please Help! Ditto not recognising the proper IDs with #links]]> https://forums.modx.com/thread/96086/please-please-help-ditto-not-recognising-the-proper-ids-with-links#dis-post-520139
<!-- [!currentDay!] -->
 
[!Ditto? &parents=`2` &tpl=`classBlurbs` &filter=`pastClassTeacher,Past Class,2` &display=`all` &orderBy=`eventDateStart ASC` &tagData=`classDay` &tagDisplayDelimiter=`` &tagMode=`onlyTags` &tags=`[!currentDay!]`!]


'classBlurbs' has links that will take you to either the 'Classes' [~226~] or the 'Teachers' [~83~] page AND directly to that specific class or specific teacher.

	
<div class="classBlurb">
[+classBlurbImage+]<br />
    <div class="classBlurbText">
        <b>[+eventDateStart:date=`%l.%M`+] - [+eventDateEnd:date=`%l.%M %p`+]</b><br />
        <span style="font-weight:bold;"><a href="[~226~]#className[+id+]">[+pagetitle+]</a></span><br />
        <i>[+classStudio+]</i><br />
        <a href="[~83~]#theTeacher[+id+]">[+classTeacher+]</a><br />
    </div>
</div>


The problem is, when you click on the teachers name or the class name, you get taken to that page, but not to the specific teacher or class. The links work fine on the page itself, just not when coming from the welcome page.

The actual id that is called is coming from the Schedule parent - 2, instead of the parent of 83 or 226.

Help? I've been working on this for over a month. Client is super patient. I tried to hand it over to another MODx coder who never got back to my client. I just have to sort this out and I'm done!]]>
https://forums.modx.com/thread/96086/please-please-help-ditto-not-recognising-the-proper-ids-with-links#dis-post-520139 Fri, 06 Feb 2015 03:31:22 +0000 https://forums.modx.com/thread/96086/please-please-help-ditto-not-recognising-the-proper-ids-with-links#dis-post-520139
<![CDATA[Do not show Ditto category tags when all articles shown in listing?]]> https://forums.modx.com/thread/92930/do-not-show-ditto-category-tags-when-all-articles-shown-in-listing#dis-post-507760
I have a News section on our website whose main page by default shows summaries of all of the news articles in this section of the site (loaded/paginated into the page using Ditto). The website runs MODx Evo.

Some other parts of the website also link to the News page with a tag name as a URI parameter, so that the page called in this way will only show the articles which are tagged with the corresponding tag, eg:

http://www.example.org/news?tags=sometag

(I set the tag(s) for each article using a template variable and pass the name of the template variable as the &tagData parameter to the Ditto call which shows the article summaries.)

In these cases where the News page is loaded with a tag parameter in the URI, I would like to include text on the page (before the individual article summaries) making it clearer that only news articles matching the tag parameter are listed when the page is accessed this way (the article summaries themselves also include the tags which are set for themself, but it will probably not be obvious to site visitors that not all news articles are shown here otherwise).

The following code shows the tags corresponding to the URI parameter when the page is called this way, but it will also shows the tag value "None" if the page is called without a tag parameter (eg, http://www.example.org/news).

<p>
Showing articles tagged: <span class="news_tags">Tags:</span> [+tagLinks+]
</p>


What I would like to do for the case when the News page is loaded without a URI parameter (and therefore all News articles will be shown) is to not show this above text, as "Showing articles tagged: None" is going to look a little confusing to visitors.

Is there some easy way that I can do this, short of having a snippet which outputs that line depending whether or not the tags parameter value is set?

Thanks for any advice!
]]>
https://forums.modx.com/thread/92930/do-not-show-ditto-category-tags-when-all-articles-shown-in-listing#dis-post-507760 Mon, 01 Sep 2014 09:47:55 +0000 https://forums.modx.com/thread/92930/do-not-show-ditto-category-tags-when-all-articles-shown-in-listing#dis-post-507760
<![CDATA[Ditto and Flexslider]]> https://forums.modx.com/thread/92405/ditto-and-flexslider#dis-post-504977
Any help is welcome. The static version of the site is at yvonneeikens.nl

Thanks.
]]>
https://forums.modx.com/thread/92405/ditto-and-flexslider#dis-post-504977 Tue, 29 Jul 2014 02:59:42 +0000 https://forums.modx.com/thread/92405/ditto-and-flexslider#dis-post-504977
<![CDATA[Removing tags variable from Reflect URL]]> https://forums.modx.com/thread/42791/removing-tags-variable-from-reflect-url#dis-post-500929
The Reflect archive snippet called on the tag landing page is:

[!Reflect? &id=`article` &config=`wordpress` &targetID=`16` &getDocuments=`1` &dittoSnippetParameters=`startID:2|filter:id,16,2`  &tplContainer=`blog_archive_container_tpl`!]


The url that appears is:
http://www.site.com/blog/archive?article+tags=test&article_month=1&article_year=2010&article_day=false&article_start=0

...when I want it to be just:
http://www.site.com/blog/archive?article_tags=test&article_month=1&article_year=2010&article_day=false&article_start=0

]]>
https://forums.modx.com/thread/42791/removing-tags-variable-from-reflect-url#dis-post-500929 Thu, 19 Jun 2014 03:24:45 +0000 https://forums.modx.com/thread/42791/removing-tags-variable-from-reflect-url#dis-post-500929
<![CDATA[Ditto 2.1.1 &noResults not Working]]> https://forums.modx.com/thread/90506/ditto-2-1-1-noresults-not-working#dis-post-496320
somehow Ditto 2.1.1 does not parse any &noResults any longer. It doesn't matter if you use a chunck or add the text to the call or place it into a config file.

Anyone any idea of how this could be solved?

Your help is much appreciated!]]>
https://forums.modx.com/thread/90506/ditto-2-1-1-noresults-not-working#dis-post-496320 Mon, 28 Apr 2014 10:38:00 +0000 https://forums.modx.com/thread/90506/ditto-2-1-1-noresults-not-working#dis-post-496320
<![CDATA[Ditto 2.1.0 Pagination issue: One page created - there should be more.]]> https://forums.modx.com/thread/88722/ditto-2-1-0-pagination-issue-one-page-created---there-should-be-more#dis-post-488092
[[Ditto? &id=`wp` &parents=`24` &display=`3` &tpl=`BlogHomeRow` &extenders=`summary,dateFilter,tagging` &dateSource=`pub_date` &sortBy=`pub_date` &removeChunk=`Comments` &paginate=`1` &tagData=`documentTags` &tagDelimiter=`, ` &paginateAlwaysShowLinks=`1` &noResults=`This blog does not contain any articles.` &debug=`1` &phx=`0`]]

(previosus:[+wp_previous+]) (current:[+wp_currentPage+]) (pages:[+wp_pages+]) (next:[+wp_next+])
(totalPages:[+wp_totalPages+]) (pages:[+wp_pages+])


P.S.: This is the output the last line generates:

(previosus:) (current:1) (pages:1) (next:) (totalPages:1) (pages:1)

I appreciate any help. I spent already too much time on this...

Thank you.


[additional info:]
Even though I use &paginateAlwaysShowLinks the previous and next buttons are not showing]]>
https://forums.modx.com/thread/88722/ditto-2-1-0-pagination-issue-one-page-created---there-should-be-more#dis-post-488092 Thu, 23 Jan 2014 03:40:02 +0000 https://forums.modx.com/thread/88722/ditto-2-1-0-pagination-issue-one-page-created---there-should-be-more#dis-post-488092
<![CDATA[Reflect not working as expected]]> https://forums.modx.com/thread/42583/reflect-not-working-as-expected?page=3#dis-post-486422
[!Reflect? &getDocuments=`1` &dittoSnippetParameters=`parents:3|dateSource:createdon|orderBy:createdon ASC` &id=`agenda` &dateFormat=`%d`!]


and this is working perfectly but I want to sort it by a date tv i call ’Datum’
so like the ditto site showed me I changed the ’createdon’ into ’Datum’ like this
[!Reflect? &getDocuments=`1` &dittoSnippetParameters=`parents:3|dateSource:Datum|orderBy:Datum ASC` &id=`agenda` &dateFormat=`%d`!]

but this isn’t working as expected (de date is 0 because it refers to 1970) but if I call ditto like this
[!Ditto? &display=`2` &paginate=`1` &paginateAlwaysShowLinks=`1` &parents=`3`  &dateSource=`Datum` &dateFormat=`%d-%m-%Y` &orderBy=`Datum ASC`!]

it is working as expected!

can someone help me getting this to work?

sorry for my bad english
]]>
https://forums.modx.com/thread/42583/reflect-not-working-as-expected?page=3#dis-post-486422 Fri, 03 Jan 2014 08:13:58 +0000 https://forums.modx.com/thread/42583/reflect-not-working-as-expected?page=3#dis-post-486422
<![CDATA[How to sort Ditto by Time only, ignoring date?]]> https://forums.modx.com/thread/86351/how-to-sort-ditto-by-time-only-ignoring-date#dis-post-476019 https://forums.modx.com/thread/86351/how-to-sort-ditto-by-time-only-ignoring-date#dis-post-476019 Wed, 28 Aug 2013 12:34:27 +0000 https://forums.modx.com/thread/86351/how-to-sort-ditto-by-time-only-ignoring-date#dis-post-476019 <![CDATA[Ditto - styling - Class active / Class last.]]> https://forums.modx.com/thread/42148/ditto---styling---class-active-class-last#dis-post-470667
http://www.loopassociates.com/

In the top i have a Wayfindermenu (works fine) . On the sidebar - the menu on top (listing different cases) the navigation is made with Ditto, and the below menu * Brand Identity * Web * Packaging * Space is also a wayfinder menu. Wayfinder puts classes active and last on the menus last clicked. Is there a way to achieve the same with Ditto. The plan is to make the (cases) menu clicked Grey in the Ditto menu - as the two other menus. I don’t want to use a:visited - since it make all visited menus Grey in IE.

As you can see i use Bold - normal - in the Ditto menu. (is that possible with wayfinder - because MB i can use wayfinder to create the cases menu or ??]]>
https://forums.modx.com/thread/42148/ditto---styling---class-active-class-last#dis-post-470667 Tue, 02 Jul 2013 10:48:00 +0000 https://forums.modx.com/thread/42148/ditto---styling---class-active-class-last#dis-post-470667
<![CDATA[SplitPagination Alternative (JQuery)]]> https://forums.modx.com/thread/84897/splitpagination-alternative-jquery#dis-post-468116
Thought it might be useful for people who are looking for a SplitPagination snippet alternative if for some reason they can't use that (ex: I can't seem to use SplitPagination for my custom snippet that's calling Ditto via a $mod->runSnippet function). I've created a simple JQuery function that will clean up the page numbers to show only X and Y amount of pages before and after the current page. This JQuery solution assumes you're simply using Ditto's paginate parameter and default HTML markup:

DEFAULT PAGINATION OUTPUT:

<p>Showing <strong>[+start+]</strong> - <strong>[+stop+]</strong> of <strong>[+total+]</strong> Articles | Page <strong>[+currentPage+]</strong> of <strong>[+totalPages+]</strong></p> <div id="ditto_pages"> [+previous+] [+pages+] [+next+] </div>



JQUERY FUNCTION:


		function fixPagination(paginationContainer, pageLink, currentPageLink, maxPageLinksPrepend, maxPageLinksAppend) {
			startPageLink = 0;
			totalPageLinks = $(pageLink).length + 1; //Include current link too
			currentPageLinkIndex = $(paginationContainer).children().closest(currentPageLink).index();

			endPageLinkPrepend = currentPageLinkIndex - maxPageLinksPrepend - 1;
			endPageLinkAppend = currentPageLinkIndex + maxPageLinksAppend - 1; 
			//alert(endPageLinkPrepend + ' ' + endPageLinkAppend);


			if (endPageLinkPrepend > 0) {
				count = 0;
				for (count = startPageLink; count < endPageLinkPrepend; count++) {
					//alert(count);
					$(pageLink + ':eq(' + count + ')').css('display','none');
				}
			}

			if (endPageLinkAppend > 0) {
				count = 0;
				for (count = endPageLinkAppend; count < totalPageLinks; count++) {
					//alert(count);
					$(pageLink + ':eq(' + count + ')').css('display','none');
				}
			}

		}

		fixPagination('#ditto_pages', '.ditto_page', '.ditto_currentpage', 3, 3);

]]>
https://forums.modx.com/thread/84897/splitpagination-alternative-jquery#dis-post-468116 Wed, 05 Jun 2013 04:58:07 +0000 https://forums.modx.com/thread/84897/splitpagination-alternative-jquery#dis-post-468116
<![CDATA[Filter results from dropdown]]> https://forums.modx.com/thread/42598/filter-results-from-dropdown?page=3#dis-post-467890
I also want to be able to show certain results idealy by a TV value, but if easier I could probably get away with filtering by a word from the content.

Ive tried adding &ditto_filter=1_1_1 (where 1’s are the values of the filter) will this solution work? If so what do you seperate the values with? It is loading the page but diplaying "No Results" so the filter is not working.

Ive read about possibly using the &tags= option in the URL, but how do I tag each ditto document?

Any help/advice appreciated]]>
https://forums.modx.com/thread/42598/filter-results-from-dropdown?page=3#dis-post-467890 Mon, 03 Jun 2013 09:48:35 +0000 https://forums.modx.com/thread/42598/filter-results-from-dropdown?page=3#dis-post-467890
<![CDATA[How to sort Ditto output by document ID using &documents?]]> https://forums.modx.com/thread/42752/how-to-sort-ditto-output-by-document-id-using-documents#dis-post-467422
I’d like to sort selected documents that I have specified using the &documents parameter, but they must be output in the order they are listed. I just can’t find the right orderBy value.

[!Ditto? &tpl=`officeTplNoLink` &parents=`7` &orderBy=`pagetitle ASC` &documents=`40,46,47,35,36,37,44,41,43,49,48,50,54,53`!]


Or can anyone point me to a list of Ditto parameter values (not just the parameters themselves?)

Thanks in advance.]]>
https://forums.modx.com/thread/42752/how-to-sort-ditto-output-by-document-id-using-documents#dis-post-467422 Tue, 28 May 2013 06:07:26 +0000 https://forums.modx.com/thread/42752/how-to-sort-ditto-output-by-document-id-using-documents#dis-post-467422
<![CDATA[Use ditto iteration and math ?]]> https://forums.modx.com/thread/84300/use-ditto-iteration-and-math#dis-post-465280
[[Ditto? 
&parents=`5`
&total=`99`
&showPublishedOnly=`1` 
&orderBy=`menuindex ASC` 
&tpl=`detail`
&tplCurrentDocument=`detail-actief`
&summarize=`9`
&paginate=`1`
&paginateAlwaysShowLinks=`1`
]]

<div class="ditto_pages">Page [+pages+]</div>




When I'm on page 1 all the 1st page ditto links need to add ?start=0
When I'm on page 2 all the 2nd page ditto links need to add ?start=9
on page 3 the ditto links need to add ?start=18...

In chunk detail-actief I need somehow to use a math or other way.
<a href="[~[+id+]~]?start=[+ditto_iteration:math=`(?)`+]">some link</a>


I have found something but couldn't get it to work:
http://forums.modx.com/thread/70785/making-ditto-iteration-consecutive-across-multiple-pages#dis-post-397440




]]>
https://forums.modx.com/thread/84300/use-ditto-iteration-and-math#dis-post-465280 Fri, 03 May 2013 02:17:27 +0000 https://forums.modx.com/thread/84300/use-ditto-iteration-and-math#dis-post-465280