Alex: Thank you for creating this valuable and time-saving module. At this point, the only improvement I can think of would be to make it possible for the user to specify the content of the Body field for each one of the new nodes created by the import process. Currently, all new nodes are empty, which is probably fine for many situations. But quite often, when clients ask me to build a new site, they do not yet have content for the non-front pages, and plan on adding content later, after they have launched the site. But they don't want a visitor to the site to land on a completely empty page, because it makes the site look broken. Clients much prefer when there is at least some indication that it is known that the page is incomplete, and will be completed in the near future. In all those situations, at a minimum I add some placeholder text, such as "<p>Coming soon...</p>".

I created a patch that implements the above functionality, and will upload it in a moment. I needed to create this issue to generate an issue number.

CommentFileSizeAuthor
#1 menu_import-body_field-1296312-1.patch5.32 KBmjross

Comments

mjross’s picture

StatusFileSize
new5.32 KB

The attached patch gives the module user the ability to set the initial content of the Body field for any new nodes created. The changes include:

  • Adding the Body field to the module's General Settings page (admin/structure/menu/import), as well as elsewhere in the code where needed.
  • The nodes created are now not necessarily empty (as they were before). To reflect this, I replaced the two strings "empty content" with "initial content" in menu_import_form_step1().
  • Similarly, in the help information, I updated "stub out an arrangement with empty nodes" with "new nodes containing initial content".
  • I made some minor improvements to the HTML tags in the construction of $output in menu_import_help(), so both paragraphs have P tags, and there are no tags in any t() calls.

The code has been tested with the latest versions of Drupal (currently 7.8) and the Menu Import module. But this is my first patch submitted to d.o, so please let me know if there are any problems with it. Thank you.

lex0r’s picture

Version: 7.x-1.1-beta2 » 7.x-1.1-rc2
Assigned: Unassigned » lex0r
Status: Needs review » Patch (to be ported)

Hi, Michael. Thank you for the patch! The use case you provided is quite probable for a typical module user, so I will definitely include your patch (probably slightly modified) and attribute authorship to you.

mjross’s picture

Thank you, Alex.

lex0r’s picture

Status: Patch (to be ported) » Closed (fixed)

Done in branch 7.x-1.x, and new RC3.