一、实现挖坑之旅第一aem之hello world(效果入下图)

【记录二】aem开发实践一

二、开始创作

实践活动一:创建文件夹

1、导航到CRXDE Lite。http://localhost:4502/crx/de。或者从任何控制台输入“/”并输入“crx”到OmniSearch工具栏中,然后单击CRXDE Lite
【记录二】aem开发实践一

2、右键单击/apps并选择Create —>CreateFolder
【记录二】aem开发实践一
3、文件夹的名称输入trainingas。单击OK,然后单击左上方的SaveAll
【记录二】aem开发实践一
注意:节点名是一个受限制的集合,没有空格或特殊字符。另外,不要使用“(下划线)”。通过约定,节点名以小写字母开头

4、右键单击/apps/trainingas并选择Create —>Creade Folder。输入“components”作为文件夹名称,并保存您的更改
5、同理在/apps/training/components下创建两个子文件夹,命名为“content”和“structure”,保存您的更改
【记录二】aem开发实践一

实践活动二:创建一个页面呈现组件

1、右键单击 /apps/ training/components/structure选择Create --> Create Component.
【记录二】aem开发实践一

2、填入下列值Label: contentpage
Title: WE.TRAIN Contentpage Component
Description: Initial WE.TRAIN page-rendering Component
SuperType: wcm/foundation/components/page
【记录二】aem开发实践一
3、选择next
4、单击OK,保存您的更改。
【记录二】aem开发实践一
5、右键单击contentpage.jsp将重命名为contentpage.html
6、双击contentpage.html打开用于编辑的脚本,用html的代码替换所有的示例代码和注释
【记录二】aem开发实践一
7、保存你的修改。

实践活动三:创建要呈现的内容

1、右键单击/apps/trainingas/components/content并选择Create -->Create Node

【记录二】aem开发实践一
2、创建一个名为“hello-world”类型的节点:“cq:Component”
【记录二】aem开发实践一

3、保存你的修改

4、添加具有以下属性的属性,并单击Add
【记录二】aem开发实践一
【记录二】aem开发实践一

5、请注意,sling:resourceType属性值是我们刚刚定义的页面呈现组件的路径

6、保存你的修改

7、在浏览器中打开
http://localhost:4502/apps/trainingas/components/content/hello-world.html
【记录二】aem开发实践一

备注:有网友说直接打开:http://localhost:4502/content/hello-world.html (我打开不行,后面研究出在补充)

相关文章:

  • 2021-06-28
  • 2021-09-19
  • 2022-12-23
  • 2021-07-19
  • 2021-11-17
  • 2021-10-26
  • 2021-09-21
猜你喜欢
  • 2021-12-01
  • 2021-06-23
  • 2021-08-07
  • 2021-04-06
  • 2021-12-08
  • 2022-12-23
相关资源
相似解决方案