The following warnings occurred:
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message



GetSimple Support Forum
dynpages, components and custom fileds not resolving my porblems - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: dynpages, components and custom fileds not resolving my porblems (/showthread.php?tid=3433)



dynpages, components and custom fileds not resolving my porblems - j0lly - 2012-08-13

Hi, at first i want to say that Getsimple is really amazing, learing how to use it is really simple and i'm appreciating how easy it is!
I have encountered a little problem: i have a custom template with 2 variants (2 and 3 columns) to apply to my pages, and in the columns i'm using dynamic components like i18n menus and other php stuff. i need to set this components per-page but i don't want to have 20+ template to insert the components. i've tried custom fileds but seems not possible to pass php variables throw that (only text) neather using dynpages plugin to insert components.
So, how can i manage to edit the sidebars contents per-page without have to edit and greate a template for every page i want a differet component to attach?
i can't figure out this things but i'm sure you can point me to the right direction!
thanks


dynpages, components and custom fileds not resolving my porblems - mvlcek - 2012-08-13

j0lly Wrote:Hi, at first i want to say that Getsimple is really amazing, learing how to use it is really simple and i'm appreciating how easy it is!
I have encountered a little problem: i have a custom template with 2 variants (2 and 3 columns) to apply to my pages, and in the columns i'm using dynamic components like i18n menus and other php stuff. i need to set this components per-page but i don't want to have 20+ template to insert the components. i've tried custom fileds but seems not possible to pass php variables throw that (only text) neather using dynpages plugin to insert components.
So, how can i manage to edit the sidebars contents per-page without have to edit and greate a template for every page i want a differet component to attach?
i can't figure out this things but i'm sure you can point me to the right direction!
thanks

One way is to select a component based on the current page slug (and a default sidebar component if no page specific component exists), like
Code:
<?php
  if (return_i18n_component('sidebar-'.return_page_slug())) {
    get_i18n_component('sidebar-'.return_page_slug());
  } else {
    get_i18n_component('sidebar');
  }
?>
Just create a component sidebar-xxx for every page xxx that should not have the standard sidebar component sidebar.

Another way would be to to have a custom field named sidebar - preferably a dropdown field with all possible sidebar component names (or a text field, which is more error prone) - and include the selected sidebar component in the template:
Code:
<?php get_i18n_component(return_custom_field('sidebar')); ?>

If the sidebar is different for every page, you can also create a custom WYSIWYG field sidebar and edit it on every page, then include it in the template:
Code:
<?php get_custom_field('sidebar'); ?>

Edit: missing ) added in first code example (@j0lly).


dynpages, components and custom fileds not resolving my porblems - j0lly - 2012-08-13

the first method looks promising so i'll give a try later this night... i'll report any success/problem Smile thanks a lot and thanks for your great plugins!


dynpages, components and custom fileds not resolving my porblems - j0lly - 2012-08-14

Ok, i gave a quick try to the methods: the first didn't work couse there's a Typo on the test statament ( there's a ')' missing ). After that everything work perfect!

Brilliant! thanks for all your help!

I think this can be very useful for beginners like me having first approaches to getsimple and php... you could implement that in the examples or wiki of your plugin, really.

Anyway, mind the typo

cheers


dynpages, components and custom fileds not resolving my porblems - sal - 2012-08-14

Using a custom field (requires I18N Custom Fields plugin) is a better way to go about it as you get a WYSIWYG editor and the sidebar content is easier to find and edit in the backend. You can then fall back onto a default sidebar component if you wish.
Code:
<?php

if (return_custom_field('sidebar');) {
  get_custom_field('sidebar');
}
else {
  get_i18n_component('sidebar');
}

?>



dynpages, components and custom fileds not resolving my porblems - mvlcek - 2012-08-14

j0lly Wrote:I think this can be very useful for beginners like me having first approaches to getsimple and php... you could implement that in the examples or wiki of your plugin, really.

Documented at http://mvlcek.bplaced.net/how-to/sidebars/.


dynpages, components and custom fileds not resolving my porblems - j0lly - 2012-08-14

mvlcek Wrote:
j0lly Wrote:I think this can be very useful for beginners like me having first approaches to getsimple and php... you could implement that in the examples or wiki of your plugin, really.

Documented at http://mvlcek.bplaced.net/how-to/sidebars/.

Well, perfect so!
thanks so much, now i have my personalized sidebars!