CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Using the new data-xxx html5 attributes
Pages: [1]

Author Topic: Using the new data-xxx html5 attributes  (Read 1736 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Using the new data-xxx html5 attributes
September 05, 2011, 04:11:33 am
Hi,

As part of the new in place editing, we will need to have more semantic information within the html pages (eg this string is a phone number, of type gsm and location home with the internal id X  belonging to the contact Y).

When writing the developer chapters of the book last year, we came up with conventions so the classes "crm-phone-xxx" would contain these data. This is (very slowly) applied to the exiting pages, and would need to be applied everywhere to get the inplace editing working (and that's  a general good thing to do).

However, not sure the class is the best place to store info about the id & type. As of jQuery1.6, we could easily use the html data attributes instead:

http://ejohn.org/blog/html-5-data-attributes/
http://blog.jquery.com/2011/05/03/jquery-16-released/
http://api.jquery.com/jQuery.data/

What do you think? Seems to be less hackish and more future proof to me.

X+

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Using the new data-xxx html5 attributes
September 06, 2011, 11:01:00 am
Sounds great to me. Thanks for your work on this Xavier.
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Using the new data-xxx html5 attributes

This forum was archived on 2017-11-26.