Liferay DXP 7.2 - Check if User is on a Content Page or a Widget Page - liferay-7

is there a way to check if the user is on a Widget Page or a Content Page? Maybe some kind of variable that describes the page type, I'm looking in to the documentation but can't get any useful info around it

I found out how to do it, using the themeDisplay Object as follows:
themeDisplay.getLayout().type

Related

why wordpress facebook widget show only in russian?

from any country i am accessing the website i see the widget in Russian language
on link: website
the widget on the on the bottom is facebook widget.
anyone run into this same problem?
You are not the only one. There was a thread about his exact problem on the Wordpress Support site
The iframe src attribute on that site contain locale=uk_UA in the query string. If you have control of that, simply remove that field, and the widget locale will default to the user's browser setting.
Compare locale specified vs unspecified

How to call wicket page from servlet

My application is mixed of wicket and jsp page . In my case i have to call wicket page from servlet with some value in request object . could someone please explain as how to achieve this. Thanks
What do you mean 'call a wicket page'? Do you mean load a wicket page to the user after he performs some action on the servlet-loaded page?
What exactly is your use case for this?
I think it would be better NOT to mix jsp and wicket, but given that you did:
BookmarkablePages provide a way to directly address a wicket page as it has a bookmarkable url (for instance, /home instead of /page?13). We use those to load a certain page with certain request parameters (ie, /student/1234/results shows the resultpage for student 1234).
Also, you could implement some kind of listener service that, based upon a certain call/payload, constructs a wicket page and returns the url for that page but that seems a bit overkill. In most cases I think bookmarkable pages a should suffice.
Have a look at http://wicket.apache.org/apidocs/1.5/org/apache/wicket/protocol/http/WebApplication.html#mountPage(java.lang.String, java.lang.Class)
or
http://wicketinaction.com/2011/07/wicket-1-5-mounting-pages/

How to intercept error request and redirect to a custom page?

Here is one of the use-case as to what I want to do:
A User clicks on a blog-link or directly pastes the blog-link in the URL
The blog portlet is on the private-page of a Community (Site).
Since the user is not a member of the Community (Site) he would be taken to the error page.
He is shown, either a 404 page or a No-access error page.
My requirement starts: Now instead of showing the above pages or a customized version of the above pages.
I want to Intercept the request for 404 or other such requests.
And redirect to a portal page (not a static error page) based on some parameters of the User and the initial request parameters.
In this case I would want the user to be redirect to any public page of the same Community (Site) and ask him to Join or request membership for that Community (Site).
So in short I would want a way to intercept the request which generates the error and then redirect to where ever I want.
Is this available in liferay? If not can I get some idea as to how can I achieve this?
Environment: Liferay 6.1 GA2
Thanks for your valuable time.
Add a JSP page to manage 404 errors as described here in that Liferay's forum post.
In that JSP you can put your custom logic based on whatever param (the user, the community, etc..) that you can access from inside the JSP using, for example, the themeDisplay object.
An alternative way (and the way I have redirect 404 errors to a specific page in the community) is to override the 404.jsp with a Hook. Then add your custom logic to the overridden JSP.
I'm assuming something similar could be done for no-access.

Is there a possibility to hide the "buy" link in the Soundcloud HTML 5widget?

We'd like to embed Soundcloud in articles about artists using Soundcloud. But since we are a public radio station - we are not allowed to link to online stores. Is there any parameter that hides the "buy" link in the HTML 5 widget?
Yes, you need to use buying=false GET parameter when inserting widget. You can see all possible parameters for the widget here.

customizing the facebook registration widget with javascript

Is anyone aware of any restrictions Facebook places on modifying the look and feel of their registration widget?
We'd like to use the FB Registration widget on one of our pages, and then use jQuery to hide certain divs, text, etc. to make it a bit more compact and fit aesthetically better into our site.
Is is 'legal' or acceptable to do? I'm attempting to read through all of their documents to find out, but if someone already knows, that would really help.
tia
Facebook uses iframes to load the registration plugin on your website. So there is no way you can change the looks of it with css or jQuery.
You can just customize however you want according to guidelines present here.
https://developers.facebook.com/docs/guides/web/