Hi,
How do I create a text component as a design_dialog? I need to have a place to hold a text that will be the same for the whole website.
Thank you.
Cheers,
Viren.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Viren,
Would it be enough if you create you own iparsys that holds the text you want, let say on the parent page. Then the child pages of this one will have the opportunity to inherit the same text as entered in the parent page. This component could then be automatically included in your template if you wish to have it on every page (do you don't forget some pages).
Otherwise you could have a component where you ahve a design dialog. This design dialog could hold a value like, myText.
In the design_dialog.xml, you could have something like:
<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="cq:Dialog" title="My Text Dialog" xtype="panel"> <items jcr:primaryType="cq:WidgetCollection"> <mytext jcr:primaryType="cq:Widget" fieldLabel="This is my text" name="./myText" xtype="textfield"/> </items> </jcr:root>
Then in the component jsp file:
<% //.... String myText = currentStyle.get("myText", "Default Text"); //... %> <p><%= myText %></p>
This was just a basic example but it should be possible for you to choose a method that suits you.
Good luck
/Johan
Views
Replies
Total Likes
Hi Viren,
Would it be enough if you create you own iparsys that holds the text you want, let say on the parent page. Then the child pages of this one will have the opportunity to inherit the same text as entered in the parent page. This component could then be automatically included in your template if you wish to have it on every page (do you don't forget some pages).
Otherwise you could have a component where you ahve a design dialog. This design dialog could hold a value like, myText.
In the design_dialog.xml, you could have something like:
<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="cq:Dialog" title="My Text Dialog" xtype="panel"> <items jcr:primaryType="cq:WidgetCollection"> <mytext jcr:primaryType="cq:Widget" fieldLabel="This is my text" name="./myText" xtype="textfield"/> </items> </jcr:root>
Then in the component jsp file:
<% //.... String myText = currentStyle.get("myText", "Default Text"); //... %> <p><%= myText %></p>
This was just a basic example but it should be possible for you to choose a method that suits you.
Good luck
/Johan
Views
Replies
Total Likes
Views
Likes
Replies