[[getRelated? &fields=`pagetitle:3,introtext:2` &hideContainers=`1` &limit=`5` &tplOuter=`newsTplRelatedNews` &tplRow=`newsTplRelatedNewsRow` ]]
Resource Query:
SELECT `id`, `pagetitle`, `longtitle`, `introtext` FROM `modx_site_content` AS `modResource` WHERE ( ( LOWER(`modResource`.`pagetitle`) LIKE '%��%' OR LOWER(`modResource`.`pagetitle`) LIKE '%��������������%' OR LOWER(`modResource`.`pagetitle`) LIKE '%������%' OR LOWER(`modResource`.`pagetitle`) LIKE '%������%' OR LOWER(`modResource`.`pagetitle`) LIKE '%�%' OR LOWER(`modResource`.`pagetitle`) LIKE '%���������1%' OR LOWER(`modResource`.`pagetitle`) LIKE '%��%' OR LOWER(`modResource`.`pagetitle`) LIKE '%������%' OR LOWER(`modResource`.`pagetitle`) LIKE '%����������%' OR LOWER(`modResource`.`pagetitle`) LIKE '%������,%' OR LOWER(`modResource`.`pagetitle`) LIKE '%�������������%' OR LOWER(`modResource`.`pagetitle`) LIKE '%������%' OR LOWER(`modResource`.`pagetitle`) LIKE '%����������%' OR LOWER(`modResource`.`pagetitle`) LIKE '%������%' OR LOWER(`modResource`.`pagetitle`) LIKE '%�����������%' OR LOWER(`modResource`.`pagetitle`) LIKE '%������,%' OR LOWER(`modResource`.`pagetitle`) LIKE '%�����%' OR LOWER(`modResource`.`pagetitle`) LIKE '%��%' OR LOWER(`modResource`.`pagetitle`) LIKE '%��������%' OR LOWER(`modResource`.`pagetitle`) LIKE '%�������������%' OR LOWER(`modResource`.`pagetitle`) LIKE '%�������%' OR LOWER(`modResource`.`pagetitle`) LIKE '%�%' OR LOWER(`modResource`.`pagetitle`) LIKE '%�����%' OR LOWER(`modResource`.`pagetitle`) LIKE '%������.%' OR LOWER(`modResource`.`introtext`) LIKE '%��%' OR LOWER(`modResource`.`introtext`) LIKE '%��������������%' OR LOWER(`modResource`.`introtext`) LIKE '%������%' OR LOWER(`modResource`.`introtext`) LIKE '%������%' OR LOWER(`modResource`.`introtext`) LIKE '%�%' OR LOWER(`modResource`.`introtext`) LIKE '%���������1%' OR LOWER(`modResource`.`introtext`) LIKE '%��%' OR LOWER(`modResource`.`introtext`) LIKE '%������%' OR LOWER(`modResource`.`introtext`) LIKE '%����������%' OR LOWER(`modResource`.`introtext`) LIKE '%������,%' OR LOWER(`modResource`.`introtext`) LIKE '%�������������%' OR LOWER(`modResource`.`introtext`) LIKE '%������%' OR LOWER(`modResource`.`introtext`) LIKE '%����������%' OR LOWER(`modResource`.`introtext`) LIKE '%������%' OR LOWER(`modResource`.`introtext`) LIKE '%�����������%' OR LOWER(`modResource`.`introtext`) LIKE '%������,%' OR LOWER(`modResource`.`introtext`) LIKE '%�����%' OR LOWER(`modResource`.`introtext`) LIKE '%��%' OR LOWER(`modResource`.`introtext`) LIKE '%��������%' OR LOWER(`modResource`.`introtext`) LIKE '%�������������%' OR LOWER(`modResource`.`introtext`) LIKE '%�������%' OR LOWER(`modResource`.`introtext`) LIKE '%�%' OR LOWER(`modResource`.`introtext`) LIKE '%�����%' OR LOWER(`modResource`.`introtext`) LIKE '%������.%' ) AND ( `modResource`.`id` != 190 AND `modResource`.`context_key` IN ('web') ) AND `modResource`.`id` NOT IN (0) AND `modResource`.`deleted` = 0 AND `modResource`.`published` = 1 AND `modResource`.`isfolder` = 0 ) ORDER BY createdon desc LIMIT 125
Config:array(30) { ["base_bath"]=> string(52) "C:/xampp/htdocs/myportal/core/components/getrelated/" ["core_path"]=> string(52) "C:/xampp/htdocs/myportal/core/components/getrelated/" ["model_path"]=> string(58) "C:/xampp/htdocs/myportal/core/components/getrelated/model/" ["elements_path"]=> string(61) "C:/xampp/htdocs/myportal/core/components/getrelated/elements/" ["resource"]=> string(7) "current" ["fields"]=> string(23) "pagetitle:3,introtext:2" ["returnFields"]=> array(3) { [0]=> string(9) "pagetitle" [1]=> string(9) "longtitle" [2]=> string(9) "introtext" } ["returnTVs"]=> array(0) { } ["parents"]=> array(0) { } ["parentsDepth"]=> int(10) ["contexts"]=> array(1) { [0]=> string(3) "web" } ["includeDeleted"]=> string(0) "" ["includeUnpublished"]=> string(0) "" ["includeHidden"]=> bool(true) ["exclude"]=> array(1) { [0]=> string(0) "" } ["hideContainers"]=> string(1) "1" ["limit"]=> string(1) "5" ["fieldSample"]=> int(125) ["fieldSort"]=> string(9) "createdon" ["fieldSortDir"]=> string(4) "desc" ["tvSample"]=> int(125) ["tvSort"]=> string(9) "createdon" ["tvSortDir"]=> string(4) "desc" ["tplOuter"]=> string(18) "newsTplRelatedNews" ["tplRow"]=> string(21) "newsTplRelatedNewsRow" ["noResults"]=> string(23) "No related pages found." ["toPlaceholder"]=> string(0) "" ["rowSeparator"]=> string(1) " " ["defaultWeight"]=> int(5) ["debug"]=> string(1) "1" }
Fields:array(2) { [0]=> string(9) "pagetitle" [1]=> string(9) "introtext" }
TVs:array(0) { }
Match Data:array(24) { [0]=> string(4) "��" [1]=> string(28) "��������������" [2]=> string(12) "������" [3]=> string(12) "������" [4]=> string(2) "�" [5]=> string(19) "���������1" [6]=> string(4) "��" [7]=> string(12) "������" [8]=> string(20) "����������" [9]=> string(13) "������," [10]=> string(26) "�������������" [11]=> string(12) "������" [12]=> string(20) "����������" [13]=> string(12) "������" [14]=> string(22) "�����������" [15]=> string(13) "������," [16]=> string(10) "�����" [17]=> string(4) "��" [18]=> string(16) "��������" [19]=> string(26) "�������������" [20]=> string(14) "�������" [21]=> string(2) "�" [22]=> string(10) "�����" [23]=> string(13) "������." }
All Related Resources:array(0) { } No related pages found. $v = preg_replace('/[^А-Яа-яЁёa-z0-9\s]/', '', mb_strtolower($v));
tv = addTag (input type is auto-tag) Output type of tv = , Used this tag and got the result below: [[!getRelated? &fields=`tv.addTag` &tvDelimiter=`,` &debug=`1` &limit=`5`]]
[[!getRelated? &fields=`tv.addTag` &debug=`1` &limit=`5`]]
Config:array(31) { ["base_bath"]=> string(44) "/home/web/bakkery/core/components/getrelated/" ["core_path"]=> string(44) "/home/web/bakkery/core/components/getrelated/" ["model_path"]=> string(50) "/home/web/bakkery/core/components/getrelated/model/" ["elements_path"]=> string(53) "/home/web/bakkery/core/components/getrelated/elements/" ["resource"]=> string(7) "current" ["fields"]=> string(10) "tv.addTag" ["returnFields"]=> array(3) { [0]=> string(9) "pagetitle" [1]=> string(9) "longtitle" [2]=> string(9) "introtext" } ["returnTVs"]=> array(0) { } ["parents"]=> array(0) { } ["parentsDepth"]=> int(10) ["contexts"]=> array(1) { [0]=> string(3) "web" } ["includeDeleted"]=> string(0) "" ["includeUnpublished"]=> string(0) "" ["includeHidden"]=> bool(true) ["exclude"]=> array(1) { [0]=> string(0) "" } ["hideContainers"]=> string(0) "" ["limit"]=> int(3) ["fieldSample"]=> int(125) ["fieldSort"]=> string(9) "createdon" ["fieldSortDir"]=> string(4) "desc" ["tvSample"]=> int(125) ["tvSort"]=> string(9) "createdon" ["tvSortDir"]=> string(4) "desc" ["tplOuter"]=> string(12) "relatedOuter" ["tplRow"]=> string(10) "relatedRow" ["noResults"]=> string(23) "No related pages found." ["toPlaceholder"]=> string(0) "" ["rowSeparator"]=> string(1) " " ["defaultWeight"]=> int(5) ["debug"]=> string(1) "0" ["tvDelimiter"]=> string(1) "," }
Fields:array(0) { }
TVs:array(1) { [0]=> string(7) "addTag" }
Match Data:array(4) { [0]=> string(6) "tomato" [1]=> string(9) "spagettie" [2]=> string(4) "milk" [3]=> string(5) "cream" }
All Related Resources:array(12) { [9]=> array(7) { ["rank"]=> int(10) ["id"]=> int(428) ["tvid"]=> string(4) "5269" ["pagetitle"]=> string(4) "Cake" ["longtitle"]=> string(0) "" ["introtext"]=> string(0) "" ["addTag"]=> string(27) "Sugar,Strawberry,Milk,Cream" } [0]=> array(7) { ["rank"]=> int(10) ["id"]=> int(428) ["tvid"]=> string(4) "5269" ["pagetitle"]=> string(4) "Cake" ["longtitle"]=> string(0) "" ["introtext"]=> string(0) "" ["addTag"]=> string(27) "Sugar,Strawberry,Milk,Cream" } [2]=> array(7) { ["rank"]=> int(10) ["id"]=> int(428) ["tvid"]=> string(4) "5269" ["pagetitle"]=> string(4) "Cake" ["longtitle"]=> string(0) "" ["introtext"]=> string(0) "" ["addTag"]=> string(27) "Sugar,Strawberry,Milk,Cream" } [1]=> array(7) { ["rank"]=> int(10) ["id"]=> int(428) ["tvid"]=> string(4) "5269" ["pagetitle"]=> string(4) "Cake" ["longtitle"]=> string(0) "" ["introtext"]=> string(0) "" ["addTag"]=> string(27) "Sugar,Strawberry,Milk,Cream" } [10]=> array(7) { ["rank"]=> int(5) ["id"]=> int(259) ["tvid"]=> string(4) "5347" ["pagetitle"]=> string(14) "Chocolate milk" ["longtitle"]=> string(0) "" ["introtext"]=> string(0) "" ["addTag"]=> string(10) "Milk,Italy" } [5]=> array(7) { ["rank"]=> int(5) ["id"]=> int(259) ["tvid"]=> string(4) "5347" ["pagetitle"]=> string(14) "Chocolate milk" ["longtitle"]=> string(0) "" ["introtext"]=> string(0) "" ["addTag"]=> string(10) "Milk,Italy" } [4]=> array(7) { ["rank"]=> int(5) ["id"]=> int(259) ["tvid"]=> string(4) "5347" ["pagetitle"]=> string(14) "Chocolate milk" ["longtitle"]=> string(0) "" ["introtext"]=> string(0) "" ["addTag"]=> string(10) "Milk,Italy" } [3]=> array(7) { ["rank"]=> int(5) ["id"]=> int(259) ["tvid"]=> string(4) "5347" ["pagetitle"]=> string(14) "Chocolate milk" ["longtitle"]=> string(0) "" ["introtext"]=> string(0) "" ["addTag"]=> string(10) "Milk,Italy" } [11]=> array(7) { ["rank"]=> int(5) ["id"]=> int(223) ["tvid"]=> string(4) "5272" ["pagetitle"]=> string(5) "Pizza" ["longtitle"]=> string(0) "" ["introtext"]=> string(0) "" ["addTag"]=> string(19) "Tomato,Cheese,Italy" } [8]=> array(7) { ["rank"]=> int(5) ["id"]=> int(223) ["tvid"]=> string(4) "5272" ["pagetitle"]=> string(5) "Pizza" ["longtitle"]=> string(0) "" ["introtext"]=> string(0) "" ["addTag"]=> string(19) "Tomato,Cheese,Italy" } [7]=> array(7) { ["rank"]=> int(5) ["id"]=> int(223) ["tvid"]=> string(4) "5272" ["pagetitle"]=> string(5) "Pizza" ["longtitle"]=> string(0) "" ["introtext"]=> string(0) "" ["addTag"]=> string(19) "Tomato,Cheese,Italy" } [6]=> array(7) { ["rank"]=> int(5) ["id"]=> int(223) ["tvid"]=> string(4) "5272" ["pagetitle"]=> string(5) "Pizza" ["longtitle"]=> string(0) "" ["introtext"]=> string(0) "" ["addTag"]=> string(19) "Tomato,Cheese,Italy" } }