how to restrict the image in only one language in xhtml - jsf

I need to include an image in the xhtml page but when I add the image it is showing in all the languages. I want to restict the image only to one english language.
how to restrict it?
<h:graphicImage value="#{resource['images:register_img.png']}" alt="image" width="560px" height="140px" />

Related

Google Custom Search results includes html with “nocontent” tag

Our site have Google Custom Search set up. Instructions from Google have been followed, including downloading the CSE.xml file and adding “a new attribute enable_nocontent_tag="true" to the CustomSearchEngine tag”. The rest of the CSE file is left to default. The Search engine keywords field have been left empty. The “nocontent” class have been added to the menu and the underlying menu items which exists on all pages. The page have been running with the “nocontent” class on the menu for 2 weeks.
The problem is that if the searchterm occurs in the menu it will then appear in the results.
This is an example of our menu html:
<header class="nocontent page-head">
<nav class="main-nav-section">
<ul>
<li class="nocontent">
###
</li>
</ul>
</nav>
</header>
When we go to Google Search Console under the menu item “Crawl” and use Fetch as Google, then the html comes up as expected with the “nocontent” class on the menu.
This is our cse.xml file:
<?xml version="1.0" encoding="UTF-8" ?>
<CustomSearchEngine id="###" creator="###" language="da" encoding="UTF-8" enable_suggest="true" enable_nocontent_tag="true">
<Title>###</Title>
<Description>###</Description>
<Context>
<BackgroundLabels>
<Label name="_cse_hinwieyku6m" mode="FILTER" />
<Label name="_cse_exclude_hinwieyku6m" mode="ELIMINATE" />
</BackgroundLabels>
</Context>
<LookAndFeel nonprofit="false" element_layout="1" theme="7" custom_theme="true" text_font="Arial, sans-serif" url_length="full" element_branding="show" enable_cse_thumbnail="true" promotion_url_length="full" ads_layout="1">
<Logo />
<Colors url="#008000" background="#FFFFFF" border="#FFFFFF" title="#0000CC" text="#000000" visited="#0000CC" title_hover="#0000CC" title_active="#0000CC" />
<Promotions title_color="#0000CC" title_visited_color="#0000CC" url_color="#008000" background_color="#FFFFFF" border_color="#336699" snippet_color="#000000" title_hover_color="#0000CC" title_active_color="#0000CC" />
<SearchControls input_border_color="#D9D9D9" button_border_color="#666666" button_background_color="#CECECE" tab_border_color="#E9E9E9" tab_background_color="#E9E9E9" tab_selected_border_color="#FF9900" tab_selected_background_color="#FFFFFF" />
<Results border_color="#FFFFFF" border_hover_color="#FFFFFF" background_color="#FFFFFF" background_hover_color="#FFFFFF" ads_background_color="#fff7f5" ads_border_color="#FFFFFF" />
</LookAndFeel>
<AdSense />
<EnterpriseAccount />
<ImageSearchSettings enable="false" />
<autocomplete_settings />
<sort_by_keys label="Relevance" key="" />
<sort_by_keys label="Date" key="date" />
<cse_advance_settings enable_speech="true" />
</CustomSearchEngine>
Note: I'm assuming that your question is the following statement:
The problem is that if the searchterm occurs in the menu it will then appear in the results.
I think you might be misinterpreting the purpose of the nocontent class. The documentation says:
When Google Custom Search sees this tag, we'll ignore any keywords it contains and won't take them into account when calculating ranking for your Custom Search engine.
At the end of that document is also the following section:
Using nocontent won't impact your site's performance in Google Web Search, or our crawling of your site, in any way. We'll continue to follow any links in tagged content; we just won't use keywords to calculate ranking for your Custom Search engine.
So, the purpose of nocontent is not to prevent the included content from appearing in your CSE results but just to prevent any keywords in the included content from influencing the ranking of the results.
You can find some more discussion on this topic in the Google Custom Search support forums, for example in this thread.
P.S. There is a different product, the Google Search Appliance, which does support excluding content from indexing via googleoff/googleon tags.

How can I supply style selector to SVG (byte[]) when I use OmniFaces graphicImage tag?

