MODX 101 - MODX Community Forums <![CDATA[ACL Context problems]]>

I started installing MODx for some domains. My structure is as follows:

- root (MODx web context) -->
- subdomains/members -->
- core

Changing the structure was no problem, because of the really nice documentation, but I have one problem I couldn't solve on my own:

The regular behavior of the web-context is:

- Show all pages including unpublished pages, if the user is an admin (and logged in, of course).

The behavior of the context, let's call it "members" is:

- If I try to view a page in the frontend while I'm logged in as admin while the page is OFFLINE (site_status of the context = No), I only can view the error page.
- If I try to view a UNPUBLISHED page in the frontend (again, logged in as admin) and the page / context ist ONLINE, I get redirected to the "unauthorized_page"

I already followed the suggestions from

Any ideas?

Thanks for the help!

]]> Sun, 10 Mar 2019 06:39:15 +0000
<![CDATA[404 Error Notification MapRequestHandler Error Code 0x80070002]]> This is Modx 1.0.6 with PHP running through IIS 7 on a Windows 2008 r2 server.

The site has run fine for about 4 years, and in fact there are two other sites running on the same server that currently have no issues.

I can see that instead of it displays (that's just an example). If I type the id number in manually as above, it just kicks back out to the home page.

There are no problems with the server, and no error messages with either PHP or the Modx manager.

Thank you for your help.]]> Tue, 19 Feb 2019 03:49:41 +0000
<![CDATA[Fatal error: Uncaught --> Smarty: Unable to load template file 'header.tpl']]>
I've just installed MODX and very new to it. I followed the setup as per the instructions and managed to reach the "Congratulations!" page. However, when I click the "Go To Manager" button, I get the following error:

Fatal error: Uncaught --> Smarty: Unable to load template file 'header.tpl' <-- thrown in /Applications/XAMPP/xamppfiles/htdocs/modx/core/model/smarty/sysplugins/smarty_internal_template.php on line 219

Since I am not 100% familiar with the structure or layout of the CMS, is there something I may have missed?

Thanks in advance
Michael]]> Wed, 17 Oct 2018 05:24:15 +0000
<![CDATA[How to create a multilingual site (with front-end language switch)?]]> I've tried googling this, but I feel like I'm not familiar enough with modx and its terminology to really understand the search results. Hopefully some of you can tell me if what I'm looking for is possible. (Also, I haven't gotten around to installing modx yet due to hosting issues, so please excuse the vagueness.)

I'd like to build a site where there is a front-end langauge switch (like an English and a Danish flag in the upper right corner e.g.). I've read something about the lexicon, which I assume I could use to change the menues and such?
But how do I make it so that, when the user creates a new post (document) in the manager, there'll be both a Danish and an English content field (preferably right next to or below eachother)? I'm not looking for an automatic translation, but instead the option to write our own translation as well as being able to post different things depending on language chosen (since not everything is relevant to non-Danish speakers).

Is there any extras that does this (and if so, which ones)?]]> Sun, 08 Jul 2018 10:18:05 +0000
<![CDATA[MODX diagnostics]]>
Steve]]> Mon, 29 Jan 2018 08:07:05 +0000
<![CDATA[multiple &where]]>


Current I have this but I would also like to display if the template is 17 or 44.

How do I do that?

Thanks!]]> Tue, 31 Oct 2017 02:05:11 +0000
<![CDATA[Total Noob here. Need help with forms. Employment application returning "blank" as value, rather than what user entered.]]>
Totally new to Modx, and from the looks of it, the new company I am working for is using an older version of Modx.

I have been asked to fix a bug with our website in which a prospective employee fills out an online employment application, but the "Position" field shows as a value of "blank" when the form's contents are mailed to HR.

Also, how do I add an image to the auto-reponder (the email that gets sent to a prospective employee when they submit an online application)?

Again, I am very familiar with HTML, CSS, Javascript, but MODX is completely foreign to me and I don't even know where to begin.

Any assistance is great appreciated.

-Rob]]> Wed, 04 Oct 2017 05:52:26 +0000
<![CDATA[Unable to save changes to Chunks!]]> Any suggestions on a setting I might be missing??]]> Tue, 15 Aug 2017 08:37:52 +0000 <![CDATA[cURL to external API within MODX?]]>
Client has asked me to write an API integration to thier CRM.

