How to use the ContentBlocksFieldPlugin

classic Classic list List threaded Threaded
4 messages Options
Rob
Reply | Threaded
Open this post in threaded view
|

How to use the ContentBlocksFieldPlugin

Rob
Hi,

We want to create a CMS template that enables us to add paragraphs to an article that can consist of richtext, multimedia or plain text. To be able to add these different types to a paragraph we already use the ContentBlocksFieldPlugin for adding richtext and multimedia, and that works fine. We now want to add the possibility to add plain text as well. We extended the plugin configuration as can be see below.

These are the types we specified to be used by the ContentBlocksFieldPlugin.
<sv:node sv:name="Tekst">
   <sv:property sv:name="jcr:primaryType" sv:type="Name">
      <sv:value>hipposysedit:field</sv:value>
   </sv:property>
   <sv:property sv:name="hipposysedit:path" sv:type="String">
      <sv:value>nscommon:html</sv:value>
   </sv:property>
   <sv:property sv:name="hipposysedit:type" sv:type="String">
      <sv:value>hippostd:html</sv:value>
   </sv:property>
</sv:node>
<sv:node sv:name="Multimedia">
   <sv:property sv:name="jcr:primaryType" sv:type="Name">
      <sv:value>hipposysedit:field</sv:value>
   </sv:property>
   <sv:property sv:name="hipposysedit:path" sv:type="String">
      <sv:value>nscommon:multimedia</sv:value>
   </sv:property>
   <sv:property sv:name="hipposysedit:type" sv:type="String">
      <sv:value>hippo:mirror</sv:value>
   </sv:property>
</sv:node>
<sv:node sv:name="Code">
   <sv:property sv:name="jcr:primaryType" sv:type="Name">
      <sv:value>hipposysedit:field</sv:value>
   </sv:property>
   <sv:property sv:name="hipposysedit:path" sv:type="String">
      <sv:value>nscommon:code</sv:value>
   </sv:property>
   <sv:property sv:name="hipposysedit:type" sv:type="String">
      <sv:value>text</sv:value>
   </sv:property>
</sv:node>
</sv:node>

We also extended the CND with the 'code' field.
// ==============================================
// paragraphcontent used by content-blocks plugin
// ==============================================
[nscommon:paragraphcontent] orderable
+ nscommon:multimedia (hippo:mirror)
+ nscommon:html (hippostd:html)
- nscommon:code (string)

The CMS template now shows an additional Code button, but after pressing it, nothing happens. I suppose we have to register the 'Text' editor in some way, but how? changing 'text' into hippostd:html  gives us a richt text field that works. What are we missing?

Kind regards,
Rob Vermeulen

Reply | Threaded
Open this post in threaded view
|

Re: How to use the ContentBlocksFieldPlugin

Paul van der Zandt
Hi Rob,

It is not possible to use 'primitive' values as contentblocks, only compounds are allowed.

Cheers,
Paul.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Rob
Sent: Tuesday, September 06, 2011 11:48 AM
To: [hidden email]
Subject: [Hippo-cms7-user] How to use the ContentBlocksFieldPlugin

Hi,

We want to create a CMS template that enables us to add paragraphs to an
article that can consist of richtext, multimedia or plain text. To be able
to add these different types to a paragraph we already use the
ContentBlocksFieldPlugin for adding richtext and multimedia, and that works
fine. We now want to add the possibility to add plain text as well. We
extended the plugin configuration as can be see below.

These are the types we specified to be used by the ContentBlocksFieldPlugin.
<sv:node sv:name="Tekst">
   <sv:property sv:name="jcr:primaryType" sv:type="Name">
      <sv:value>hipposysedit:field</sv:value>
   </sv:property>
   <sv:property sv:name="hipposysedit:path" sv:type="String">
      <sv:value>nscommon:html</sv:value>
   </sv:property>
   <sv:property sv:name="hipposysedit:type" sv:type="String">
      <sv:value>hippostd:html</sv:value>
   </sv:property>
