Perepost from my blog - can someone come in handy
I started to make new projects on Revo - the transition from Evo happens with a creak, because in Evo he remembered everything by heart. After installing the bare system, you need to deploy useful packages, as well as modify them slightly, in order to proceed to the layout and programming. However, the default installed packages, with all their flexibility, do not always help - in particular, to solve the problem of alternative marking of menu lines.
Gentleman's MODx Revolution Pack
- Ace - highlighting source code editor
- Batcher - replacement of DocManager from Evo for conducting mass operations on documents (change templates, etc.)
- Breadcrumbs - standard bread crumbs
- getPage - for page navigation in getResources
- getResources - Ditto replacement for document output
- GoogleSiteMap - a snippet for creating sitemap.xml
- phpThumbOf - for automatically resizing images and not only (for example, watermarking)
- SimpleSearch - Site Search
- tagLister - tvTagCloud replacement from Evo for working with documents from TV under tags
- TinyMCE - visual editor for documents
- translit - module for automatic generation of transliterated from Russian CNC aliases
- Wayfinder - menu generator
Squares in SimpleSearch Results
If SimpleSearch, when searching in Russian, shows “squares” in the search results, or rather diamonds, of incorrect encoding (as happened on my Masterhost hosting), then you need to modify the /core/components/simplesearch/model/simplesearch/simplesearch.class file. php and comment out line 177 (
source ) - after that, everything is looked for normally.
// if (! empty ($ str)) $ this-> searchString = strip_tags ($ this-> modx-> sanitizeString ($ str));
Alternative Wayfinder menu markup with classes for even and odd lines
Sometimes you want to make a vertical menu with alternating line colors. Wayfiner does not allow to do this by standard means - there are three possible solutions:
- use getResources - badly affects productivity, flexibility is lost
- write your snippet - lazy :)
- use jQuery is fast, but it's cheating :)
- set CSS properties for classes of strings l1, l3, l5, l7, etc. and l2, l4, l6, etc. - not scalable and clogs CSS
But since I am very lazy, we go on the search, google for a long time in various combinations of the words modx, revolution, wayfinder, odd, even, alternate and finally find
the forum thread and the
ticket in the wishlist on github two years ago.
')
After a long search, a
ready-made solution was found that works successfully (at the time of this writing, version of Wayfiner 2.3.3)
In order not to follow the long and tedious instructions, download the modified Wayfinder source code for MODx Revolution
wayfinder-revo-alternate-mod.zip and make the following changes to the snippet:
after
'self' => isset ($ selfClass)? $ selfClass: '',
'weblink' => isset ($ webLinkClass)? $ webLinkClass: ''
add
, 'odd' => isset ($ oddClass)? $ oddClass: ''
to succeed
'self' => isset ($ selfClass)? $ selfClass: '',
'weblink' => isset ($ webLinkClass)? $ webLinkClass: '',
'odd' => isset ($ oddClass)? $ oddClass: ''
Now you can call Wayfiner with the required class, for example
[[Wayfinder?
& startId = `2`
& where = `[{" template:! = ":" 2 "}]`
& outerClass = `leftnav`
& oddClass = `odd`
& displayStart = `1`
& startItemTpl = `tplCatalogCaption`
]]
useful links
I regularly use the following sections of the documentation