Drupal 8 Multiple Page in a single view with same URL - drupal

Hi I'm trying to create a view that contains multiple Page in it. I'm using Country Path to support multi locale site. Now every node and pages works fine. It's just the one page that uses VIEWS that's not working as expected. Basically I want to view my GLOBAL page when I visit mysite.com/collection then when I visit mysite.com/en-gb/collection I'm expecting to see the UK version of the page. Now the settings of both page are identical except for their ACCESS which obviously I set one of it to be viewable only on ROOT or GLOBAL market while the other is only viewable in UK Market.
But it seems only the GLOBAL is being read and the UK is being ignored. What am I doing wrong? Any solution to fix this? I have attached the structure of the View/Page I created
This is the Page for the GLOBAL resides in the same view as the UK
While this is the Page for the UK
EDIT:
I tried changing one of the UK url in the view and instead of using /collection I changed it to /collections and it works. So how can I make it work that it will work for both domain but they have the same url path

Related

How to make the country name to be a part of the URL in Asp.net core Razor pages

We developed a website using ASP.net core Razor Pages so we have some pages in the website served through URLs like
Domain/Solutions
Domain/solutions/details/1
Domain/aboutus
and other many links of course
After completing the development the customer requested to allow the user to select the company branch before browsing the website so the home page of the site will contain multiple cards one for each branch, for Example, "Dubai Branch, USA Branch, ...."
If the user clicked Dubai Branch for example we need all the URLs to contain that branch as a parameter like following
Domain/dubai/solutions
Domain/dubai/solutions/details/1
Domain/dubai/aboutus
We need to catch "dubai" as a parameter with all the subsequent requests to filter the content of the pages accordingly and to do this change at a minimal cost, first is that applicable? how to achieve that without many changes
You can mark part of a URL as a param like that
Domain/{branch}/solutions
Domain/{branch}/solutions/details/1
Domain/{branch}/aboutus
so you will be able to read it in your razor page behind code and customer will be able to sent there anything.
you can do this using Area like dubai,usa etc but you need to create separate code for each area.
another option is dynamic routing .

Automatic subpages of custom post type pages

I'm creating a WP site for a fitness studio with a bunch of locations. I've set up a custom post type 'studio' for each studio page where we'll enter some custom field content (hours, gallery, etc). That will have urls like site.com/studio/dallas
Each studio also needs schedule and pricing subpages (dallas/scheduke, dallas/pricing). ALL of this content is pulled from an external API so I'm trying to avoid generating all of these extra pages for no reason.
What I'd like to do is have those 2 subpages set up automatically when a parent studio is created. I'll have a custom field on the main studio page to enter a studio ID #, which will tell the subpages what pricing and schedule data to load.
The goal is to make this as simple as possible, avoiding adding 3 pages (1 main, 2 sub) for each studio since there could eventually be hundreds of locations. Bonus points to have those urls work (/dallas/pricing, etc) without actually having a subpage created at all, so it's only a page for each location in the Studio page list and the subpages are just dynamic, maybe using some redirect rules for the subs.
As a visual, sitemap might be..
Chicago
-- Pricing
-- Schedule
Dallas
-- Pricing
-- Schedule
New York
-- Pricing
-- Schedule
But I'd love the actual admin page list to just be Chicago, Dallas, New York...
Thanks in advance everyone!
if anyone stumbles on this, found a solution that works perfectly at
https://www.placementedge.com/blog/create-post-sub-pages/

Custom Template & Rapido Breaks URL Paths

Outline
I have a custom type (Dexterity) called "Gallery Profile", for this type I went into the ZMI (portal_skins/custom), created a new "Page Template" and wrote a custom template for my gallery. The gallery contains a bunch of lower down images and one main image of the owner of the gallery, like a News Item view but a gallery tacked on the bottom.
The customer wants this main image to be published to Facebook when someone hits 'Share' and some more specific info in the title when published.
Work carried out
Configured a Rapido script to write the 'og:image' meta data etc HTML that is required to get this to work (the default Plone stuff only publishes the sites logo unless you're viewing one Image type).
If I go to test the HTML coming out of Rapido via direct web address it works swimmingly. (site.com/##rapido/og_share/block/og_share) - I'm on the slightly older version of Rapido hence the non-plural version of block.
The problem
If you go to my gallery page where we have applied the template, then check the HTML, all of the OG meta data is pointing to the template instead of the current page its on.
This effects queries too (if for example you're using a script to find out what images are within a folder) - it searches /my_template instead of site.com/a_folder/my_template_is_on
In the Rapido Python file I've tried things like:
context.content.absolute_url()
context.content.absolute_url_path()
context.request['URL']
context.request['VIRTUAL_URL']
context.request['ACTUAL_URL']
... and probably more as I've been at this a while.
If you're not on the custom template, it works.
To Reproduce
Create a custom template
Assign it as the default view of a folder or any type.
In your template put <div tal:replace="structure python:context.REQUEST"></div> (just to see the difference)
In your Rapido try using context.app.log() and any of the above
Refresh your templated folder while checking the logs and the output from the context.REQUEST stuff.
You will see the differences and how Rapido is having a hard time getting the URL of the page you are on even though its there.
I've always had this problem with Rapido I just tend to work around it but in this particular situation I am stumped.
So in summary
Am I being an idiot and missing something obvious?
Is this possible?
Thank you for your time.

Drupal 6 Views: selection rules and affiliate domains

I'm having a problem with a View not showing up on an affiliate domain.
There are two new domains which are both to serve up the same content as another existing domain. All content to be served resides in the Drupal database.
We have two main sites w/content, a US version and a European version. The new domains are to serve up the European site.
I added the two new domain records via the domain access module and then went through and added those two new domains to the "Publish to" for all affiliate content that was currently on the European site.
I went through Pages and modified the selection rules to include the new domains.
The particular page has a pane containing a view. That page is at the url 'xxx/press'.
On the Euro site, everything works fine. On the new domains, all content shows and menus work except on the xx/press page, the view doesn't show. The page is coming up and the header node shows so it's just the specific view.
Since that view is on a Page content-type and that Page has selection rules which specify the new domains as a means to show, I'm not sure why it's not showing up.
Is there anywhere else besides the selection-rules of the actual Page that the view is being called on that could limit when/where that View shows?
I found the answer. Too much control!! For the record, in the Views there was one language setting under Filters and the language setting of the new domains didn't match that one.
Amazing that exclusion of content occurs in so many areas and ways! It's like visiting Photoshop all over again and looking at ways to make drop shadows.

Drupal Views argument menu - sending %! to end of URL

Im building this project managment site that uses organic groups to sort and name projects.
So I have example.com/project/6. Where 6 is the organic groups views argument of %1.
What I am struggling to do is be able to create links that send for example 'gallery' to the end of the URL so example.com/project/6/gallery would show the gallery for project 6.
I am trying to create a global menu where all items would work for any organic group you may be within. So if you were within project 5 (http://example.com/project/5) the same menu item of 'Gallery' could be used to display example.com/project/5/gallery.
I have tried with all normal drupal menu methods but %1 is never accepted.
The main thing is to be able to send for example '/gallery' to the end of the URL, or use any other method to achieve this.
Hope I have explained myself correctly.
Many thanks in advance.
You can use block plus view, assuming all your gallery rests in its own custom content type, put the view inside the block while using arguments to control what is displayed.
The basic structure look like this:
Page example.com/project/6
load page project 6 normal content block
load block gallery, argument read the url end with 6,
load pictures related to that node.

Resources