how to make RDFa annotated parts of a page not editable

29 views
Skip to first unread message

rene_kapusta

unread,
Mar 7, 2012, 4:52:13 AM3/7/12
to CreateJS
I'd like to make RDFa annotated parts of a page not editable.

e.g. in a Drupal page there's the author information available as:

<div class="meta submitted">
<span property="dc:date dc:created"
content="2011-02-04T14:05:43+01:00" datatype="xsd:dateTime"
rel="sioc:has_creator">published by <span class="username" xml:lang=""
about="/users/edith" typeof="sioc:UserAccount"
property="foaf:name">edith</span> on Fri, 02/04/2011 - 14:05</span>
</div>

but this part shouldn't be editable… how do I tell create that?

Henri Bergius

unread,
Mar 7, 2012, 5:14:28 AM3/7/12
to crea...@googlegroups.com
Hi,

On Wed, Mar 7, 2012 at 10:52 AM, rene_kapusta <rene.k...@gmail.com> wrote:
> I'd like to make RDFa annotated parts of a page not editable.

I think the easiest way is by hooking into Create's widget selection
mechanism. By default we just load the designated content editable
widget (Hallo or Aloha) for each element containing a RDFa literal,
but you can supply your own versions of these functions in
configuration. This way you can load other widgets (or editors with
different configurations) for different editable contents.

This could mean date pickers or autocomplete boxes, but it could also
mean a "no widget" for cases like this.

Look at the default implementations of widgetName, enableEditor, and
disableEditor:
https://github.com/bergie/create/blob/master/src/jquery.Midgard.midgardEditable.js#L14

You can pass your own versions in the config object when loading the
midgardCreate widget (or midgardEditable if you're only using that).

/Henri

--
Henri Bergius
Motorcycle Adventures and Free Software
http://bergie.iki.fi/

Jabber: henri....@gmail.com
Microblogs: @bergie

Reply all
Reply to author
Forward
0 new messages