Title: Dashes in field names
Last modified: August 31, 2016

---

# Dashes in field names

 *  Resolved [ageibert](https://wordpress.org/support/users/ageibert/)
 * (@ageibert)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/dashes-in-field-names/)
 * I’ve got ACF (Advanced Custom Fields) installed and create fields with dashes
   in their name like “product-title”.
    When i now try to output e.g. `{{ product.
   product-title }}` nothing gets printed out because dashes seem not to be allowed
   in variable names (like in php).
 * Is there a way to output fields with dashes in their name?
    Maybe through a wrapper
   function?
 * Best regards
 * [https://wordpress.org/plugins/timber-library/](https://wordpress.org/plugins/timber-library/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [ageibert](https://wordpress.org/support/users/ageibert/)
 * (@ageibert)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/dashes-in-field-names/#post-7443806)
 * Got it. The solution is to use array notation:
    {{ product[‘product-title’] }}
 *  Plugin Author [jarednova](https://wordpress.org/support/users/jarednova/)
 * (@jarednova)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/dashes-in-field-names/#post-7443993)
 * [@ageibert](https://wordpress.org/support/users/ageibert/) — I was about to tell
   you to avoid using dashes in fields. I didn’t realize Twig supported array notation.
   Good find!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Dashes in field names’ is closed to new replies.

 * ![](https://ps.w.org/timber-library/assets/icon-256x256.png?rev=1482054)
 * [Timber](https://wordpress.org/plugins/timber-library/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/timber-library/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/timber-library/)
 * [Active Topics](https://wordpress.org/support/plugin/timber-library/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/timber-library/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/timber-library/reviews/)

## Tags

 * [ACF](https://wordpress.org/support/topic-tag/acf/)
 * [field names](https://wordpress.org/support/topic-tag/field-names/)

 * 2 replies
 * 2 participants
 * Last reply from: [jarednova](https://wordpress.org/support/users/jarednova/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/dashes-in-field-names/#post-7443993)
 * Status: resolved