The code I have written works fine outside of MODX and I get a response from the API as expected. However when I place it into a snippet, whilst the POST information is grabbed successfully and the XML is populated I don't get any response from the API (As if the cURL even doesn't happen)!

I have checked phpInfo and cURL is installed. I'm just wondering if the Snippet is allowed to use cURL and handle responsed.

I'm relatively green at MODX, so any points in the right direction would be great!

Excuse the long XML.

$salutation = $_POST['greeting'];
$fname =  $_POST['fname'];
$lname =  $_POST['lname'];
$email = $_POST['email'];
$tel = $_POST['tel'];
$add1 = $_POST['add1'];
$add2 = $_POST['add2'];
$add3 = $_POST['add3'];
$add4 = $_POST['add4'];
$enq = $_POST['enquiry'];
$coinsID = $_POST['coinsid'];

$date =  date('c');
$date2 = date('d-m-y');

$xml = '<COINSInterface>';
$xml .= '<Header action="CREATE" entity="HSESB042" testMsg="false">';
$xml .= '<UserID>1</UserID>';
$xml .= '<From>WEB ENQUIRY</From>';
$xml .= '<HostName>**REDACTED**</HostName> ';
$xml .= '<Environment>cplive</Environment>';
$xml .= '<Created>' . $date . '</Created> ';
$xml .= '<Login> ';
$xml .= '<User>**REDACTED**</User>';
$xml .= '<Password>**REDACTED**</Password>';
$xml .= '<CID>3</CID>';
$xml .= '</Login> ';
$xml .= '</Header> ';
$xml .= '<Body>';
$xml .= '<hs_visitorRow>';
$xml .= '<externalID></externalID>';
$xml .= '<hvi_ref>1</hvi_ref>';
$xml .= '<hvi_level>S</hvi_level>';
$xml .= '<hvi_sprice>99.99</hvi_sprice>';
$xml .= '<hvi_eprice>99.99</hvi_eprice>';
$xml .= '<hvi_status>HTB</hvi_status>';
$xml .= '<hvi_init_movepd__1></hvi_init_movepd__1>';
$xml .= '<hvi_init_movepd__2></hvi_init_movepd__2>';
$xml .= '<hvi_sdate></hvi_sdate>';
$xml .= '<hvi_edate></hvi_edate>';
$xml .= '<hvi_pxplot></hvi_pxplot>';
$xml .= '<hvi_req></hvi_req>';
$xml .= '<hvi_req2></hvi_req2>';
$xml .= '<vud_code></vud_code>';
$xml .= '<vud_code2></vud_code2>';
$xml .= '<hvi_beds__1>1</hvi_beds__1>';
$xml .= '<hvi_beds__2>1</hvi_beds__2>';
$xml .= '<hvi_location></hvi_location>';
$xml .= '<hvi_location2></hvi_location2>';
$xml .= '<hvi_specreq></hvi_specreq>';
$xml .= '<hvi_nomail>true</hvi_nomail>';
$xml .= '<hvi_noemail>true</hvi_noemail>';
$xml .= '<hvi_nosms>true</hvi_nosms>';
$xml .= '<hvi_cmix></hvi_cmix>';
$xml .= '<hvi_cdesc></hvi_cdesc>';
$xml .= '<hvi_cvalue>99.99</hvi_cvalue>';
$xml .= '<hvi_built>1</hvi_built>';
$xml .= '<hvi_pxadd__1></hvi_pxadd__1>';
$xml .= '<hvi_pxadd__2></hvi_pxadd__2>';
$xml .= '<hvi_pxadd__3></hvi_pxadd__3>';
$xml .= '<hvi_pxadd__4></hvi_pxadd__4>';
$xml .= '<hvi_pxpcode></hvi_pxpcode>';
$xml .= '<hvi_pxreq>true</hvi_pxreq>';
$xml .= '<hvi_reasonMove>DESIGN</hvi_reasonMove>';
$xml .= '<hvi_init_htr_sourceEnq>EST99</hvi_init_htr_sourceEnq>';
$xml .= '<hvi_toreview>true</hvi_toreview>';
$xml .= '<rsp_action>I</rsp_action>';
$xml .= '<pp_personRow>';
$xml .= '<externalID></externalID>';
$xml .= '<ppp_intref>99</ppp_intref>';
$xml .= '<ppp_title>' . $salutation . '</ppp_title>';
$xml .= '<ppp_fname>' . $fname . '</ppp_fname>';
$xml .= '<ppp_sname>' . $lname . '</ppp_sname>';
$xml .= '<ppp_add__1>' . $add1 . '</ppp_add__1>';
$xml .= '<ppp_add__2>' . $add2 . '</ppp_add__2>';
$xml .= '<ppp_add__3>' . $add3 . '</ppp_add__3>';
$xml .= '<ppp_add__4>' . $add4 . '</ppp_add__4>';
$xml .= '<ppp_pcode></ppp_pcode>';
$xml .= '<ppp_dob></ppp_dob>';
$xml .= '<ppp_occupation></ppp_occupation>';
$xml .= '<ppp_employer></ppp_employer>';
$xml .= '<ppp_empadd__1></ppp_empadd__1>';
$xml .= '<ppp_empadd__2></ppp_empadd__2>';
$xml .= '<ppp_empadd__3></ppp_empadd__3>';
$xml .= '<ppp_empadd__4></ppp_empadd__4>';
$xml .= '<ppp_emppcode></ppp_emppcode>';
$xml .= '<ppp_salary></ppp_salary>';
$xml .= '<ppp_bonus></ppp_bonus>';
$xml .= '<ppp_service></ppp_service>';
$xml .= '<ppp_hphone></ppp_hphone>';
$xml .= '<ppp_wphone></ppp_wphone>';
$xml .= '<ppp_mphone></ppp_mphone>';
$xml .= '<ppp_salutation></ppp_salutation>';
$xml .= '<ppp_email>' . $email . '</ppp_email>';
$xml .= '<ppp_consent>true</ppp_consent>';
$xml .= '<ppp_conmeth></ppp_conmeth>';
$xml .= '<ppp_contime></ppp_contime>';
$xml .= '<ppp_resident>true</ppp_resident>';
$xml .= '<ppp_lcertref></ppp_lcertref>';
$xml .= '<ppp_photoid>true</ppp_photoid>';
$xml .= '<ppp_proofadd>true</ppp_proofadd>';
$xml .= '<ppp_account></ppp_account>';
$xml .= '<ppp_sortcode></ppp_sortcode>';
$xml .= '<ppp_iban></ppp_iban>';
$xml .= '<ppp_swift></ppp_swift>';
$xml .= '<ppp_bankname></ppp_bankname>';
$xml .= '<ppp_bankadd__1></ppp_bankadd__1>';
$xml .= '<ppp_bankadd__2></ppp_bankadd__2>';
$xml .= '<ppp_bankadd__3></ppp_bankadd__3>';
$xml .= '<ppp_bankadd__4></ppp_bankadd__4>';
$xml .= '<ppp_bankpcode></ppp_bankpcode>';
$xml .= '<ppp_taxable>true</ppp_taxable>';
$xml .= '<ppp_hold>true</ppp_hold>';
$xml .= '<ppp_hnote></ppp_hnote>';
$xml .= '<ppp_paymeth></ppp_paymeth>';
$xml .= '<vat_code></vat_code>';
$xml .= '<ppp_thirdparty>true</ppp_thirdparty>';
$xml .= '<ppp_password></ppp_password>';
$xml .= '<ppp_logindate></ppp_logindate>';
$xml .= '<ppp_logintime></ppp_logintime>';
$xml .= '<ppp_agent>true</ppp_agent>';
$xml .= '<ppp_accname></ppp_accname>';
$xml .= '<ppp_age>1</ppp_age>';
$xml .= '<ppp_nationality></ppp_nationality>';
$xml .= '<ppp_nomail>true</ppp_nomail>';
$xml .= '<ppp_noemail>true</ppp_noemail>';
$xml .= '<ppp_nosms>true</ppp_nosms>';
$xml .= '<ppe_deposit>99</ppe_deposit>';
$xml .= '<ppe_loanamt>99</ppe_loanamt>';
$xml .= '<ppe_loanpay>99</ppe_loanpay>';
$xml .= '<ppe_loanyr>99</ppe_loanyr>';
$xml .= '<ppe_loanmth>99</ppe_loanmth>';
$xml .= '<ppe_morrent>99</ppe_morrent>';
$xml .= '<ppe_mormax>99</ppe_mormax>';
$xml .= '<ppe_advcred>true</ppe_advcred>';
$xml .= '<ppe_morref></ppe_morref>';
$xml .= '<rsp_action>I</rsp_action>';
$xml .= '</pp_personRow>';   
$xml .= '<hs_transRow>';
$xml .= '<externalID></externalID>';
$xml .= '<hev_code>VISIT</hev_code>';
$xml .= '<htr_date>' . $date2 . '</htr_date>';
$xml .= '<vsi_jobph>' . $coinsID . '</vsi_jobph>';
$xml .= '<htr_reqPlot__1></htr_reqPlot__1>';
$xml .= '<htr_reqPlot__2></htr_reqPlot__2>';
$xml .= '<htr_reqHouse__1></htr_reqHouse__1>';
$xml .= '<htr_reqHouse__2></htr_reqHouse__2>';
$xml .= '<htr_log__1>true</htr_log__1>';
$xml .= '<htr_comment></htr_comment>';
$xml .= '<htr_ref>1</htr_ref>';
$xml .= '<htr_sourceEnq>EST99</htr_sourceEnq>';
$xml .= '<rsp_action>I</rsp_action>';
$xml .= '</hs_transRow>';
$xml .= '</hs_visitorRow>';
$xml .= '</Body>';
$xml .= '</COINSInterface>';

        //setting the curl parameters.
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, '');
        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
        curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 300);
        $data = curl_exec($ch);

        //convert the XML result into array
        $array_data = json_decode(json_encode(simplexml_load_string($data)), true);

        $sending_data = json_decode(json_encode(simplexml_load_string($data)), true);


        echo('<p>We will be sending the following payload into COINS<p>');
        echo('<p>' . $date . '</p>');
        echo('<p>Greeting:<strong>' . $salutation . '</strong></p>');
        echo('<p>First Name:<strong>' . $fname . '</strong></p>');
        echo('<p>Last Name:<strong>' . $lname . '</strong></p>');
        echo('<p>Email:<strong>' . $email . '</strong></p>');
        echo('<p>Tel:<strong>' . $tel . '</strong></p>');
        echo('<p>Add1:<strong>' . $add1 . '</strong></p>');
        echo('<p>Add2:<strong>' . $add2 . '</strong></p>');
        echo('<p>Add3:<strong>' . $add3 . '</strong></p>');
        echo('<p>Add4:<strong>' . $add4 . '</strong></p>');
        echo('<p>Enq:<strong>' . $enq . '</strong></p>');
        echo('<h2>XML Payload</h2>');
        echo('<pre>' . $xml . '</pre>');
        echo('<p>COINS API Response</p>');
        echo('<pre>' . $data . '</pre>');
        echo 'error:' . curl_error($ch);

    } else {
        echo('No Name Set');
]]> Thu, 08 Jun 2017 08:27:45 +0000
<![CDATA[How to start my shop in Minishop2?]]>
(This seems more of a generic beginners question, rather than something for the 'e-commerce' section. If this is wrong, then Admins please let me know or move it to the correct place - Thanks)

