Overview
The Display Suite Custom Node Layouts is a Drupal 7 module extends the 'View mode per node' functionality provided by the Display Suite Module (via the included DS Extras submodule), allowing individual nodes to use a customized instance of the view mode layouts available for the content type.

This module creates a 'Manage Layout' tab for nodes of any content types enabled on the module's configuration page. Now, we just define all our 'parent' custom view modes and layouts in the standard Display Suite way, assign one of them to the node (in the 'Display settings' fieldset/tab on the node's edit form), and navigate to the 'Manage Layout' tab to create and apply a customized 'child' view mode/layout for this node.

All administration is then handled at the node level, and leaves the Display Suite view mode listings uncluttered, as they only need to list the 'parent' view modes.

Project Page
http://drupal.org/sandbox/clint.beacock/1627750

Git Repo
git clone http://git.drupal.org/sandbox/clint.beacock/1627750.git display_suite_custom_node_layouts

CommentFileSizeAuthor
#2 codesniffer.txt9.15 KBKrisBulman

Comments

KrisBulman’s picture

Have you approached DS about adding this into their module? Or is there other reasoning for having it in it's own module.

Manual Review:

As soon as I install the module along with Display Suite & Extras, I get the following error and it appears on most of the admin overlays

Notice: Undefined variable: results in ds_custom_node_layouts_get_custom_view_mode_names() (line 461 of /sites/all/modules/display_suite_custom_node_layouts/ds_custom_node_layouts.module).
Notice: Undefined variable: results in ds_custom_node_layouts_get_custom_view_mode_names() (line 461 of /sites/all/modules/display_suite_custom_node_layouts/ds_custom_node_layouts.module).

While not very familiar with DS, I attempted to follow your instructions regardless of the errors above.. all seemed to work, except I was unable to find the "'Reset Layout" button when attempting to reset the previous config.

A local run of coder gives the following message:

ds_custom_node_layouts.module

Line 185: Potential problem: drupal_set_message() only accepts filtered text, be sure all !placeholders for $variables in t() are fully sanitized using check_plain(), filter_xss() or similar. (Drupal Docs)
      drupal_set_message(t("You must enable a view mode other than 'Default' in the 'Display settings' tab on the !link for this node in order to manage the layout", array('!link' => $link)), 'warning');
Line 190: Potential problem: drupal_set_message() only accepts filtered text, be sure all !placeholders for $variables in t() are fully sanitized using check_plain(), filter_xss() or similar. (Drupal Docs)
      drupal_set_message(t("You must enable the 'View mode per node' option in the 'Other' tab on the !link in order to manage node layouts", array('!link' => $link)), 'warning');

Here is the online PAReview of your project, with the codesniffer attachment:

Review of the 7.x-1.x branch:

./ds_custom_node_layouts.module: all functions should be prefixed with your module/theme name to avoid name clashes. See http://drupal.org/node/318#naming

function _create_view_mode_object($nid, $view_mode, $core = FALSE) {
Drupal Code Sniffer has found some issues with your code (please check the Drupal coding standards). See attachment.

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

KrisBulman’s picture

StatusFileSize
new9.15 KB

original attachement attached for online review

KrisBulman’s picture

Status: Needs review » Needs work
clint.beacock’s picture

Thanks for taking the time to review this for me, Kris. I truly appreciate it.

I'm facing a crazy week, but I'll implement/address your suggestions at the earliest opportunity.

Again, thanks a tonne.

klausi’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application.

klausi’s picture

Issue summary: View changes

Small edit of git repo formatting