The following warnings occurred: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
|
Conditional tags - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: Developer Discussions (http://get-simple.info/forums/forumdisplay.php?fid=8) +--- Thread: Conditional tags (/showthread.php?tid=1146) |
Conditional tags - Live - 2010-11-27 Hello! Im new to GS and i was searching some conditional tags! for example IF HOME, or IF INDEX, if page XXXX do this..... are something similar available? thanks. Conditional tags - Live - 2010-11-27 I think i can use template! Conditional tags - yojoe - 2010-11-27 you can base on page names (use their slugs), or their parents and serve the content you want Conditional tags - Carlos - 2010-11-27 @Live Insert something like this in your template.php Code: <?php Conditional tags - Carlos - 2010-11-27 yojoe Wrote:you can base on page names (use their slugs), or their parents and serve the content you want About checking parents... I hadn't realised there are return_parent() and get_parent() functions... they're not listed in the docs http://get-simple.info/docs/theme-codex/ Conditional tags - yojoe - 2010-11-27 look at the functions located in common or theme functions files within admin/inc directory with slugs and parents you can create conditionals you need. The problem is with automating it seamlessly, when a user changes page name or create a new one. You could base on a prefix string in page name. Conditional tags - Connie - 2011-04-28 Carlos Wrote:About checking parents... I hadn't realised there are return_parent() and get_parent() functions... they're not listed in the docs http://get-simple.info/docs/theme-codex/ I added these 2 tags to the WIKI, but I ask to add a correct explanation, as I am not so firm in that! Conditional tags - hameau - 2011-04-28 Connie Wrote:I added these 2 tags to the WIKI, but I ask to add a correct explanation, as I am not so firm in that!This is an old thread and return_parent() was depreciated for v3.0. There is phpdoc format help for get_parent() in admin/inc/theme_functions.php: Code: /** Conditional tags - Connie - 2011-04-28 Thanks, Nick I took off that one tag and added the explanation to the other one Thanks! Connie Conditional tags - hameau - 2011-04-28 Now that the source is all documented with phpdoc comments (V3.0+), it would be really nice to have phpDocumentor produce something – always up-to-date – for the wiki ... There's a nice example at, ahem some other cms site. Conditional tags - RobA - 2011-04-29 hameau Wrote:This is an old thread and return_parent() was depreciated for v3.0. Question for devs- could depreciated functions please be changed to generate a warning message when site is is in debug mode? -Rob A> Conditional tags - [/root.] - 2011-08-31 Version 3.1 Beta r525 Code: <?php if (get_parent()=='slug'){ ?> Code: <?php if (return_parent()=='slug'){ ?> works, even it's a depreciated function. Conditional tags - Carlos - 2011-08-31 By default get_parent() echoes the parent but does not return it. The correct way would be: Code: <?php if (get_parent(false)=='slug'){ ?> |