I've been the admin for a (pre-existing) ModX website for a couple of years now, I've been learning about Modx Revo for that time, and this is my first serious post on here.

As a test I have recently installed ModX Revo 2.4.4 on a PC using the Bitnami setup as a testbed to evaluate Minishop2.

I have installed and configured Minishop2 by following the Garret Overstreet tutorial:-

Towards the end of the tutorial Garret says "Start your Minishop" and seems to click on 'View Site' (which to my knowledge runs the code on the home page?)

Given that Garret never modified the home page, my question is:- How do I actually start Minishop2, please?


Ian Roll]]> Wed, 08 Feb 2017 09:25:40 +0000
<![CDATA[Are Web user logins different from Manager logins, and how are they managed?]]>
I have looked at the Login Extra, which seems to provide functionality for website front-end logins, like customers on an e-commerce site. Initially I thought that these Users would be essentially different from CMS Manager users, which are logins used for Editing and Managing the website.

But looking at what the extra provides, it seems there is no "user management" functionality.

So does this mean that users registered in this way get entered into the Management user database, and have to be administered there? That would appear to me to be conflating two completely different functions.

Am I right?

And if I am, is there a plugin for doing "customer user management" separate from website management?]]> Tue, 24 Jan 2017 09:25:31 +0000
<![CDATA[Storing media file in a database table?]]>
I've done some searching through both the Extras library and this forum but haven't found an answer for this. If I've missed an answer in my search, please just point me to it to save effort.

