peregrine-cms / ask

ask questions about Peregrine CMS
https://www.peregrine-cms.com
0 stars 2 forks source link

How to add a component on site from theme? #1

Open swapnilmmane opened 5 years ago

swapnilmmane commented 5 years ago

Question - How to add a component on site from theme?

Answer -

To explain the process, in the steps below we will use themecleanflex as a source site and mynewsite as target site to be deployed. So, we will copy the mycompo component of themecleanflex to mynewsite site.

  1. Open the site tree on ‘Browser’ http://localhost:8080/bin/browser.html

  2. Copy the required component node from the source site (themecleanflex) jcr:root > apps > themecleanflex > components > mycompo

1 Copy Component Node

  1. Go to the component node of the target site (mynewsite) jcr:root > apps > mynewsite > components Paste the copied component node.

2 Paste Component Node to Target

  1. Make entry of the component in mapping.js Go to mapping.js for the target site Open http://localhost:8080/bin/browser.html
    Go to jcr:root > etc > felibs > mynewsite > mapping.js http://localhost:8080/bin/browser.html/etc/felibs/mynewsite/mapping%2Ejs

3 Open mapping

Open mapping.js and make the following entry for newly copied component var cmpMynewsiteComponentsMycompo = cmpThemecleanflexComponentsMycompo

4 Make entry in mapping

Note: This process is also supported by API, we will discuss it is separate documentation.