Showing posts with label CMSComponent. Show all posts
Showing posts with label CMSComponent. Show all posts

Tuesday, September 6, 2016

Nice Sitecore Tools and Tricks

Thursday, August 25, 2016

How to restrict template types that can be inserted under a Sitecore content node




Restrict item types that can be added to content tree item.
How to restrict template types that can be inserted under a page (using insert options on Standard values)

Step-by-step guide
 1. Select "__Standard Values" of the page template (that is used to create the page)
 2. Select "Configure" from the toolbar
 3. Select "Assign" from the toolbar
 4. Select template type that will be allowed (eg.  "Special Offer" from /sitecore/templates/Project/abc/Content Types/) and add to the "Selected". Remove everything else from the list












5. Press ok to save
6. If you try to create an item under the page (created using the page template)., Sitecore will allow you to create only item of "allowed type"

Monday, June 30, 2014

Hybris - Add a CMS Component Step-by-Step

Hybris - Add a CMS Component Step-by-Step Instructions

1. Add  itemtype definition to -itema.xml

example:


<itemtype code="MyParagraphComponent" generate="true"
    jaloclass="de.hybris.platform.yacceleratorcore.jalo.cms2.components.MyParagraphComponent"
    extends="CMSParagraphComponent" autocreate="true">
    <attributes>
        <attribute qualifier="media" generate="true" autocreate="true" type="localized:Media">
           <persistence type="property" />
        </attribute>
    </attributes>
</itemtype>


2. Update -locales_en.properties file by Adding localized attribute names and descriptions (OPTIONAL)

type.MyParagraphComponent.name=My Paragraph Component

3. Creating Controller

    create a new  controller class by extending AbstractCMSComponentController
       a. @Override fillModel method
       b. add @RequestMapping

4. Create View MyParagraphComponent.jsp

5. Add component to Valid Component Types

    add the component entry to cms-content.impex
$narrowContent=ProductFeatureComponent,

Alternately you can add entries to ComponentTypeGroups2ComponentType

6.  You can customize the hybris WCMS Cockpit for the component via the XML configuration:

editorArea_typeName.xml: configuration file for the WCMS Cockpit editor area.
contentEditor_typeName.xml: configuration file for Live Edit mode and in-line editing.
wizardConfig_typeName.xml: wizard configuration, if a component is added via a wizard dialogue.


Detailed instructions can be found in the Hybris Wiki page below

https://wiki.hybris.com/display/release5/How+To+Add+a+New+CMS+Component+-+Tutorial