What I'm building is an eBook library. So I will have multiple files for each title in different formats (PDF, ePub, mobi, etc), and I want to store these files in a database table rather than in the file system.

Is there a plugin/addin/technique that would simplify doing this?

Stephen Silk
]]> Thu, 29 Dec 2016 05:06:40 +0000
<![CDATA[Global template variables]]>
sorry if its been posted before which i'm sure it will have, but unable to find any info on this issue.

many thanks
James]]> Fri, 16 Dec 2016 08:03:25 +0000
<![CDATA[Always shows "Congratulations" page no matter where I go]]>
I've been playing around with MODX for a bit now, checking how to create templates, resources etc. However, no matter where I try to visit on my test site, it always just shows the home page where it says "Congratulations". I created an About page, added a link into the text, set it up correctly in the admin manager and even cleared the cache but no joy.

Is there something I am missing? Do I need to configure something else, because as far as I am aware I've done everything required?

Michael]]> Wed, 23 Nov 2016 02:10:43 +0000
<![CDATA[Render a document manually]]>
i want to render to a document manually to be able to send it via Email. I want the template to be applied to, so it should render the same way if invoked within a browser.

I thought this would to it ($document is the correct document):
$document->_output = $document->_content;

/* collect any uncached element tags in the content and process them */
$maxIterations= intval($modx->getOption('parser_max_iterations', $options, 10));
$modx->parser->processElementTags('', $document->_output, true, false, '[[', ']]', array(), $maxIterations);
$modx->parser->processElementTags('', $document->_output, true, true, '[[', ']]', array(), $maxIterations);

