Alternative tagging in Wayfiner, squares in SimpleSearch and useful links for Modx Revolution
A repost from my blog - maybe someone will come in handy. I
started doing new projects on Revo - the transition from Evo happens with a scratch, because Evo remembered everything by heart. After installing the bare system, you need to deploy useful packages, as well as modify them a bit, to begin layout and programming. However, the default installed packages with all their flexibility do not always help - in particular, solve the problem of alternative markup of menu bars.
If SimpleSearch, when searching in Russian, displays “squares”, or rather rhombuses, in the wrong encoding in the search results (as happened on my Masterhost hosting), then it is necessary 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.
Sometimes you want to make a vertical menu with alternating coloring of lines. Wayfiner does not allow this to be done by standard means - there are three solutions:
But since I am very lazy, we go in search, google for a long time in various combinations of the word modx, revolution, wayfinder, odd, even, alternate and finally we find the topic on the forum 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 writing the article, Wayfiner version 2.3.3)
In order not to follow a long and boring instruction, download the modified Wayfinder sources for MODx Revolution wayfinder-revo-alternate-mod.zip and make the following changes in snippet:
after
add
to get it
Now you can call Wayfiner with the necessary class, for example
I regularly use the following sections of the documentation
started doing new projects on Revo - the transition from Evo happens with a scratch, because Evo remembered everything by heart. After installing the bare system, you need to deploy useful packages, as well as modify them a bit, to begin layout and programming. However, the default installed packages with all their flexibility do not always help - in particular, solve the problem of alternative markup of menu bars.
Gentleman's set of packages for MODx Revolution
- Ace - source editor editor highlight
- Batcher - replacing DocManager from Evo for conducting bulk operations on documents (change templates, etc.)
- Breadcrumbs - Standard Breadcrumbs
- getPage - for page navigation in getResources
- getResources - Ditto replacement for document output
- GoogleSiteMap - snippet for creating sitemap.xml
- phpThumbOf - for automatically resizing images and not only (for example, apply watermarks)
- SimpleSearch - Site Search
- tagLister - replacing tvTagCloud from Evo for working with documents with TV for tags
- TinyMCE - visual document editor
- translit - module for the automatic generation of CNC transliterated from Russian aliases
- Wayfinder - menu generator
Squares in SimpleSearch Results
If SimpleSearch, when searching in Russian, displays “squares”, or rather rhombuses, in the wrong encoding in the search results (as happened on my Masterhost hosting), then it is necessary 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 for even and odd lines
Sometimes you want to make a vertical menu with alternating coloring of lines. Wayfiner does not allow this to be done by standard means - there are three solutions:
- use getResources - poorly affects performance, flexibility is lost
- write your snippet is lazy :)
- use jQuery - fast, but it's cheating :)
- prescribe CSS properties for line classes l1, l3, l5, l7, etc. and l2, l4, l6, etc. - not scalable and clogs CSS
But since I am very lazy, we go in search, google for a long time in various combinations of the word modx, revolution, wayfinder, odd, even, alternate and finally we find the topic on the forum 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 writing the article, Wayfiner version 2.3.3)
In order not to follow a long and boring instruction, download the modified Wayfinder sources for MODx Revolution wayfinder-revo-alternate-mod.zip and make the following changes in snippet:
after
'self' => isset ($ selfClass)? $ selfClass: '',
'weblink' => isset ($ webLinkClass)? $ webLinkClass: ''
add
, 'odd' => isset ($ oddClass)? $ oddClass: ''
to get it
'self' => isset ($ selfClass)? $ selfClass: '',
'weblink' => isset ($ webLinkClass)? $ webLinkClass: '',
'odd' => isset ($ oddClass)? $ oddClass: ''
Now you can call Wayfiner with the necessary 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