CQ5 Dialog.xml - how to insert a paragraph? - aem

Most of the text in my dialog.xml is labels for form inputs.
Is there a way to have just a plain paragraph that offers the user some explanation?

You can use the label xtype:
<mylabel
jcr:primaryType="cq:Widget"
fieldLabel="My label"
html="Some description text in <b>bold</b>"
xtype="label"/>
As you can see, you can even use simple tags within the html property like <b> and <i>. Of course the brackets escaped as < and >

You can use a displayfield xtype. Read the docs for the CQ5 Widget API CQ.Ext.form.DisplayField. Here is an example:
<instructions
jcr:primaryType="cq:Widget"
fieldLabel="Instructions"
fieldDescription="Insert instructions for your authors here."
xtype="displayfield" />
You can use long paragraphs and you can insert HTML by using character entities. For example:
This will bold <strong>this text</strong>.

Related

Change Text Font to Bold

I have a table (sap.m.Table) and would like to change the header font to bold, but I'm unable to do that. Here is my code for one of the column definitions in my *.view.xml:
<Column xmlns="sap.m"
hAlign="Left"
width="17em"
>
<Text text="Vendor" />
</Column>
After looking at the API (sap.m.Text), I don't see a way to change the text style and I'm also new to UI5. Could someone point me to where to look for this?
sap.m.FormattedText
Another option is to use sap.m.FormattedText[api] with an inline tag <strong> within the htmlText value.
<Column ...>
<FormattedText htmlText="<strong>My Column</strong>" />
</Column>
Note
In XML, the character < needs to be escaped with <.
Browsers do not guarantee that the text within <strong> is always displayed in bold.
The <strong> element is for content that is of greater importance, while the <b> element is used to draw attention to text without indicating that it's more important. [source]
The element <b> is currently not supported by the FormattedText. On the other hand, <em> is supported to emphasize the text.
sap.m.Label
Instead of sap.m.Text, you can use sap.m.Label which supports "Bold" design.
<Column id="myColumn">
<Label labelFor="myColumn"
design="Bold"
text="..."
wrapping="true"
/>
</Column>
Additionally, enable the property wrapping (available since 1.50) in order to achieve the default behavior of sap.m.Text. Wrapping should be enabled for column headers as recommended by Fiori design guidelines:
Column Headers - Best Practices
Use controls that wrap [...]. Do not use controls that truncate.
Note: If the label is not labeling anything, please try with different controls like sap.m.FormattedText.
I found by chance that using <FormattedText> instead of <Text> creates bold headers. This works without (!) using any additional bold or strong markup in the htmlText of <FormattedText>.
So in your case you would go with:
<Column
hAlign="Left"
width="17em"
>
<FormattedText htmlText="Vendor" />
</Column>
Whether this works seems to be somewhat dependent on the SAPUI5 version and the theme in use.
It works for me on SAPUI5 1.108 with the default theme (no data-sap-ui-theme specified in index.html).
Try like in the Documentation
Create a custom CSS
Add your styleclass to the Control.

title tag html editing

hey everyone am trying to add my title tag but every time i try to put it in the format of Company name| Primary keyword and Secondary keyword i get parsing error which is ''Error parsing XML, line 516, column 29: Element type "ShareFreeTemplates" must be followed by either attribute specifications, ">" or "/>" and here is my html code
<b:include data='blog' name='all-head-content'/>
<!--::::::::::: Block2: Output Index Title,keywords,decription and Post Title,description -->
<!-- Post/Archive Page -->
<b:if cond='data:blog.pageType != "index"'>
<title><data:blog.pageName/></title>
<!-- Index Page -->
<b:else/>
<title><ShareFreeTemplates|Free After Effects Templates And-Tutorials /></title>
<meta content='after effects free templates, templates, after effects project files, free download' name='keywords'/>
</b:if>
if somebody can edit that title tag to give me no errors i want it like that ''Free After Effects Templates and Project Files| ShareFreeTemplates'' and thx in regards
This is how the title tag works in standard HTML coding.
<title> insert words here </title> are the tags used. and then you insert the words in between the two tags like so
<title>ShareFreeTemplates|Free After Effects Templates And-Tutorials </title>
you dont need to encapsulate your title in another pair of tags.
<title><ShareFreeTemplates|Free After Effects Templates And-Tutorials /></title>
^ ^^
//remove the characters where the arrows are pointing at

