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, I might want to have a template for my body field, which is only used when it appears in the right region and I'm using the teaser 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.
Comments
Comment #1
jstollerI'll offer one use case for this. I'm working on an HTML5 template right now. Altering my Views templates to use section, article, header and footer elements was trivial. Altering my Display Suite output to do the same is a huge pain.
Comment #2
swentel commentedCan you look at #910842: HTML 5 support Added Grid 960 Support and see if that theming function override works for you. ?
Making fields templatable is going to pretty hard I think and probably a no go for D6, regions templatable a bit easier. Adding a preprocess function and a default tpl will probably to the job and tied to making it possible to have different regions per buildmode / type.
Comment #3
swentel commentedLets take this to #878298: Make regions and fields templatable
Comment #4
Yuri commentedThe hardcoded template is indeed a drawback. I totally agree with jstoller, there needs to come a template solution, and also for D6. Maybe start with a simple select form that points to a folder where users can drop their templates..
Comment #5
askibinski commentedThe status change (duplicate) and link in #3 just loops back to this page, I don't think that's right.
Comment #6
jstoller@Yuri
I'm not entirely sure what you're proposing with your select form. I wasn't really considering a GUI based templating system. I just want to be able to theme my DS build-modes, regions and fields the same way I theme my Views, which is accomplished by recognizing patterns in the file names.
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.
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.
Comment #7
swentel commentedOk, should be taken to #914626: semantic display suite ?? - sorry about the redirect loop :)