Cookie Redirect For Multiple Categories And Subcategories Under Each Country - redirect

Would someone show me how to set cookie redirect for multiple categories and subcategories under each country? I am looking for a drop down menu for this. Thank you.
I have multiple categories and subcategories under each country. Some of the subcategories are base on that country and some are sharing the same subcategories. For example,
Country: US, Canada
mysite.com/news/localnews (content base on location)
mysite.com/health/medicine (share content)
If I go to mysite.com, select "US" and click "News/Local News" it will take me to mysite.com/news/localnews/us page. If I exit then go back to mysite.com and click "News/Local News" it automatically redirect me back to mysite.com/news/localnews/us page.
The selection of "US" will not affect mysite.com/health/medicine page, meaning both US and Canada's users can visit the same page without cookie.

Related

Webflow - Displaying values from a form on another page

I have a form that's capturing user address details, and I need to do two things with it:
As the form is filled in, to the right in a 'Summary' box I need to display some of the user inputs, eg Zipcode and Country.
In conjunction to the above, the same info that I'm displaying in the 'Summary' box should also be visible on the next page (next 2 pages in fact), as the user moves through their booking experience. The 'Summary' box should be visible on all 3 pages, showing the info from the 1st, 2nd page etc as the forms are filled in from their respective pages.
The Webflow site is a demo site to demonstrate what a user experience would be, it's not hitting any DB/CMS.
I've tried 'Multi Step Forms' from this webflow youtube video, with no joy - https://www.youtube.com/watch?v=iIvNhCeYRDg
Any help will be appreciated.

Page Access for anonymous user and with a specific group

I have a page: /events/
(a) If the user is not logged in, i want him to see a login
-> Result: Page is visible for all + Login-Element on page (with: hide on login)
(b) If the user is in the usergroup eventuser, he should see an event-plugin on the page
-> Events-Plugin is on page (with group permission: eventuser)
Everything cool for those two guys.
But if the user is a normal logged-in user (without the group eventuser) the page /events/ is empty.
How can i create a page which is accessible for anonymous users (to show a login) and is visible in the navigation for eventusers but not for standard fe_users?
Create two pages on the same level.
The first one is accessible for everyone (with "hide on login" set), the second one is accessible for the eventuser group only.
Create your login plugin on the publicly available page and set a redirect to the restricted page on successful login.
Create your event plugin on the access restricted page.
Now you need to set a redirect page for your other groups (or the other way around) after successful login, so all other groups, except eventuser will get redirected somewhere else. They won't see the events page at all.
hth
You need to create two user group eventuser and websiteuser.
Now you can redirect user on specific page using redirect option in group configuration.
If user assign websiteuser gruop then you can redirect it's your site home page and eventuser group redirect to event page.
See below screenshot.

CQ5.6 - CUG enabling for protecting pages breaks other components

We have implemented login functionality like geometrixx site in our existing website(with close to 700+ pages).
We want to show protected pages only to logged in user, every user who is registered gets assigned a group/ CUG lets say "listed users".
now in page hierarchy I have products page and under product page I have 8 products pages.somewhere On homepage I have a nav bar component which fetches all product children pages and shows a left nav bar with 8 entries.
If I enable CUG in a way that only "listed users" should have access to 2 out of 8 product pages, any access to direct links are redirected to login page. Which is fine.
But the nav bar component which earlier used to show all 8 product pages now shows only 6 pages.
The main idea behind putting pages behind login is lead generation.So if non logged in users dont see the link itself where would they click to get redirected to login page and subsequently feel like registering with our site.
Requirement is that my existing nav bar should continue showing 8 links and on click of 2 protected page links, he should get login/ register option.
We are using most of things Out of the Box.
any pointers helping in how do we achieve this would be great help ? PS: i have given a nav bar as one such component affected in existing site like this there could be many more components fetching their content from site hierarchy and stand chance to get broken in such case.
There are two entities involved, JCR and Sling.By default any un-authenticated request is associated with a user called Anonymous, the JCR sessions will have ACL's associated with anonymous.
In JCR, if a user does not have access to nodes, that session will not see those nodes.We access the JCR via Sling ,by default if you don't have permission the request will result in a 404 error(because for underlying JCR session the resource does not exist). Sling can be explicitly instructed to request for authentication for specific paths.
The combination of these concepts are leveraged to create the CUG functionality. Sling is instructed to force for authentication for CUG enabled pages. The JCR is instructed to show these nodes only for users who have access.
When you directly request the product pages without login, it is sling that is redirecting you to login page. When your navigation component is looping over nodes to create the menu for anonymous users JCR is only showing it 6 pages as the other two are out of reach for anonymous.
The only* way to work around this is to make the Navigation component configurable. Instead of node iteration, the content author will have to configure the the url and page title so that the links show up for everyone.
You can ignore the session associated with the request and use a custom JCR session that has access to all the product pages, but that would be disregarding the ACLs and you don't want to do that .
The nav bar can pick up all child pages as per page structure. That should not restrict the page title display on the nav bar.
As for the pages the access can be controlled by template level page properties by adding the 'listed users' group over there. In the jsp you can give an initial check for the user if they are a member of 'listed users' else redirect to login page
Hope that helps
Thanks for all your suggestions
Below is how we ended up doing it.
- Protect the page you want to enable CUG with proper CUG.
- Hide the page in nav.
- Create a redirect page in same hierarchy with same title as the one you wanted to protect.redirect it to your protected page.

How to use default Rating component?

For some e-commerce project, I would like to give the online shop customers the possibility to rate the merchant products (something like product rating in amazon). I have found out, that there is a AEM6 Default Rating Component. Can somebody give me a guidance how to use the Default Rating Component?
When you double click on the placed Rating component, an edit dialog opens up.
You can configure the Rating component to either allow users to submit a rating or show the average results of ratings already submitted.
Select the Display Only option. If checked, the Rating component will only display the average ratings submitted for the page. If unchecked, it will allow users to submit ratings for the page by clicking on the stars. Default is unchecked.
To can see the full guide about the rating component here

Display pages tree

I have problem with showing tree of display pages in display pages section of web content creation form.
I created some pages with asset publishers on them. I set these publishers to be the default asset publishers for these pages. I created these pages and asset publishers under role admin. When I open display pages section in creation form of any web content it shows me site map where can I see pages on which is asset publisher, see image:
You can see that black color is for pages with asset publishers.
But when I login with another user I cannot expand this tree. The only thing I can see is "1st level" of this site map:
I tried to add all possible rights to this user, all possible rights to any resources but without assigning role "administrator" for this user I cannot browse this tree.
When I click on little "plus icon" in this tree I can see that it is making request on "/c/layouts_admin/get_layouts" but in request I can see only html which is telling me that I haven't sufficient roles to obtain right content.
I made some investigation. I tried to make request under this user from jsonws api ("/api/jsonws?signature=%2Flayout%2Fget-layouts-6-groupId-privateLayout-parentLayoutId-incomplete-start-end"). I tried the same method with same parameters as they were in request from site map tree and it returned me right content.
So from "Choose Display Page" window it tells me that I haven't good role but when I call api from jsonws with same parameters it returns me good result. Where can be problem?
Thanks,
Patrik
Hi dear Add this Snippet in com.liferay.portal.struts.PortalRequestProcessor.java
processRoles(HttpServletRequest, HttpServletResponse, ActionMapping)
After user O bject is Created.
if(user!=null){
if(path.equals("/layouts_admin/get_layouts")){
return true;
}
}