The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
|
snippets for php code? - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: Scripts & Components (http://get-simple.info/forums/forumdisplay.php?fid=11) +--- Thread: snippets for php code? (/showthread.php?tid=4551) |
snippets for php code? - remort - 2013-03-28 hi people. i just need a children list. it should work like list of childs that shown in a content area of a parent page if it has any children. may be it is already done, but i didn't find. all the existing plugins are about menus but not about children list. may be it is possible to create children-only list with i18n menus, but... so i've created my own php-snippet. and i want to place it on certain blocks of my template, or in a age conent area. existing components system is good but it is only for html code snippets. so the question is: where i can save my php-snippets and easily connect them to certain pages. now i just wrote this code in first lines of my template to colect children in a variable special_content. i want to place it to a snippet somehow: Code: $parents=array('izdeliya','sertifikaty'); it's probably could be done with i18n-menu plugin, but anyway. ehat if i have some code and i want it to be a pluggable chunk. like in mod-x evolution. RE: snippets for php code? - shawn_a - 2013-03-28 "existing components system is good but it is only for html code snippets." components are php RE: snippets for php code? - eatons - 2013-03-28 I think this should work although i have not really tried it: Turn your snippet into a function and place it in the functions.php file in your theme directory, then make a component whose only job is to call the function. OBTW ... What does "Warning Level: 0%" mean in my profile, and is it something I should be concerned about? RE: snippets for php code? - shawn_a - 2013-03-28 Or a function in components just use php tags. |