Is there a way to merge two or more fields using Display suite, like Views inline fields? What I mean is - if I have the fields "Author", "Publication date" and "Article series", then I would like to display them as "Author1 | 01-May-2012 | Learning series" etc.
Here's a list of possible approaches:
Code field: You can accomplish this with a custom code field in Display suite. A code fields supports usage of tokens and html. Additionally, you can use a Display Suite code filter to use php itself. More info found here: http://www.youtube.com/watch?v=mvFP16PJt4c
Use a Custom formatter: If you need more heavy processing you can utilize the custom field formatter module.
Preprocess Field: Additionally, you can access variables that are preprocessed via a "preprocess field". A preprocess field will print out the value of the key in the $variables array. Lullabot has an example on using the preprocess field.
Entity Views Attached: This might be a bit extra overhead but if you download the eva module you can create views and pass the current NID in and combine fields through views. This is often helpful if you need to create various different photo galleries with different fields, etc.
Try Field Group module. It provides grouping fields feature within DS view mode UI ;)
renderkit 7.x-1.2 contains an EntityDisplay plugin "Sequence of entity displays, with list format". You can add a sequence of entity displays within that.
If you add "Field with formatter" items, you should set the "Field display processor" to "Full reset" to get rid of all the div wrappers, and make it show up inline.
renderkit 7.x-1.3 has an EntityDisplay plugin "Display suite field", which gives you things like "Post date".
It can be useful to export the configuration as a preset using cfrpreset, to make it reusable and configurable outside of field UI.
I added a lot of details in Conditionally display one of two fields in Display Suite?, a lot of this will be similar.
- This method adds a lot of dependencies to your project. You need to decide for yourself if this is worth it.
- The integration of the drilldown forms in the field UI subform is a bit clunky. But it does work in the end.
- Adding an item to a sequence (here: Entity displays Item #0, Item #1 etc) requires to submit / reopen the form for each new item. This is a bit annoying, but survivable.
Below is an example configuration.