Currently all our entities support being viewed by entity_view(), but most of them do not have a dedicated theme hook and template.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 1342374-07-commerce-entity-templates.patch | 5.03 KB | joshmiller |
| #1 | 1342374-commerce-entity-templates.patch | 2.72 KB | damien tournoud |
Comments
Comment #1
damien tournoud commentedPatch for the product entity. The others need the same sort of treatment.
Comment #2
rei commentedwhere is the view path ? still admin/commerce/products/1 ?
is this patch suppose to be able viewing the product without product reference /product display for single product ?
Comment #3
rszrama commented@rei: There actually is no view path for products, but the template would still be usable if a View or some other code wanted to display a rendered product.
I was wondering how people were supposed to use template to theme our entities. I always just assumed it would automagically happen thanks to our Entity API integration. : )
Moving this to "needs work" to capture the rest of 'em.
Comment #4
rszrama commentedTagging.
Comment #5
Molfar commentedI use views to render a single commerce product page (not product display page). And I need a custom template fom commrece_product entity commerce_product.tpl.php. The global template entity.tpl.php works fine, but what about more specefic templates like commerce_product--my_product_bundle.tpl.php ?
Comment #6
joshmillerOff the top of my head we could include templates for the following ... am I missing any?
Comment #7
joshmillerUpdated patch for product template and added support for line items. I'm afraid this entire concept is slightly above my head ... For example, we don't implement templates for customer profiles, but we have two view modes that work out of the box? I can't even find the functions that output the html for customer profiles.
Anyway, I copied Damien's approach for line items. Unless I can wrap my head around this hook_theme situation, I'm afraid this may be over my head.
Comment #8
joelpittetThis looks good, just a couple of things because i've seen a fair share of templates:S
Do we need a clearfix? It would be nice to avoid putting those in.
If content_attributes has a class attribute this will double up.
Comment #9
chris matthews commentedThe 6 year old patch in #7 applied cleanly to the latest commerce 7.x-1.x-dev, but looks like it needs work per the comments in #8.