I found a solution last night that is working, not sure if it is the best answer, but it is working for me. Instead of using ([name]) for the cookie value I got rid of the ([ ]) so my htaccess looks like: RewriteCond %{HTTP_COOKIE} market=dc-metro [NC] RewriteRule ^fly-a-kite(.*)$ /dc-metro/fly-a-kite$1...
Sounds like you've forgotten to add <base href="[[++site_url]]" /> To your head. At least that is the first thing that comes to mind....
You need to remove all malicious files, update your modx, update all plugins/extensions and change all passwords on site/db/ftp.
It looks like the order of your directives is wrong. Rewrite conditions only get applied to the immediately following rule, and you need your conditions to be applied to the index.php routing rule. So try: RewriteRule portfolio/tags/(.*)$ portfolio/tags?filter=$1 [L,N] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] ...
Ok, first include jQuery library in the <head> section of your document e.g. Google CDN version <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> or download the compressed, production jQuery 1.11.0 and put it in your root folder then include it like this <script src="jquery-1.11.0.min.js"></script> then add below script just before the </body> tag <script> (function($)...
in print_r() function add 2nd argument TRUE for return output value, see below sample code $log = "<pre>"; $log .= print_r($formdata, true); $log .= "</pre>"; $this->modx->log(modX::LOG_LEVEL_ERROR, 'Form Data = ' . $log); ...
php,modx,modx-revolution,modx-resources
print_r() on $allFormFields will very likely give you something like this: // dump of form values Array ( [pagetitle] => Array ( [0] => 'pagetitle1' [1] => 'pagetitle2' ), [longtitle] => Array ( [0] => 'longtitle1' [1] => 'longtitle2' ), ) That's why you're getting 'Array' when you try to...
To get rid of the mysql deprecated warning you have to use Evo 1.0.15+ and you should change $database_type = 'mysql'; to $database_type = 'mysqli'; in config.inc.php The 'only' thing that uses the old mysql_ functions is the installer then. The deprecated warnings are disabled in there for PHP 5.5....
I was able to solve second level filtering by inserting the following code to my javascript; $(".classes input[type='checkbox']").click(function(e) { var innerTextHTML = $(this).parent("div.selection").children('label').text(); var planWrap = $("div.plan."+innerTextHTML).parent(); if ($(this).is(':checked')){ planWrap.show(); }else{ planWrap.hide(); } }); One issue I had when I used this was nth row styling, which I was able...
modx,modx-revolution,modx-resources
I first went to the repository to commit a fix in but the file annoyingly isn't being tracked. https://github.com/splittingred/Redirector Fix: Open: /core/componenets/redirector/processors/mgr/resources/getlist.class.php Then add an initiator method: public function initialize() { $this->setDefaultProperties(array( 'start' => 0, 'limit' => 0, 'sort' => $this->defaultSortField, 'dir' => $this->defaultSortDirection, 'combo' => false, 'query' => '',...
Currently the GalleryAlbums Snippet doesn't support sorting by year, even though there's a "year" field for the Album object: However, there's a couple ways to do this. 1. Write your own Snippet This would be the most performant option, but instructions for this might be out of scope here, so...
You can do this by using getResource package. Look at sorbyTV, sortdirTV, sortbyTVType parameters in manual: http://rtfm.modx.com/extras/revo/getresources#getResources-SelectionProperties...
<?php $where = array(); $userGroups = $modx->getCollection('modUserGroup', $where); foreach ($userGroups as $userGroup) { print $userGroup->get('name'); } ...
It's all because first snippet catch the call. Your second snippet can't react. You have to manipulate with submitVar or actionKey parameter. Just rtfm. You can get some information there also....
You want to create a "Snippet", which is just a piece of php code. Call your snippet whatever and something like this should do: return (!empty($_GET['email']) ? $_GET['email'] : 'Enter e-mail'); Then in your chunk/template or wherever that code you pasted is, change the input value to: value="[[!NameOfYourSnippet]]". The bracers...
So, everything was fine actually. I was looking at the Post Data via network tab, but the real posted data was completely fine.
modx,modx-revolution,wayfinder
My templates were missing: <base href="[[++site_url]]" /> ...
modx,modx-revolution,modx-evolution
Use getResources to search all your categories for the author name template variable. You don't need to assign multiple parents [though if you insisted on doing that you could use a resource alias to fake it] Your getResources would look something like: [[!getResources? &parents=`1,2,3` // your category ids &tvFilters=`author_name==[[+author_name]]` //pass...
You can not use MODX tags as is inside the snippets, you will need to use $modx->documentObject['variable-name'] So your code will be something like this: <?php $string1 = $modx->documentObject['longtitle']; $string = preg_replace('/\s+/', '', $string1); return $string; ?> ...
I will try to solve it myself. Kind of solution: Write a plugin that track events and persist it in database or somewhere else: OnWebLogin and OnWebLogout. Then read the count of logged in users. Created a db table "modx_weblogin_session" (manually) userid, timestamp. Created a Plugin: if (isset($modx) && isset($user))...
date,date-format,modx,modx-revolution
http://rtfm.modx.com/display/revolution20/Input+and+Output+Filters+%28Output+Modifiers%29 - you need :strtotime modificator before :date - [[+mydate:strtotime:date=`%Y-%m-%d`]] ...
1 - use your tv - <a href="[[++site_url]][[*myFileTv]]">My File</a> 2 - use snippet like this - [[!getNameFromPath?&path=`[[*myFileTv]]`]] and code of this snippen is - <?php $path = $modx->getOption('path', $scriptProperties, ''); $fileName = basename($path); return $fileName; 3 - use another snippet - [[!getSizeFromPath?&path=`[[*myFileTv]]`]] which code is - <?php $path = $modx->getOption('path',...
It looks like you're using methods from MODX Evolution. Revolution is different so it would be a good idea to familiarise yourself with the documentation. I've provided some links below. To get a template variable value using the API is simple: $value = $modx->resource->getTVValue('tv-name'); $modx->resource always contains the object for...
In general, the New Relic PHP agent lets you integrate most unsupported frameworks by using newrelic_name_transaction(). There's a separate guide explaining how to use this API call for reporting better transaction names.
html,modx,modx-templates,ditto
I solved it by placing a Ditto call within the carousel_articles chunk for each indivdual div (with different parents each matching my articles categories) and use the randomize parameter.
I would remove the first "if" completely, you don't need to check if you're in manager or not since context doesn't make a difference there. You also don't need a switch to "web" context since that will be the default, you only need to change to "en" or any other...
You can just create a new album (called 2014) and place the other albums inside (Album 1, Album 2, etc.) You can drag and drop albums into your 2014 folder or just right click it to create new subfolders....
try this: nav ul li ul li{ display:none; } nav ul li:hover > ul li{ display:block; } http://jsfiddle.net/vpZ5J/4/...
modx,modx-revolution,getresource,modx-chunks
It was a weird issue with wrapping a block element (div) in an inline a tag. Changed div to span and it was ok.
You can try something like: $results = $modx->query("SELECT * FROM some_table"); while ($r = $results->fetch(PDO::FETCH_ASSOC)) { print_r($r); exit; } It's documented quite well here: http://rtfm.modx.com/xpdo/2.x/class-reference/xpdo/xpdo.query Also, if you wave the wayfinder model loaded, you should be able to do without all the extra sql, take a peek at, getObject, getCollection:...
modx,modx-revolution,modx-templates,modx-resources
That is easy ;) your listbox should contain a @CHUNK yourchunk In that chunk you can perform nearly everything, that genereates a list, like: <select name="something" id="something" > <option value="" selected disabled>choose</option> <optgroup label="Headline 01"> [[pdoResources? &parents=`0` &where=`{"template:=":40` &sortby=`{"value":"ASC"}` &limit=`40` &tpl=`pdoResourcesFormoption-something` &includeTVs=`some-tv`]] </optgroup> <optgroup label="Headline 02"> [[pdoResources?...
My fault. I should have been copying the content of snippet.wayfinder.php not wayfinder.inc.php
What is happening is that your TV output type is set to "image" - Modx will output an image tag in that situation and not just the path. You can change the output type to default so that only the path is output, then you can pass that to your...
email,phpmailer,modx,modx-revolution
This is a PHP bug that affects PHP 5.5.25 and 5.6.9 when run using mod_php with apache. There are a few workarounds until it's fixed in PHP. Downgrade PHP to 5.5.24 or 5.6.8 Switch to PHP-FPM instead of mod_php (which is a good idea anyway) Override the PHPMailer class and...
Based on the examples in the xPDO Getting Started guide, $modx in this context appears to be a class extending PDO and the result resource object $myquery is likely a PDOStatement object. You can therefore set an exception error mode on $modx as you would with a normal PDO object....
modx,modx-revolution,modx-chunks,modx-getresources,modx-template-varaiables
I prefer to format the date during the output by an output filter [[+tv.NewsDate:strtotime:date=`%b %e, %Y`]] and set the output of the Date TV to standard. The output of the TV could be different from page to page with that.