The Facebook sharer's "locale" parameter doesn't work - locale

Until now, when i want to share something in Facebook with a specific language(for example, french), i use the locale parameter, like this:
http://www.facebook.com/sharer/sharer.php?locale=fr_FR
But now, the Facebook sharer ignores the locale parameter in the URL and always display the share pop up with the user language.
Anyone knows anything about?

As far as I know, the facebook sharer always uses en as the default locale to parse your website. But if you want to share your own website, there is a workaround to show the locale as you wish.
If you want to share the link: http://www.yourwebsite.com/something with different locales:
Add a parameter to pass the locale information: http://www.yourwebsite.com/something?l=fr_FR and share this link with the sharer.
Your website change its locale according to this parameter.
Not pretty but it works.

Related

Instagram URL tracking parameters

For example, if you get a link to your profile in the Instagram app, you can use the with the parameter igshid. What does this mean?
From what I've found, I believe it's a tracking parameter, but should I remove this parameter when embedding it in the web site?
Please let me know if you have any documentation or sites on this parameter.
It is most likely used to track the user's account in which the embed or link was generated from. There is no official documentation or information on it, nor does there appear to be any benefit to using it.
Since it's an optional parameter, you're best off eliminating it if you do not want to be tracked.

Liferay static url for dynamic data

I want to serve some data from an static url in Liferay. For example, say to serve a json containing the logged user from "http://server.com/whatever/user" so all the portlets in the proyect can read it. Right now I can do it with a portlet, but then I have to set the url with the configuration panel and I don't like that.
I've seen that I can put jsp files with the static content, but don't know how to access the information of session, users, etc.
Friendly urls seem to accomplish something similar but seem overly complicated and focused in getting a short easy url, something I don't care.
So, how can I get some internal data in an static url (I don't mind if it's friendly, long or short, but always the same) so every element of a Liferay proyect can read it?
FOURTH EDIT: Another way to put it...
In my eclipse I have this tree:
/whatever-war/docroot/html/fancy-porlet/list.jsp
How do I access that jsp in a browser without having to go the Liferay panel and putting the portlet in the menus of the web?
FIFTH EDIT: I haven't had the time to research any more, but I have this in my notes...
https://server/language/c/portal/layout?p_l_id=plid
This goes straight to the portlet, sometimes. plid comes from
PortalUtil.getPlidFromPortletId(themeDisplay.getScopeGroupId(), name_of_portlet_and_war)
It's no solution for me because, it doesn't always work. Sometimes you get a numeric identifier, sometimes you get a zero. I'd bet on the name of portlet and war being incorrect so it doesn't find the portlet, but then, how do you find the new name of the portlet? Sadly, I discarded the code where the name came from, but is coming from Liferay.
SIXTH EDIT: What I want to do is to be able to call a fixed url, with some data internal to Liferay, and get information based on that data back.
There are several aspects here:
Every portlet already has access to the user through a request attribute called ThemeDisplay:
ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
Check ThemeDisplay's interface for the various options that you have in order to get the current user's id or object.
You've asked about JSON delivery - this will need to go through Liferay and not (directly) through a JSP in your individual web application. The reason is that any request processed by Liferay will contain the user's information, but as any proper webapp, it's completely separate from any request directed at another webapp: Unless included by Liferay, your JSP will have a different session that has nothing to do with Liferay's session. (I hope this explanation makes sense)
If you write a servletFilter hook, you might not yet have the portal context initialized (Liferay 6.x has been a while for me, pardon for being vague here). If you're on the portlet side, you might have to do more than you expected.
One option that you have is to embed a portlet on every page, automatically (e.g. when it's deployed, it's available). You can configure a portlet to be automatically included on every page, it's done for the chat portlet, for example. That portlet does not need to have any UI, it just needs to expose its resourceURL, so that you can use it from everywhere.
However, I somehow doubt that you use it, given that every portlet has the information already at hand.
But I might also just not understand all of your requirements...

API to get the list of all search providers/engines?

I am developing an Opera extension. At some moment it allows the user to perform search. Now I use chrome.tabs.update with { url: `https://google.com/search?q=${encodeURIComponent(query)}`}. This is not user friendly. The better approach is to maintain a user-editable list of URLs like https://google.com/search?q= or https://ca.search.yahoo.com/search?p= in the extension's options page and allow the user to choose between them, but I really don't want to reinvent the wheel.
Chromium-based browsers all have user-configurable search engines/providers, and I want to allow the user to choose between them or just use the default. To make that possible, I basically need two API functions:
a function to get the list of all configured search engines;
a function to get the default engine.
I didn't find anything similar to my problem in the API docs.
BTW, Opera also has an undocumented chrome.search function (Chromium has none), but it always searches via Google regardless of the user's default search engine setting.
Thanks.
PS. If there is a more appropriate place to ask this question, please tell me.
I didn't find anything similar to my problem in the API docs.
Because there isn't one, unfortunately.
There is a relevant old feature request with no real activity.

Making short url for doctor profile

I have made website using JSF 2.0 and MySQL.
I have one page where I am showing doctor profile:
http://www.example.com/faces/doctorProfile.xhtml?profileName=drrajesh
What my client is asking is one of the following:
http://www.example.com/drrajesh
http://www.example.com/faces/drrajesh
They want it like Facebook/instagram.
Any idea how this can be done in JSF?
Note: I want this for this specific page only and not for whole website.
Even if I get url as below is fine with me.
htttp://wwww.mywebsite.com/doctorprofile/drrajesh
Edit 1
While research I found below link
http://ocpsoft.org/prettyfaces/
but I am not sure how can I use in my case.
This is useful for static url change, but in my case it is different. My url is dynamic.

Liferay: How can I set a specific layout for Terms of use content, the page shown after an user registered

Using Liferay 6.2, I try to workaround to set a specific layout for the Terms of use, shown after an user registered to the portal, and also Verify Email Address page after the user clicked "Agree" under URL /c/portal/....
I would like to have these pages showing with a look and feel I created. For example, I have created a layout called "1_column_white" in the theme I am using for this site and would like to assign to these pages (Terms of use and Verify Email Address). I did try to overwrite property in portal.properties but there is nothing come up.
Please kindly give me an advice.
Regards,
Create a Liferay hook as explained here to modify /portal-trunk/portal-web/docroot/html/portal/terms_of_use.jsp file as per your requirement.

Resources