This is small - now I've found it... possibly just docs

Steps to reproduce.
* Edit a content type, add a new "View mode" ("Compact")
* Enable "View mode switcher" in DS Extras /admin/structure/ds/list/extras
* in both full view mode and compact view mode for the content type:
* * switch the layout to "Reset" - I *need* a DS layout active in order to :
* * move the "Switch view mode" field up into the content area to display
* * configure the widget to provide a link to the other view mode.

= Result:
The full page mode shows a link to the 'Compact' mode but the switch view mode link does nothing

= Solution:
Use "One Column" layout wrapper instead of "Reset"

= Explanation?
Looks like the javascript is unable to find the 'wrapper' element when using a "Reset" layout

Maybe this is just a documentation thing, it was certainly a gotcha.
The only reason I went for "reset" layout was because I didn't feel the need to use DS layouts at all on my default page, and "Reset" looked more lightweight than "One column".
Could we have a "default" layout instead? or bring the ds_view_mode_switcher into normal extra_fields management so we ca use it even when DS does not own the page?

CommentFileSizeAuthor
#5 2235547-view-mode-switcher-5.patch11.42 KBHjarnmastara
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

aspilicious’s picture

Assigned: Unassigned » bceyssens

Needs a few words of extra docs on the settings page.

aspilicious’s picture

Version: 7.x-2.6 » 8.x-2.x-dev
Status: Active » Patch (to be ported)

  • aspilicious committed 2d2d684 on 7.x-2.x
    Issue #2235547: "Switch view mode" fails when using the "Reset" layout
    
aspilicious’s picture

Someone is working on this. It would be awesome if he also could incorporate https://www.drupal.org/node/2236109

Hjarnmastara’s picture

Component: Documentation » Code
Status: Patch (to be ported) » Needs review
FileSize
11.42 KB

Reworked the switch view mode logic, uses the AJAX core functions rather than implementing own javascript logic.

aspilicious’s picture

1) Newline missing in routing file
2) @param docblocks are always directly after each other, no new line. The newline between @param and @return is ok.

Fixing these myself, THNX!

aspilicious’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.