2011-02-08, 06:55:50
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).