This is similar to what modResponse does, BUT somehow $document->process(); has a different result in my code than in the modResponse class. In the modResponse class the [[*content]] tag is correctly replaced while my manual call leaves it alone.

Any ideas how to achieve a full manual document parsing or what step is missing in my code?]]> Fri, 23 Sep 2016 08:06:45 +0000
<![CDATA[modx php object is not defined?]]>

and I get the error:

Fatal error: Call to a member function getChunk() on a non-object in C:\wamp\www\test-modx\modx\core\cache\includes\elements\modsnippet\1.include.cache.php on line 84

What exactly has gone wrong?]]> Wed, 08 Jun 2016 05:59:32 +0000
<![CDATA[Find & Replace]]>
We recently moved to HTTPS and of course there are tons of embedded YouTube videos and other things using HTTP and I would love to change them all over in one fell swoop. Any advice?

Thanks!]]> Thu, 26 May 2016 03:02:05 +0000
<![CDATA[Language redirect based on browser's settings]]>
I have a website on Revo with three contexts.
I need a simple solution to redirect users only at the first visit.

For example, if the visitor has [en] in his browser, the website will redirect him to /en (and the same with /de for [de] and root for all other languages).
But if the visitor wants to see other contexts, my redirect shouldn't interfere him. And if the visitor leaves the website from /en version, but have [de] in the browser, the next visit should start from /en.

At the other time, what should we do with links from Google, leading to /en/about-company.html for [de] users? Should we redirect them to such page in Deutch or not. I have more questions than answers.

Hope for your help...]]> Wed, 04 May 2016 05:56:27 +0000
<![CDATA[MIGX Custom CMP - Custom DB - updating records custom table and some modx db tables]]>
Using custom migx cmp

How do i simultanlesly update db fields in a custom db and some modx db tables from a cmp.
( database field has a value, After update several fields in other db will get updated with this value.

How do i do this?

Any help is greatly appriciated

Hurby]]> Tue, 19 Apr 2016 12:00:11 +0000
<![CDATA[MIGXdb CMP Images Not Rendering]]>
I've created a custom package using MIGX and it's working fine, except that in the CMP, the image and crosstick renders are appearing as broken images.

When adding a new entry, the image appears fine in the preview.

Checking the browser console, the images are pointing to the following paths:

However the correct paths should be:

Anyone have any idea what may be causing the issue or if I missed out any settings? Many thanks!]]> Wed, 24 Feb 2016 01:38:50 +0000