MODx Revolution Multidomain/Contexts same content - modx

I have a MODx website. It has 3 different contexts. Each context point to an other domain.
In one context (lets say it is C1), I have a resource (a folder) that has many child resources.
I display the resources with a pdoresources-call (frontend). Everything works fine. It lists/display the resources as it should be. When I click on it, it open as well and show me the content of the resources (The site ist something like a block)
But when I go to an other context (C2) and make the same pdoResources-Call
it lists/display the resources as well. But when I click on the resource nothing happened. It do not open because it is another context.
How can I setup MODx Revolution to have different contexts that all can share content (Resources)

If you organize your resources in a tree with each domain as its own branch, you should setup a single "Start ID" for each context. That happens in the context settings (via main menu).
The full process is beeing described here: https://black-pixel.net/2014/02/24/multilingual-multidomain-site-modx-cms/
Maybe you have to call the PDO-Tools call uncached. Or to make sure, place the call into a chunk, duplicate it and place the context key into it (to have 3 different calls, one per domain).
[[$subtree-call-C1]] for C1 etc...

It sounds like it may be pointing you to something like seconddomain.com/parent/child.html while it should be pointing to firstdomain.com/parent/child.html. If that's the case, you should make sure that each of your contexts has the site_url (and related http_host and base_url) context settings, so that MODX knows to send you to a different domain.

Related

How to create multilanguage MODx website with unique articles in each language?

I need ti develop multilanguage webiste with (russian, english and kyrgyz languages), each article has version only in one language.
Can you please help me with questions:
1. how to create context for kyrgyz language? is it just put culturekey=kg?
2. how to translate oarts of chunks, i.e "comments" or buttons? do I need to create different chunks for new contexts? Or I simply save translation somewhere?
3. how to control which resources will be shown through pdoresources (getresources)? do I need to put id from all contexts?
4. for context web — pages has alias mywebsite.ru/category/article, but for "en" context — mywebsite.ru/en/INDEX/category/article. how to remove index? when i try to use link like mywebsite.ru/en/ — it shows 503 error. what can be the problem?
Thanks!
Create new context
Use lexicon entry. If you don't want to create a new namespace, just use core.
If you read the documentation, you can see the available parameters to define the parent, resources, or excluded resources to show.
You need to check your .htaccess and all friendly URL settings. 503 itself means unavailable site. Check your system settings, and search for site_status key. It should be "yes" for a running website.

ModX: Duplicate entire site for testing new template?