</sv:node>
<sv:node sv:name="Multimedia">
   <sv:property sv:name="jcr:primaryType" sv:type="Name">
      <sv:value>hipposysedit:field</sv:value>
   </sv:property>
   <sv:property sv:name="hipposysedit:path" sv:type="String">
      <sv:value>nscommon:multimedia</sv:value>
   </sv:property>
   <sv:property sv:name="hipposysedit:type" sv:type="String">
      <sv:value>hippo:mirror</sv:value>
   </sv:property>
</sv:node>
<sv:node sv:name="Code">
   <sv:property sv:name="jcr:primaryType" sv:type="Name">
      <sv:value>hipposysedit:field</sv:value>
   </sv:property>
   <sv:property sv:name="hipposysedit:path" sv:type="String">
      <sv:value>nscommon:code</sv:value>
   </sv:property>
   <sv:property sv:name="hipposysedit:type" sv:type="String">
      <sv:value>text</sv:value>
   </sv:property>
</sv:node>
</sv:node>

We also extended the CND with the 'code' field.
// ==============================================
// paragraphcontent used by content-blocks plugin
// ==============================================
[nscommon:paragraphcontent] orderable
+ nscommon:multimedia (hippo:mirror)
+ nscommon:html (hippostd:html)
- nscommon:code (string)

The CMS template now shows an additional Code button, but after pressing it,
nothing happens. I suppose we have to register the 'Text' editor in some
way, but how? changing 'text' into hippostd:html  gives us a richt text
field that works. What are we missing?

Kind regards,
Rob Vermeulen



--
View this message in context: http://hippo.2275632.n2.nabble.com/How-to-use-the-ContentBlocksFieldPlugin-tp6763248p6763248.html
Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html






This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is
intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to
read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message
in error, please notify the sender immediately and delete all copies of this message.

_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: How to use the ContentBlocksFieldPlugin

Jeroen Reijn
Administrator
In reply to this post by Rob
Hi,

I suppose you will need to define the type for code as: 

<sv:property sv:name="hipposysedit:type" sv:type="String">
     <sv:value>Text</sv:value>
  </sv:property>

Mark the uppercase of the initial letter. To check if the button actually works, you might want to take a look at the console and see if the property is added.

Jeroen



On Tue, Sep 6, 2011 at 11:48 AM, Rob <[hidden email]> wrote:
Hi,

We want to create a CMS template that enables us to add paragraphs to an
article that can consist of richtext, multimedia or plain text. To be able
to add these different types to a paragraph we already use the
ContentBlocksFieldPlugin for adding richtext and multimedia, and that works
fine. We now want to add the possibility to add plain text as well. We
extended the plugin configuration as can be see below.

These are the types we specified to be used by the ContentBlocksFieldPlugin.
<sv:node sv:name="Tekst">
  <sv:property sv:name="jcr:primaryType" sv:type="Name">
     <sv:value>hipposysedit:field</sv:value>
  </sv:property>
  <sv:property sv:name="hipposysedit:path" sv:type="String">
     <sv:value>nscommon:html</sv:value>
  </sv:property>
  <sv:property sv:name="hipposysedit:type" sv:type="String">
     <sv:value>hippostd:html</sv:value>
  </sv:property>
</sv:node>
<sv:node sv:name="Multimedia">
  <sv:property sv:name="jcr:primaryType" sv:type="Name">
     <sv:value>hipposysedit:field</sv:value>
  </sv:property>
  <sv:property sv:name="hipposysedit:path" sv:type="String">
     <sv:value>nscommon:multimedia</sv:value>
  </sv:property>
  <sv:property sv:name="hipposysedit:type" sv:type="String">
     <sv:value>hippo:mirror</sv:value>
  </sv:property>
</sv:node>
<sv:node sv:name="Code">
  <sv:property sv:name="jcr:primaryType" sv:type="Name">
     <sv:value>hipposysedit:field</sv:value>
  </sv:property>
  <sv:property sv:name="hipposysedit:path" sv:type="String">
     <sv:value>nscommon:code</sv:value>
  </sv:property>
  <sv:property sv:name="hipposysedit:type" sv:type="String">
     <sv:value>text</sv:value>
  </sv:property>
</sv:node>
</sv:node>

