4

How to insert the same component more than once - Adobe CQ

 2 years ago
source link: https://www.codesd.com/item/how-to-insert-the-same-component-more-than-once-adobe-cq.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

How to insert the same component more than once - Adobe CQ

advertisements

I have an accordion component and I would like to insert an 'parsys' component in each 'tab' of the accordion.

I realized that the 'path' attribute must be different , then I tried to set that dynamically like:

for (Value val : values) {
    i++;
    pathname = PATH + i;
    obj = new JSONObject(val.getString());
%>

'<cq:include path='<%= pathname %>' ...

But it didn't work

I also tried to output this from JSP , but it didn't work either.

Someone know how can I solve it?


You have three options to set the path dynamically

  1. ${currentNode.identifier} : this will give you the unique id for every node in aem.
  2. ${resource.parent.name}-${resource.name} this will give you a unique Human READABLE Id.
  3. Write a WCM binding class to provide you a unique ID based on the current node path.

Related Articles

angular2, how to show the same component more than once

I have a wizard component with multiple step components, these steps are routed to by the wizard component and the wizard itself is routed to from the root component. As the last step of the wizard, i need to show all the navigated steps at once for

How to build the same library more than once in Yocto?

I have 2 application, both uses the same library but the library should be build with a flag enabled in one and disabled in other. this is a static library, so at run time there won't be a conflict in runtime. But the library is separate ie, the appl

How to use the same variable more than once in the concat () function MySql

DELIMITER $$ CREATE TRIGGER `tr_tblEmployee_Update` BEFORE UPDATE ON `tblEmployee` FOR EACH ROW BEGIN DECLARE id int; DECLARE OldGender varchar(10); DECLARE NewGender varchar(10); DECLARE NewName varchar(50); DECLARE OldName varchar(50); DECLARE OldS

How to use the same fragment more than once?

I'm creating an app that gets data from an XML file from a website and pass these data to a Fragment. I'm using an Action Bar, I have 3 tabs, and also with a ViewPager. The fragment contains a ListView, I pass the data using Bundle, I can get the pas

How to join the same board more than once

I am using postgresql. I have a table called custom_field_answers. The data looks like this. Id | product_id | value | number_value | 4 | 2 | | 117 | 3 | 1 | | 107 | 2 | 1 | bangle | | 1 | 2 | necklace | | I want to find all the products which has te

Using the same option more than once from the command line in python

How can I use the option more than one time? for example the command cpdoc: cpdoc -d text -s x -s y -s z I would like to have x,y,z in one array/data structure import optparse import os import shutil def main(): p = optparse.OptionParser() folder = [

Why my Go string returns the same item more than once

I have a simple application that I am working on to read MongoDB's replication oplog, serialize the results into a Go structure and send it to a channel to be processed. Currently I am reading from that channel and simply printing out the values insi

Starting the same shape more than once

I currently have a project, with a form containing a Panel, called Panel1. There are no classes, or anything in the form as all the code is held in my control library. I can start up a single instance of the form with one of my 4 User Controls, howev

Import the same module more than once

So after a few hours, I discovered the cause of a bug in my application. My app's source is structured like: main/ __init__.py folderA/ __init__.py fileA.py fileB.py Really, there are about 50 more files. But that's not the point. In main/__init__.py

Why do the enumerated files return the same file more than once?

I have this code (thanks to those that have been helping so far) It searches through a directory and all subdirectories looking for a file names. Files.Clear(); //BindingList<FileInfo> Datasource for a datagridview Task.Factory.StartNew( () => {

XPath produces a set of result nodes containing the same node more than once?

What I tried to say in the title is: Given a bit of XML in which I know a particular element appears only once, is it possible using a single XPath query to select a node-set that contains that element twice? I understand there's a "union" opera

Adding the same layout more than once in Android

I am building a form that contains details like name, phone number and so on. I want to give a button to add similar form to add more similar details. I want to give different id's to the element of layout that gets added on button click. Ex : if Edi

Use the same branch more than once

I am new to git, and I am assuming that if I can use only one branch for all project. After I commit my code into a branch -- subBranch, and merge it into the master. Then I did some other change. May I commit them into the subBranch again and merge

Problem with UIView animations - running the same animation more than once does not work

I need to flip a card and then flip it back. I have written code to do that with no trouble. The trouble comes because users can flip this card back and forth as many times as they want, and it seems that the effect is cumulative. On the second try,

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK