2018-04-27, 08:25

Feb 27, 2012 — Notify Users module, ver. 0.5 released — user can choose between sending single message (...) »

2013-01-28, 08:32

19 студзеня 2013 у Гродне трагічна загінуў паэт, журналіст і мой сябар (...) »

2009-10-14, 07:19

The site Litaratura.org is devoted to Belarusian literary works and translations. (...) »

2009-01-12, 20:46

Late November 2008 marked the 20th anniversary of the official founding of the Belarusian (...) »

Registered User Area Log into This Site
Show Credits... Credits
Worthwhile Services
Refresh My Local Time (GMT+1)... Apr 27, 2018 — 08:25
  • Russian Federation (2)
    United States (5)
  • Today (103)
  • Yesterday (451)
~ / Public Domain Software / Extensions to Ditto / DittoFormat Snippet $_
DittoFormat Snippet
Click To View A Full Size Image...
2010-01-10, 15:13

This snippet is a result of the solution provided to the MODx user Lokust.

Lokust had a problem with adjusting Ditto’s output and requested to design a thing that would divide the result set into equal groups with a configurable wrapper around the group so that the final output might be formatted with CSS into rows/columns as required.

Lokust not only donated to my work, but also decided to submit the snippet to the public domain as a MODx Add-On.

How to use DittoFormat

# 1) create new snippet 'DittoFormat' and paste into it content of the attached dittoformat.txt file
# 2) call your snippet something as:
[[DittoFormat? &parents=`2` &depth=`1` &display=`all` &sortBy=`menuindex` &sortDir=`ASC` &group=`3` &tplGroup=`group-chunk` &tplItem=`item-chunk`]]
# 3) please read more details on parameters in snippet's header

Download This Attachment... DittoFormat Snippet — the very latest version
Last modified: 2009-09-23, 00:00 — Size: 3,44 KB — Users: 519 — Downloads: 817
Click to show a form...Click to hide the form... Write a comment
  • Required fields are marked with *.
  • Comments are published after the approval of the site owner, who is a human rather than a wind-fast computer program so please be patient.

* Code:
 
Get another image...Enter this code into the appropriate field of the form while submitting an e-mail or a comment. If you have trouble with reading it, generate another...
roltom
Comment
dittoformat 5 items per row
Comment #1 on: 2010-03-31, 03:13
Seems to be just what I'm looking for! How do I arrange dittoformat results into rows of 5? I have set the group parameter to 5, what do I do with tplgroup? Can you give me an example?
Aleksander Maksymiuk
Comment
tplGroup
Comment #2 on: 2010-03-31, 06:51
All parameters are well-described (with examples) within snippet's header. Actually, you are the first person who asks what to do with parameters

tplGroup is a place where you can instruct how your entire group (row) of items should be wrapped: <div class="regular-group">[ group ]</div>

tplGroupLast stands for the same but it is applied to the last and incomplete group. In your case, last incomplete group (row) can contain 4, 3, 2, or 1 items. Example: <div class="last-group">[ group ]</div>

tplGroup, tplGroupLast are chunks.
roltom
Comment
tplGroup styling
Comment #3 on: 2010-03-31, 09:59
I'm not much of a programmer. What am I doing wrong? This is my call:

This is the chunk 'modellThumbs':

<div id="modellthumb">
<a href="" target="_self">
<img src="" alt="" width="95" height="95" /><br>
</a>
</div>

This is 'modellThumbsGroup':

<div class="regular-group">[ group ]</div>

Should I specify the class regular-group somehow to give me a horizontal listing instead of a vertical one? Right now, the results are listed vertically.
Aleksander Maksymiuk
Comment
tplGroup styling
Comment #4 on: 2010-03-31, 11:48
Of course, you need to define within your CSS sheet how things are displayed. Snippet cannot do this for you -- the snippet only fetches items, divides them into groups, wraps the groups with appropriate CSS classes, but how CSS classes behave is up to you alone. Understanding this thing is a kind of designer's basics.

Defining something like

#modellthumb {
...
float: left;
...
}

within your CSS stylesheet will probably solve your problem, but I cannot teach you the whole complexity of CSS.

Good luck :)
Stevica Canadi
Comment
Filter By TV
Comment #5 on: 2010-10-04, 16:42
Is there any way to filter a snipet call by TV tag for example this was my diito call