Is there a "Semantic Display Suite" ??

Or: Are there any plans to make display suite output markup semantically configurable?

The awesome "Semantic Views" module made this possible for views and now gets integrated into views core (http://drupal.org/node/740686).
Now there is an equivalent "Semantiv CCK" module out!
The only major component for a truely configurative site building in Drupal that is missing such a configuration option for markup and wrapper is ...Display Suite.

==> If Display Suite gets a configuration mechanism for markup and wrapper, Drupals output could be really and completely light-weight, semantically and even HTML5-enabled! Think about that!! <==

The following display suite aspects should be configurable in terms of markup output:

* ds/nd regions (all wrappers -> so you could effectively remove all regions markup if you dont need it)
* fields
* fieldgroups
* all other wrappers

The following markup aspects could be configurable:

* tags (which one, if any)
* arbitrary classes (set by user)
* special ds/nd classes (like: should they appear?)
* striping options (input field with "odd even" or "one two three")

For introduction or inspiration have a look at:

http://drupal.org/project/semanticviews
http://drupal.org/project/semantic_cck

I also looked into the issue queue and found some requests that could profit from such a "Semantic Display Suite" tool:

http://drupal.org/node/910842 (ds "HTML 5 support" => tags could be set by user)
http://drupal.org/node/742924 (ds "additional div for field content" => could be set/removed by user)
http://drupal.org/node/878298 (ds "Make regions and fields templatable" => would be less necessary)

So, are there any plans on that? From the maintainers? from anybody?
If so, what's the status?
If not, how could i best start to write one (what/where are the "hook in"-points of display suite making such a thing possible?).

cheers,

daniel

Comments

reglogge’s picture

That sounds very interesting - subscribe...

swentel’s picture

Hey, sorry for getting very late at this. HTML 5 support and semantic support would be awesome to get this in. This won't make it into the Drupal 6 version anymore though, however, this is a must for D7.

Now, as for how to start on this, I'm not sure yet. We're planning a porting session for D7 the upcoming days and we're going to change tactics. Instead of our own configuration screens, we are now able to hook into the Field UI screen of D7 core. This means that we'll be using hooks like hook_entitity_attach_alter() and others. This means that Display Suite itself won't be responsible anymore for the output of of a node. This could mean that having HTML 5 support is by first looking into D7 core and see if we can render the default content (so without DS) into a semantic way or not, which I think should be easy. If anyone is interested into checking that out and reporting here, that would mean a lot, but we'll have a look at that too of course!

Anway, the game is on, I hope to get a first initial port ready by the end of next week, I'll report back then!

reglogge’s picture

@swentel: That sounds great! Thanks for your time and effort!

jstoller’s picture

+1... +2 for a back-port to Drupal 6.

jstoller’s picture

Since #878298: Make regions and fields templatable was marked as a duplicate of this, I'd like to bring some of that discussion over here.

It seems to me that the biggest hurtle towards a semantic Display Suite is that its output is hard coded and therefore not templatable. Instead of hard-coding the layout of Display Suite elements, why not provide templates which can more easily be themed and adapted to solve real-world design challenges? For inspiration I would look at Views use of templates for display, style, row and field layouts. In the case of Display Suite, I suppose it would be build mode, region, field group and field templates.

Also like Views, there should be a wide range of template name patters which Display Suite recognizes, allowing themers to target special cases as necessary. For instance, if I have a template in my theme titled nd-field--full-text--middle--field-image-caption.tpl.php, then Display Suite should apply that template to the image-caption CCK field in the middle region when using the Full Text build mode to render a node. A template like nd-region--footer.tpl.php would apply to the footer region, in any build mode. For extra points, I'd love to see a link at the bottom of each display layout page that was the equivalent of Views "Theme: Information" link. That thing's a godsend for themers.

So, what would it take to add template support to Display Suite? Is anyone interested in taking this on for D6?

As an aside, people interested in this issue may also be interested in #878314: Allow for more configurable regions. I see the two features working very well together.

gooddesignusa’s picture

subscribing

swentel’s picture

An update on the D7 status - Display suite is now able to provide template files for several layouts. The development version already has working template files for 2 column & 2 column stacked - see http://drupalcode.org/viewvc/drupal/contributions/modules/ds/layouts/ds_... for such a template file.

Display suite is now dependant on the new field group which has a 'field group' which can be used as a region. It works on all entities (so nodes, users, terms etc) and on all view modes (so form, full node, user profile etc etc)

If you go to any manage fields or manage display screen you'll see a new fieldset called 'layouts' where you can select the layout and after that you can just drag and drop around. It's a first big step and the possibilities are endless imo now.

Anyone who wants to test go nuts I'd say :)

rjmackay’s picture

subscribe

peter törnstrand’s picture

subscribe

rudiedirkx’s picture

subscribe ?

rolfmeijer’s picture

subscribing

peter törnstrand’s picture

I must say I'm very pleased with how this works on D7! Great work, perhaps a backport?

swentel’s picture

Status: Active » Closed (fixed)

Closing this one. D7 DS now uses templates, so all is configurable on that level, with hook_theme_suggestions coming on the way (that's on my todo list). Themes can also define their own templates and DS recognizes them on the fly. Backport won't happen unless someone steps up and wants to maintain a 6--2 branch, but that's not my intention.

donquixote’s picture

Status: Closed (fixed) » Needs work

Hi,
not sure if the templates can really to be considered an equivalent to what has initially been requested.

A typical use case would be: Display an image in a decorated box, floated in the text.
Currently there are these options:
- override the theme function for the field itself -> not easily reusable for other fields.
- provide a custom formatter for the image field (preferably with a custom module) -> nice, but now the float stuff only works for images, and it can not be freely combined with existing formatters.
- provide a custom layout -> this would affect the entire view mode, not just the image field, and it can not be reused across layouts.
- create a field group and float that. hmmm..

What I would imagine instead, is that for every field one could define some custom wrapper html. This could be similar to semantic views, or with a "wrapper formatter" in addition to the field formatter.

------

I am just playing with thoughts here, feel free to close this again :)
For now I am going to create a custom formatter for my image field.

donquixote’s picture

Status: Needs work » Fixed

Somewhere else
#1302230: Setting a wrapper in expert mode while keeping the styles (like in views style overwrite)
it looks like there is an "expert mode" which does exactly this - something I must have missed!
I am now going to find out how to enable that expert mode..

aspilicious’s picture

enable field templates in the extras

donquixote’s picture

yup..

Status: Fixed » Closed (fixed)

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