I want to create landing page but with contact page
- Services [Collections]
- - service 01
- - service 02
- - ...
In my Home page, I create slider witch load short content from the service page, when I click on the slide i create a js popup with
fetch() the full content of the service page it was clicked
if I open service page with URL
site.name/service01-URL it open the page but I don’t want to open it (it must open a popup on the main page with fetched content from service01). But URL Contact page must be opened normally
- How can i check URL of the site and if URL is child of Services page - load home page and open popup.
- Maybe you have batter idea how create this (maybe unpublished all services pages and create some page with type JSON and put all services there and then fetch URL with hash parameter via js
site.name/#service01 to open popup?)
Maybe not the best idea, but you could use an extra like Redirectoid in your service pages to redirect to the Home-page. And for example add a request parameter
&urlParamString so you know what service to load on your Home-page.
Another way is the rewrite the request in the
.htaccess file or in a plugin in MODX (probably on the system event
Do the services need to be MODX resources?
Maybe you could instead store the information in a custom database table and then use something like CustomRequest.
If i will used redirect does my js fetch will be working?
And if i create database how can content manager can add/edit content?
How do you fetch the data? As HTML using the resource-url?
Maybe you have to code a custom snippet, that detects if it is an AJAX-request (
$_SERVER['HTTP_X_REQUESTED_WITH']) and only redirects if it’s not.
You’d have to create a custom manager page (CMP) to edit the data.
If you are familiar with MIGX then you could use MIGXdb for that.
thank you, i will read about it
This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.