Closed (fixed)
Project:
Node Embed
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Mar 2012 at 14:56 UTC
Updated:
11 Sep 2015 at 12:02 UTC
Jump to comment: Most recent
Comments
Comment #1
lance.gliser commentedI'm trying to imagine some system for using the different view modes, without reading it from the parameters (existing syntax, or a new one), and having trouble. Even if we were to create some settings page that let you change the embed type for matched nodes, that's still to global. We'd miss out on the granular control to embed a full piece of content (video node?) and a previews of pieces of content (products related to the video?).
If we just wanted to leave the syntax alone, we could create a new field (tab?) on the content that searched for embeds, and allowed you to specify their mode separately. But, there's disadvantages to that.
- It would be much harder to import
- The separation might confuse users
- It's an extra step
- This is an input filter, not a node filter. Why limit the extra options to just nodes/entities?
I'll keep thinking.
Comment #2
sreynen commentedA few possible approaches I've considered on this:
1) Just make the view mode another parameter with special functionality. This is essentially what you did, and it's certainly a simple solution. My only concern here is it mixes what parameters do. Most parameters do nothing unless you act on them in the theme layer. This parameter would do things automatically, which might be confusing or a gateway to a lot of requests for pre-defined parameters. Or maybe not.
2) Make the view mode a different type of parameter, with a different syntax. This would make a clear distinction, but has many of the same problems in #1, and would make the syntax more complicated.
3) Make individual embeds field-able entities and make a view mode reference field. This would provide an interface for setting all types of parameters beyond just text, but it feels like over-engineering.
4) Select view modes for embedded nodes as part of the node edit form somewhere. This seems likely to be too detached from the process of embedding.
I'm currently leaning toward #1, but would like to give it some more time.
Comment #3
lance.gliser commentedThinking about number one, I'm not sure it's going to lead to indefinite scope creep of parameters, and it should not be too hard to understand. Look back at my original expanded embed syntax explanation code. I outline every possible node_view type active in the system, so it should be immediately relevant.
My entire reason for swapping view modes, was to remove loads of work from the theme layer, into the configuration layers. The majority of answers to feature requests would be create a node view type (using the other module I suggested), and set it up the way you want. Side bonus, the additional node_views can be handled by modules, since it's not waiting until the theme layer fires.
Other than the common (and embed specific) alignment attributes, can anyone think of something that would not be more eloquently by the embed specific settings?
Things that might be requested of the top of my head:
- Classes: Targetable classes based on node_view are available, maybe an extra class for a specific embed. (Embed: blue, vs embed green)? Seems like a theme specific issue.
- "Links" for node. Handled by view types?
It seems like we need an inventory of what other people have used parameters for?
Comment #4
lance.gliser commentedA pretty fair chunk of time has passed since this was opened back on March 10th, and no one seems to be chiming in.
I'm about to have a project go live, and need to document how they should format things to embed one view of a node vs another. Can we perhaps come to an agreement about this by merging parts of my previous with the project? I still think the nid, mode, and alignment will cover 90% of most users needs, and the rest falling to the theme layer does make a lot of sense.
Comment #5
sreynen commentedYep, apparently no one cares how this works. :)
I just committed an implementation of #1 with a parameter named "view_mode" to switch the view mode.
Comment #6
lance.gliser commentedCovers 80% of my needs! Happy to see it going into the module.
I may open up another issue later on, to help you get the code from my original issue that displays all possible view_modes on the site for end users to figure things out a bit more easily.
I'll see if I can figure out how to have the theme layer react to the embed parameter's so I can still have an 'align' parameter for my site's authors in the next week. If you have preexisting code for it, I'd love to see it. If not, maybe it's a strong example that we should get in the docs once I figure it out.
Comment #8
couloir007 commentedWas this ever implemented? If so, what is the syntax?
For now I'm doing this:
Comment #9
couloir007 commentedI updated to this:
Comment #10
sreynen commentedYes, this was implemented. The syntax is
[[nid:12345 mode=teaser]]Comment #11
thomjjames commentedHi,
Using this module now found the following worked for setting the view_mode:
[[nid:NID view_mode=VIEW_MODE]]ie.
[[nid:123 view_mode=teaser]]Hopefully that's useful to someone else
Tom