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?
Comment | File | Size | Author |
---|---|---|---|
#5 | 2235547-view-mode-switcher-5.patch | 11.42 KB | Hjarnmastara |
Comments
Comment #1
aspilicious CreditAttribution: aspilicious commentedNeeds a few words of extra docs on the settings page.
Comment #2
aspilicious CreditAttribution: aspilicious commentedComment #4
aspilicious CreditAttribution: aspilicious commentedSomeone is working on this. It would be awesome if he also could incorporate https://www.drupal.org/node/2236109
Comment #5
Hjarnmastara CreditAttribution: Hjarnmastara at Calibrate commentedReworked the switch view mode logic, uses the AJAX core functions rather than implementing own javascript logic.
Comment #6
aspilicious CreditAttribution: aspilicious commented1) 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!
Comment #7
aspilicious CreditAttribution: aspilicious commented