Follow-up to How to embed SVG graphics properly in JSF application using OmniFaces
I'm using the OmniFaces 2.1 snapshot in order to output SVG files from byte[] arrays. I need to suffix #a on SVG URL's in order to activate a CSS style inside the SVG.
Example img:
<img src="/web/javax.faces.resource/ApplicationBean_getImageById_svg.xhtml?ln=omnifaces.graphic&v=0&p=106.1%23a">
As you can see, my #a is appended at the right side of the URL as %23a.
If this had been a regular URL it would be
<img src="106.1.svg#a" />
It would then pick the CSS style and, in my case, paint the background of this sign yellow.
I'm really hoping BalusC comes to my rescue here. Heh. :)
As per this commit, the <o:graphicImage> got a new fragment attribute. This should enable you to pass SVG view modes via URL fragment identifier. It's available in today's 2.1 SNAPSHOT.
E.g.
<o:graphicImage value="#{bean.svg(imageId)}"
type="svg" fragment="svgView(viewBox(0,200,1000,1000))" />

h:panelGrid with embedded h:graphicImage not displaying correctly

My question regards the display of h:graphicImage within a h:panelGrid
<h:panelGrid border="0" cellspacing="0" cellpadding="0" >
<h:graphicImage height="63" width="270" value="images/NewAOnly.PNG" />
<h:graphicImage height="60" width="270" value="images/NewABottom.PNG" />
</h:panelGrid>
The top .PNG file is 270 x 63 with no border area. The bottom .PNG is 270 x 60 with no border area.
My question is, with border="0", cellspacing="0" and cellpadding="0", why do the two images not sit one on top of the other with no space between them?
This will happen when you use a strict doctype. Long story short, check the article on Mozilla Developer Network: Images, Tables, and Mysterious Gaps. As to the doctype, you can fix this by using a quirks or transitional doctype (as a quick test, remove the DOCTYPE line altogether). This is however not recommended these days.
If you're absolutely positive that the table is the right tool for your concrete functional requirement of displaying images this way and e.g. a div is for some dubious reason absolutely not an option (and you're fully aware of the importance of "Semantic HTML"), then you can fix this by making the images in table cells block level elements.
td img {
display: block;
}
Please note that this problem is completely unrelated to JSF. JSF is in the context of this question merely a HTML code generator.

icefaces 3 combine ice and ace component on the same page , problems with the style

I am using ace:daaTable and other ice component on the same xhtml page .
when I click oמ ice:commandButton the page style is changing.
I tried to define "rime" style on the web.xml but it doesn't help.
when I defined "none" style
param-name :org.icefaces.ace.theme
param-value:none
the clicking on the ice:commandButton save the page style, but I am failing to change the table style to "styleClass="oddRow, evenRow" (that was the style I used on ice:dataTable in my previos IceFaces 1.8 project with"xp" style. )
can someone please explain how to define this styleClass on the table,without changing the page style on each click.
and give me an example that show how to use styleClass on the ace:component
thanks
Tami
To include rime.css you can include below line in you head section.
<link rel="stylesheet" type="text/css"
href="./xmlhttp/css/rime/rime.css" />
If you want to specify your own styleclass you can use like this.
<ace:dataTable style="width:200px; height:200px; cellspacing: 1px;
cellpadding:1px;" ></ace:dataTable>
If you want to use styleclass attribute then you specify external css and include the name.

Add special characters and background colour

I am working on validation of a user registration form. What JSF tags can I use to add special characters and background color to that registration form?
Try this it forms unique tags for you in input field:
http://xoxco.com/clickable/jquery-tags-input
http://plugins.jquery.com/plugin-tags/tags
I'm not sure what you mean with "special characters", but I assume that you mean "special fonts" or something. In general, to style a webpage you should use CSS. You can set the font type by font-family property and you can set the background color by background-color property.
First create a style.css file with the following content:
.yourFormClass {
font-family: arial;
background-color: pink;
}
Then put it in public web content (there where your JSF pages also are) and then declare it in the <head> (or <h:head> if you're using JSF 2.x):
<link rel="stylesheet" href="style.css" />
Then you can use the styleClass attribute of any containing JSF component to let JSF generate it as class attribute in the final HTML element.
<h:form styleClass="yourFormClass">
(open page in browser, rightclick and "View Source" to see it)
To learn more about CSS (which is a completely separate subject from JSF), check the CSS tutorial. Keep in mind that JSF is basically just a HTML code generator.

Resources