We also extended the CND with the 'code' field.
// ==============================================
// paragraphcontent used by content-blocks plugin
// ==============================================
[nscommon:paragraphcontent] orderable
+ nscommon:multimedia (hippo:mirror)
+ nscommon:html (hippostd:html)
- nscommon:code (string)

The CMS template now shows an additional Code button, but after pressing it,
nothing happens. I suppose we have to register the 'Text' editor in some
way, but how? changing 'text' into hippostd:html  gives us a richt text
field that works. What are we missing?

Kind regards,
Rob Vermeulen



--
View this message in context: http://hippo.2275632.n2.nabble.com/How-to-use-the-ContentBlocksFieldPlugin-tp6763248p6763248.html
Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html



--
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com

_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: How to use the ContentBlocksFieldPlugin

Jeroen Reijn
Administrator
In reply to this post by Paul van der Zandt
Ah yes you are right with this as far as I can remember.

Jeroen

On Tue, Sep 6, 2011 at 12:47 PM, Zandt, Paul van der <[hidden email]> wrote:
Hi Rob,

It is not possible to use 'primitive' values as contentblocks, only compounds are allowed.

Cheers,
Paul.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Rob
Sent: Tuesday, September 06, 2011 11:48 AM
To: [hidden email]
Subject: [Hippo-cms7-user] How to use the ContentBlocksFieldPlugin

Hi,

We want to create a CMS template that enables us to add paragraphs to an
article that can consist of richtext, multimedia or plain text. To be able
to add these different types to a paragraph we already use the
ContentBlocksFieldPlugin for adding richtext and multimedia, and that works
fine. We now want to add the possibility to add plain text as well. We
extended the plugin configuration as can be see below.

These are the types we specified to be used by the ContentBlocksFieldPlugin.
<sv:node sv:name="Tekst">
  <sv:property sv:name="jcr:primaryType" sv:type="Name">
     <sv:value>hipposysedit:field</sv:value>
  </sv:property>
  <sv:property sv:name="hipposysedit:path" sv:type="String">
     <sv:value>nscommon:html</sv:value>
  </sv:property>
  <sv:property sv:name="hipposysedit:type" sv:type="String">
     <sv:value>hippostd:html</sv:value>
  </sv:property>
</sv:node>
<sv:node sv:name="Multimedia">
  <sv:property sv:name="jcr:primaryType" sv:type="Name">
     <sv:value>hipposysedit:field</sv:value>
  </sv:property>
  <sv:property sv:name="hipposysedit:path" sv:type="String">
     <sv:value>nscommon:multimedia</sv:value>
  </sv:property>
  <sv:property sv:name="hipposysedit:type" sv:type="String">
     <sv:value>hippo:mirror</sv:value>
  </sv:property>
</sv:node>
<sv:node sv:name="Code">
  <sv:property sv:name="jcr:primaryType" sv:type="Name">
     <sv:value>hipposysedit:field</sv:value>
  </sv:property>
  <sv:property sv:name="hipposysedit:path" sv:type="String">
     <sv:value>nscommon:code</sv:value>
  </sv:property>
  <sv:property sv:name="hipposysedit:type" sv:type="String">
     <sv:value>text</sv:value>
  </sv:property>
</sv:node>
</sv:node>

We also extended the CND with the 'code' field.
// ==============================================
// paragraphcontent used by content-blocks plugin
// ==============================================
[nscommon:paragraphcontent] orderable
+ nscommon:multimedia (hippo:mirror)
+ nscommon:html (hippostd:html)
- nscommon:code (string)

The CMS template now shows an additional Code button, but after pressing it,
nothing happens. I suppose we have to register the 'Text' editor in some
way, but how? changing 'text' into hippostd:html  gives us a richt text
field that works. What are we missing?

Kind regards,
Rob Vermeulen



--
View this message in context: http://hippo.2275632.n2.nabble.com/How-to-use-the-ContentBlocksFieldPlugin-tp6763248p6763248.html
Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html






This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is
intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to
read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message
in error, please notify the sender immediately and delete all copies of this message.

_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html



--
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com

_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html