Search in view results causes xpage to be blank - xpages

I have a view panel in which I have the formula:
isParent = "1" set for Search In View Results.
This cause the whole xpgae to show as blank page, I have lots of other things on the page , in addition to the view panel, but nothing is displayed
What is being shown for the source of the page is:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type></HEAD>
<BODY></BODY></HTML>
ate
I am not sure where the "ate" is coming from. When page is displayed normaly, there is "corporate" displayed on the page, prehaps it is form there.
I am unable to find documentation on this property so I am unsure if I am even using it correctly but you would still think some of the page would display or at least an error.
What I will probably do is to create another view with isParent = "1" in the select frumala but it would still be nice to know why this is not working.

As this search uses the full text search functionality you have to search for
[isParent] = "1"
instead. I assume you are looking for all documents which have "1" in field "isParent".
It throws an error "Query is not understandable" if you use your original search string. I don't know why it doesn't show the error in your case. Do you use a special XPages runtime error page? It would throw an error too if database is not full text indexed.

Looks like it is:
field isParent contains 1

Related

Display pagination number on page title

Currently, I have an issue about display pagination title in Shopware, template use Twig, load pagination pages by ajax, multi languages use snippet.
Detail:
The pagination title that need to be displayed: Page "X". X is page number.
The site used multi languages site, ex: english (Page "X"), german (Seite "X") ...
For default url (ex: abc.com/category-name) or page = 1 (ex: abc.com/category-name/?p=1): Not display pagination title.
For other pages (page 2, 3, 4): Display Page 2 ...
Page items will be loaded by use ajax when click the page number.
So, I don't know what to do display the pagination title on page title with multi languages.
Can everyone help me to resolve this issue?
Thank everyone.
You can hook into this method:
ListingPaginationPlugin.onChangePage (see the source code in vendor/shopware/storefront/Resources/app/storefront/src/plugin/listing/listing-pagination.plugin.js)
And after calling the parent method, insert - for a proof of concept - code like this:
document.title = event.target.value;
This would simply show the page number in the title (but losing the original title)
I suggest you back-up the original title and just append the "Page X" / "Seite X" information to it according to your necessary logic.
Now you need the translated word for "Page" available in the Javascript code.
You could attach this as a data-attribute to the title tag in the according twig template and use the normal `|trans' filter. I am not sure if there is a better way to have translations available in Javascript code in Shopware, so I asked.

PrimeFaces Extensions CKEditor: attempts to set encoding to UTF-8 unsuccessful

Why I am using this editor:
In the past I used PrimeFaces p:editor which is however deprecated and lacks functions that the users desperately want. I cannot use the new PrimeFaces p:textEditor because of this: Primefaces textEditor: converting text to HTML with JavaScript not working.
What is it used for:
I am using pe:ckEditor from PrimeFaces Extensions in my program, in which the editor is used by the user to create an e-mail message content. Then by click on a send button, the HTML from the editor is taken and sent via e-mail to a client.
What is the issue:
When using p:editor, I got the HTML by JavaScript function saveHTML and it worked perfectly even when the text contained Czech characters (ěščřžýáíéó), I did not even have to set enconding or anything else and it worked.
Now however when user writes "V případě dalších dotazů se na nás můžete obracet každý den na telefonním čísle", the gotten HTML has the text like this:"V pÅípadÄ dalších dotazů se na nás můžete obracet každý den na telefonním Äísle" - complete rubbish that the user obviously cannot send to a client...
My research:
EDIT: Based on some comments, I tried to add the <meta charset="utf-8> and <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> but that did not help. In pom.xml I have found also this <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>, so I do not think that there is a problem in the HTML page, but in settings of the editor itself...
So I figured, that the encoding must be set especially for the editor in its config. I finally figured how to make the editor access the custom config, but nothing that I found on the Internet and added to the config worked for me:
config.language='cs';
And:
config.entities_latin = false;
And:
config.entities = false;
And:
config.basicEntities = false;
And all its combinations.
ANOTHER EDIT:
Based on some other comments here, I also installed OmniFaces and tried to solve this by CharacterEncodingFilter, but nothing changed and it is still not working.
I also found out that my problem seems to be very related to this issue: Unicode input retrieved via PrimeFaces input components become corrupted, but the accepted answer there gives 3 ways how to solve it, one is the CharacterEncodingFilter, other way is not applicable for Tomcat users (me) and the last "solution" seems to be reporting this to PrimeFaces Extensions developers (which I did: https://github.com/primefaces-extensions/primefaces-extensions.github.com/issues/756 ).
Please let me know if you know how to fix this or if there is any workaround.
PrimeFaces Extensions - version 7.0.2;
PrimeFaces - version 7.0.7
I and my colleague found out what the issue was based on the test code that #melloware provided.
The original editor p:editor, which we had been using and which we are trying to replace by pe:ckEditor, could provide us with its content in HTML only in case we used JavaScript function saveHTML.
But with pe:ckEditor, anytime the user hit the Send button, whose onstart contained the saveHTML, the saveHTML corrupted the content. Once we erased the saveHTML and took the pe:ckEditor content as it was (which is already in HTML), it was fine without corrupted characters.

Sublime Text adding additional opening tag at the beginning?

So every time I use html snippet or boiler plate with <ht + tab or enter
I get this extra opening tag? What gives?
<<!doctype html> <---- whats that additional tag at the beginning?
<html>
......
....
I got emmet installed by the way. Thanks
It's a snippet. You type html (or less), and press tab, it'll inserts all this content:
<!DOCTYPE html>
<html>
<head>
<title>$1</title>
</head>
<body>
$0
</body>
</html>
Note that if you repress tab again, it'll go to $1, and the last one is $0 (by default it's the end of the content).
So, don't type <ht, just ht, tab, and it'll insert everything for you. I really recommend you find yourself a course about Sublime Text, you're going to miss so much otherwise
That is the doctype decleration this is straight out of hte W3School docs:
The declaration must be the very first thing in your HTML
document, before the tag.
The declaration is not an HTML tag; it is an instruction to
the web browser about what version of HTML the page is written in.
In HTML 4.01, the declaration refers to a DTD, because HTML
4.01 was based on SGML. The DTD specifies the rules for the markup language, so that the browsers render the content correctly.
HTML5 is not based on SGML, and therefore does not require a reference
to a DTD.
Tip: Always add the declaration to your HTML documents, so
that the browser knows what type of document to expect.
You can read more about it here: http://www.w3schools.com/tags/tag_doctype.asp

Google search result has wrong description

my page has set description in meta like this
<meta name="description" content="My best website"/>
Until now this description was displayed with my page in google search result. Now there is totally different text from footer in my page.
Can I change it somehow to be like before?
resubmit your page (via sitemap etc) to google webmaster. Also check that content of your description tag appears on your page, Google may perhaps think that your description tag is irrelivent to your actual page content text and therefore will ignore it and just take stuff from the page itself.

WKHTMLTOPDF Dynamic Header on every page

I am trying to produce a PDF file using WKHTMLTOPDF library in NODE for a large HTML file. I need to be able to stuff in some content in the Header and Footer on every page. But the content on the header changes on every page for e.g, have custom numbering in a format like BX008761. The number should increment on every page.
First page will be BX008761, second page BX008762, third BX008763 so on..
I could find a thread which is related..
WKHTMLTOPDF -- Is possible to display dynamic headers?
the above thread states:
"you can feed --header-html almost anything :) Try the following to see my point:
wkhtmltopdf.exe --margin-top 30mm --header-html isitchristmas.com google.fi x.pdf
So isitchristmas.com could be www.yoursite.com/magical/ponies.php"
does the source value provided for --header-html option be called for every page of the PDF rendered or it is called just once for every PDF..?
Appreciate your support.Thank you.
EDIT : I have tried a sample program and confirmed that it will process the value provided for --header-html option on every page rendered with in PDF. I am using a remote service to return the HTML string as a response to the url.
Now it is displaying the html string as is, instead of decoding it.
when the service returns below string:
<html> <body> <span style="color:red" > 123 :: 0 :: 3000025 :: 634943551338828720</span> <body> <html>
then the header on every page is also same as above instead of displaying the text in red color. how do i make the wkhtmltohtml understand that the content it received from service need to be decoded.
appreciate if any one can suggest a workaround.
Thank you.
EDIT : I have used another work around to return a HTML page for the header content. I used essentially a HTTPHandler in asp.net to return a valid response and the issue looks to have addressed the core issue of having a dynamic header on every page.

Resources