Can I use Sencha FieldLabel tag to put label and text field in reverse order?

I've made layout with simple gwt, but now I want to make label and text field using gxt 3.0.1.
Gxt provides FieldLabel field. Label on the left than TextField on the right.
Can I make it to be, text field than label on right side of the text field.
Current code is `
<g:HorizontalPanel ui:field="hpOne" width="1">
<g:Cell verticalAlignment="ALIGN_MIDDLE">
<form:FieldLabel text="{message.lblTestGroupName}" ui:field="lblTestGroupName">
<form:widget>
<form:TextField ui:field="tbTestGroupName"/>
</form:widget>
</form:FieldLabel>
</g:Cell>
</g:HorizontalPanel>
`
I am not sure if we are on the same plate, but please try this:
<g:HorizontalPanel ui:field="hpOne" width="1">
<form:TextField ui:field="tbTestGroupName" />
<form:FieldLabel text="{message.lblTestGroupName}" ui:field="lblTestGroupName" />
</g:HorizontalPanel>
Lemme know if you are looking for this.

Jsoup - CSS Select in DOM structure

I have got the following HTML:
some text <b>some bold text</b>
<span property='some property1>
some semantic term2</span>
<p><span id='mark1'></span>
some text <i>some italic text</i></p>
<span property='some property2'>
some semantic term</span>
<span id='mark2'></span>
I would like to select all span elements with a 'property' attribute, which are placed between the span elements with ids 'mark1' and 'mark2' (these are my technical bookmarks, which should be then removed) and unwrap it.
I think the best way to implement it in Java Jsoup is to use the doc.select function. But I can't create the correct CSS query (I need something like: every span elements with property attribute BETWEEN these two elements).
The expected result (after removing the bookmarks):
some text <b>some bold text</b>
<span property='some property1>
some semantic term2</span>
<p>
some text <i>some italic text</i></p>
some semantic term
Any ideas? Maybe something like E ~ F. Thanks a lot!
This is not possible: the Jsoup selector syntax is not expressive enough to select all tags between two arbitrarily-positioned tags.
However, you can use the NodeTraverser class with a NodeVisitor implementation that collects all elements visited between the two bookmark elements. (This should be easier than "some awful recursion" referenced in your comment.)

How do I update an Eclipse template variable on the fly?

I've added the following new Eclipse template via extension point. It simply adds a template for a sample testTag tag.
<!-- Add code template -->
<extension point="org.eclipse.ui.editors.templates">
<template autoinsert="true"
contextTypeId="html_tag"
description="[Description] Template populated by Snippet values ***"
id="org.eclipse.jst.jsf.ui.newHtmltag"
name="testTag">
<pattern>
<![CDATA[
<testTag style="background: ${color}"></testTag>
]]>
</pattern>
</template>
<resolver
contextTypeId="html_tag"
type="src"
class="TestTagTemplateVariableResolver">
</resolver>
</extension>
What I'd cannot figure out is how to change the value of the $(color) variable at runtime. More specifically, when the user presses Ctrl + Space (or the equivalent for content-assist) and types in "testTag" and presses Enter -- instead of the "color" placeholder text, I'd like it replaced by some other text value I have in another class. How do I do this?
This email chain from 2004 says it might not be possible:
the Java editor chooses not to respect resolvers contributed to its two context types ('java' and 'javadoc'), but only recognizes the built-in resolvers.
The html editor you are working with may have a similar restriction.