How about choosing which view mode to use for display? Just Teaser or Full is often not enough. I'm surprised there's no issue for this yet (or I couldn't find it?).

Instead of a checkbox, a dropdown with node view modes. Sounds simple enough =)

Comments

rudiedirkx’s picture

Status: Active » Needs review
StatusFileSize
new5.77 KB

And a patch.

Includes backward compat. (If 'teaser' was previously checked, the teaser view mode is now selected.)

katbailey’s picture

First of all - great feature request, and I too am surprised nobody else has asked for this yet :-P
And it is so nice to get a feature request that comes with a patch :-) However, your patch has been rolled against your entire codebase, not just against quicktabs - can you please reroll and I'll try to get this in asap.

mark trapp’s picture

Version: 7.x-3.3 » 7.x-3.x-dev
StatusFileSize
new2.3 KB

I was looking for this as well: re-rolled the patch to only include quicktabs. :)

jonhattan’s picture

Status: Needs review » Needs work

Basicly it works but lacks an upgrade path.

All existing quicktabs must be setted a value for the new view_mode option (teaser or full depending on the teaser option value).

Without that, two things happen to previously created quicktabs:

* it fails to render nodes in the correct view_mode.
* it raises a warning on edition form.

mark trapp’s picture

Status: Needs work » Needs review
StatusFileSize
new3.35 KB

The attached patch adds the upgrade path by converting the contents of the teaser value into view_mode: if it exists and is TRUE, view_mode is set to teaser. Otherwise, view_mode is set to full.

jonhattan’s picture

Status: Needs review » Reviewed & tested by the community

It works great

mark trapp’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.65 KB
new3.26 KB

I took another look at this and it still wasn't 100%. This new patch fixes a few things:

  • Code style issue on line 26
  • Removes backward compatibility stuff in QuickNodeContent::optionsForm now that there's an upgrade path
  • Sets tabs that do not have teaser set to TRUE to the default view mode instead of full.

Attached is a new patch plus an interdiff from the patch in #5.

jonhattan’s picture

I have no strong preference, just note that the default view mode for a node is full http://api.drupal.org/api/drupal/modules%21node%21node.module/function/n...

mark trapp’s picture

StatusFileSize
new1.6 KB
new3.23 KB

Hm, I was thinking you could change the default, but you're right: it's hard-coded for nodes. There's no standard way to define a default view mode for entities, so future-proofing the UI for an inevitable expansion to support entities doesn't make sense, either.

The attached patch sets the default back to full and removes the superfluous "Default" option in the view modes drop-down menu.

jonhattan’s picture

Status: Needs review » Reviewed & tested by the community

Thanks Mark!

jesss’s picture

The patch works for me. This is exactly the functionality I need but I'm wary of using a patched module on a production site -- can this be committed soon?

mark trapp’s picture

I was going through my local forks of contrib modules, checking to see if anything needs a reroll, and this patch still applies with latest HEAD. Is there anything that's preventing this patch from being committed?

interdruper’s picture

Patch #9 works OK and this feature is very useful for those who play with view modes.
IMHO, it should be committed to next -dev release.

kevincrafts’s picture

Worked for me.

ultimateboy’s picture

Status: Reviewed & tested by the community » Fixed
mark trapp’s picture

Awesome, thanks ultimateboy!

ultimateboy’s picture

Assigned: Unassigned » ultimateboy
Status: Fixed » Active

This change actually introduced a few problems in our tests. Re-opening for the time being, a patch is coming soon.

ultimateboy’s picture

Status: Active » Fixed
StatusFileSize
new3.14 KB

Well that was easier than I thought. I've pushed to 7.x-3.x.

http://drupalcode.org/project/quicktabs.git/commit/5f668d7d351bde3ef9db2...

Status: Fixed » Closed (fixed)

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