I want to test a new template & CSS for a site redesign.
Is there any "easy" way to do this?
I'm not familiar with Contexts. Theoretically I'd like to duplicate the main context, then experiment with it ... but how can I access it without having to mess around with subdomains, htaccess, etc.?
Is there any way to "go" to a 2nd context via simple URL?
E.g., say our "live" site is at "www.foo.com" ... I want to duplicate that context, call it "testing", then be able to navigate to the root of the 2nd context with "www.foo.com/testing".
So the duplicate of "foo.com/container/page" would be at "foo.com/testing/container/page" in the 2nd context.
Your best bet is to create a completely separate ModX instance. Contexts serve a different purpose.
On this instance you can edit your existing templates, TVs, chunks, etc. without affecting your master instance, overloading it, nor putting it at risk (specially if it's production). Once the test instance is ready you can easily copy over those edits to your master instance.
In summary the steps would be the following:
Create a new ModX instance and copy data (DataBase & files) from the master instance.
Configure, edit and test your new ModX instance: test.domain.com
Copy over the edits to the master instance following the same guide on step 1.
If you want to have more control over what gets imported and exported on steps 1 and 3 you can use the tool Teleport and check out this video tutorial.
If you use ModX Cloud steps 1 and 3 are easier to accomplish.

Modx Rev - Manager not showing all documents in list

I have worked with ModX for a while, but can't seem to sort this issue. When I login as the admin in to the manager, the resources list is incomplete with not all documents displaying. I can however locate the files via the 'search' area just above.
I have done the normal, empty cache, flush permissions etc. without any joy. Interesting enough its always the same files, and they are showing in the front end.
Any help welcome on this one!
Update
When I click the blog (which is an articles resource) only the template variables panel is showing, nothing else. Page looks a little broken...
Update 2
If i remove the blog, (articles) the pages show. And... If I move the articles container higher, all resources show.
Are you using multiple contexts? I've noticed this behaviour a few times when drag and dropping folders with nested resources from one context to folder in another context.
Moving them back to the original context made them re-appear.
If you're familiar with MySQL GUIs like phpMyAdmin you could check and search the *modx_site_content* table and maybe correct the value in the resources' parent field manually. As Mark said it might well be a parent gone MIA.
Typically, parents rarely go MIA and by that I mean once every couple years....
Did you set up ACLs or Resource Groups?
Is your manager user a member of those groups?

How do I hide Drupal nodes that shouldn't be directly accessed from users and search engines?

I have seen many somewhat similar questions, but nothing quite what I'm looking for. So at the risk of being told this is a duplicate... here it goes.
I've found that there are times I have a node that simply contains content that will be displayed somewhere else, but shouldn't be viewed directly. That is, no one should ever go to node/1234, but the content in node 1234 should be displayed somewhere else.
For example, I create an about page with tabbed content using views. So there are "About Me", "About Us" and "About Them" pages. All of these are displayed in a single page with tabs using Views. So I don't want people to get directly to the "About Us" node because then they wouldn't see the tabs for the other pages. At the same time, I don't want Google giving people a direct link to this node, I want to limit access so users can only get to it through the View (i.e., the tab).
So I need to restrict access to the node, remove it from the Drupal search results, and make sure Google doesn't pick up on it. Any suggestions?
---- Note ----
I've accepted the answer from mingos (thanks btw) because even though it's not a full answer / solution, it gave me some good things to think about. Additional answers are still welcome.
In Drupal 7 you can use: http://drupal.org/project/internal_nodes
Description: Some content/nodes should never be viewed directly; only visible be through something else such as Views or Panels. This module denies access to node/[nid] URLs while allowing the content to stay published and otherwise viewable.
Full disclosure: I am the creator and co-maintainer of Internal Nodes. I found this question while searching to see how the module could be found on Google.
Tough one.
If you want to have many nodes like this and do the "displaying elsewhere" dynamically, I can't think of anything right now (at 2:20 AM I rarely can).
If there is onne such page (or very few), I'd restrict access to it by any available means (Permissions, Nodeaccess, Content Access, TAC, whatever) and then create special themes for the pages where the restricted content should be displayed. The themes would contain database queries, fetching content from the restricted nodes.
Other possibility might include creating a special theme for the hidden nodes in question (perhaps all belonging to the same content type?). Make full node display nothing (or a message saying the access is restricted) and add a ROBOTS meta tag asking Google not to index the page. Make the teaser view available though - you can display it freely inside a view, but since /node/1234 is the FULL view, the actual content will be unavailable here.
Dunno if this solves your problem, hope it helps at least a bit.
I found this page after running into this same problem.
What I found worked for me might be part of the answer you need:
Take a look at the Page Manager Redirect Module http://drupal.org/project/page_manager_redirect . I just started playing with it.
It uses the Page Manager module of CTools to redirect one page to another. What makes this most powerful is that Page Manager uses Contexts. So, if you want to redirect all pages of a particular content type, you can do so.
I just started to use it (instead of Taxonomy Redirect and Path Redirect) to redirect (301 response code) my taxonomy terms for a particular vocabulary to particular nodes.
In your instance, you should be able to use contexts to filter for specific pages.
Of course this doesn't solve the problem of these nodes coming up in search results.
There is also another module Rabbit Hole which has a similar functionality like Internal Nodes but works for all entities, not only nodes.
I am having the same problem, and are currently thinking of the following solution where all the content of a node is to be displayed to certain users (permission based):
- unpublish node
- create a new published checkbox
- create a view with fields that shows alle the content
Haven't tested it thoroughly yet, but it seems to work.
The node is to be displayed to the creator (only one in permission 1), some of it to permission 2 and all of it to permission 3.
Any comments on this solution.
I assume this will also exclude it from search, but permission 2 and 3 needs to be able to search it. Still haven't figured that one out.
I used Rules module with an "entity is of bundle" and the built-in "Page redirect" action.
There is a really easy way to do this if you only want to show a content type through a view.
create a content type as and make it unpublished.
create a view and on the filter option set the filter to "Content: Published (No)"
the view will give anon users access to the content through the view but they won't have access to the unpublished content at the direct link to the content.

How To Intercept All WordPress Queries and Restrict to Category?

In WordPress plugin coding, if I have two categories (cars and gardening) and I want to always exclude gardening from all queries, what is the intercept (hook or other trick) I need to do to do this? I need to always exclude gardening whether it be via search, tag cloud widget, comment widget, calendar widget, and any other portion of the website.
The reason I ask is that my client needs to have a single theme react differently by domain name coming in. If the user types gardening.com and it's mapped to this blog, then he wants to restrict to show only gardening.com content. If the user types cars.com and it's mapped to this same blog, then he wants to restrict to show only cars.com content.
Said again, my question lies in the area of wanting to hit one central place of WordPress with a plugin hook to always ensure the queries are restricted to a given category. That way, even if a new plugin is added that's not a default coming with WordPress, it will also be restricted by category too.
I have already figured out how to slip this code in the header.php of a theme to make the links act properly depending on whichever URL someone types in:
$sURL = 'http://' . $_SERVER['SERVER_NAME'];
update_option('siteurl',$sURL);
update_option('home',$sURL);
unset($sURL);
I found I had to create a home.php that was a copy of index.php, but tack on a query_posts('category_name=' . $_SERVER['SERVER_NAME']) call before the have_posts() call. On index.php, I left it alone and didn't add the query_posts(). Then, I had to make an archive.php that was a copy of Kubrick's archive.php, and then edit that so that I change query_posts() differently depending on what was chosen to do, such as add "&tag=", "&year=", etc. As well, a search.php had to be added (borrowing from Kubrick) that did a restriction too by category. This was a big help:
http://codex.wordpress.org/Template_Tags/query_posts
The only thing I haven't figured out yet is how to restrict widgets in the dynamic sidebar to a category. I'm making that into a separate request in StackOverflow.

Resources