The following warnings occurred:
Warning [2] Undefined array key "threadviews_countguests" - Line: 745 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 745 errorHandler->error_callback
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
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 916 build_postbit
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
/inc/functions_post.php 861 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 46 - File: showthread.php(1650) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1650) : eval()'d code 46 errorHandler->error_callback
/showthread.php 1650 eval




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add new page: prepopulate fields from http get parameters
#3
ccagle8 Wrote:I see what you are trying to do here, but why is your plugin creating a new page?

For the I18N plugin I have a page similar to the pages page, but with multiple columns, one for each language (e.g. first column is default language - en, 2nd is german - de, 3rd is french - fr). If there is e.g. no german page, the column will contain an add-link to add a page in this language, prepopulating:
  • title = title of default page + ' (de)'
  • slug = slug of default page + .'_de' (this is how the language is determined)
  • ...

Similarly, as each content in a CMS should be handled the same, a good news plugin should store news as normal pages (in order to be searchable by a search plugin, ...), this news plugin would create a prepopulated page, when the user clicks the "Add news" link:
  • slug = 'news_' + date (yyyyMMdd) + '_' + time (HHmm)
  • tags = '_news' (to identify news in a search plugin)
  • ...

Currently the only way to prepopulate the metadata for a page without patching GetSimple is to add javascript code during the 'edit-extras' trigger, which will then fill the fields appropriately (implemented in I18N plugin).
However this is quite ugly.

P.S.: I use this javascript to modify the parent and priority selects, too (best try the I18N plugin to see how a better parent and menu position management can look like).
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply


Messages In This Thread
Add new page: prepopulate fields from http get parameters - by mvlcek - 2011-02-08, 06:55:50



Users browsing this thread: 1 Guest(s)