Manager, Parser &amp; the Core - MODX Community Forums https://forums.modx.com/board/?board=79 <![CDATA[Make Site site_start fixed URL]]> https://forums.modx.com/thread/103772/make-site-site-start-fixed-url#dis-post-558182
We are trying to have a fixed url for our main page as we are trying to point out that it is about one country.
Unfortunately modx redirects immediately from www.domain.com/countypage to www.domain.com when the country page is set to site_start and is called.

So far we haven't really found a setting for disabling this.
Does anyone know how to disable this unwanted 301-redirect?
]]>
https://forums.modx.com/thread/103772/make-site-site-start-fixed-url#dis-post-558182 Tue, 24 Apr 2018 09:28:58 +0000 https://forums.modx.com/thread/103772/make-site-site-start-fixed-url#dis-post-558182
<![CDATA[Support/Comments for CustomUrls]]> https://forums.modx.com/thread/78843/support-comments-for-customurls?page=2#dis-post-556792
You can build your patterns from resource fields, TV, snippets and output filters and set some constraints like you'd do with custom forms.

For example, with CustomURLs you can add the resource's ID or publish month in the aliases of all resources or just for ones whose parent = 1 or template = 1.


Pattern examples


Simple text :
simple-text

Default MODx alias :
[[+alias]]

Resource placeholders :
[[+id]]-[[+alias]]

TVs :
[[+tv.mytv]]-[[+id]]

Snippets :
[[MySnippet? &id=`[[+id]]`]]

Output filters :
[[+publishedon:strtotime:date=`%Y-%m-%d`]]/[[+id]]-[[+alias]]

Default MODx URI :
[[+cu.parent_uri]]/[[+alias]]

More complex URI
[[+cu.parent_uri]]/some-text/[[getResourceField? &id=`[[+parent]]`]]/[[+id]]-[[+alias]]


Download : http://modx.com/extras/package/customurls
Github : https://github.com/omycode/customurls
Documentation : http://rtfm.modx.com/display/ADDON/CustomUrls]]>
https://forums.modx.com/thread/78843/support-comments-for-customurls?page=2#dis-post-556792 Sat, 10 Feb 2018 02:04:54 +0000 https://forums.modx.com/thread/78843/support-comments-for-customurls?page=2#dis-post-556792
<![CDATA[ClassExtender and Images]]> https://forums.modx.com/thread/97535/classextender-and-images#dis-post-554499 https://forums.modx.com/thread/97535/classextender-and-images#dis-post-554499 Fri, 13 Oct 2017 10:51:30 +0000 https://forums.modx.com/thread/97535/classextender-and-images#dis-post-554499 <![CDATA[Revolution Manager TV Customization - Howto show a TV on certain pages ONLY?]]> https://forums.modx.com/thread/45093/revolution-manager-tv-customization---howto-show-a-tv-on-certain-pages-only?page=2#dis-post-550014
maybe I miss something but I tried to make a tv visible on certain pages only and get to no result.
My first problem is to create a rule with a correct constraint to affect a certain page only. According to the docs I used the following params:

Action: core-resource/update
User Group: A certain user group of my installation

Field: tv9 (tv with id 9)
Containing Panel: modx-panel-resource
Rule: tv visible
Value: 0 (for testing to just hide it from that page to see if it works, should finally be 1 )

Constraint Class: modResource
Constraint Field: id
Constraint: 2 (page id 2)

The result is that the tv now is hidden from ALL pages. Seems my constraint settings are not working. Do I have entered the wrong values?

The second question is how to show the tv for certain pages (defined by id) only: Since all tvs are visible for all pages by default, I don’t think I can just set the rule-value to 1 for visibility, right? Thus, do I have to create a first rule that hides the tv from all pages first and then create a second rule to make it visible for the pages I like to have the tv visible?

Thx for help.]]>
https://forums.modx.com/thread/45093/revolution-manager-tv-customization---howto-show-a-tv-on-certain-pages-only?page=2#dis-post-550014 Tue, 11 Apr 2017 05:29:41 +0000 https://forums.modx.com/thread/45093/revolution-manager-tv-customization---howto-show-a-tv-on-certain-pages-only?page=2#dis-post-550014
<![CDATA[Dynamic Depencency Listboxes]]> https://forums.modx.com/thread/101901/dynamic-depencency-listboxes#dis-post-549429
I am fairly new to MODx and pretty desperate because i cannot find any working solution to my problem.

I have set up a Listbox(Multiple Choice) with some resources to choose from which i pull with this:
@EVAL return $modx->runSnippet('listResourcePagetitleInputOption', array('parent' => 99));

This works perfectly and lets me choose from the child-elements (100,101,102) of the parent resource with the id 99.

Resource structure:
- Special (99)
-- Option 1 (100)
--- Sub Option 1 (103)
--- Sub Option 1 (104)
-- Option 2 (101)
--- Sub Option 1 (105)
-- Option 3 (102)

Snippet-Code (listResourcePagetitleInputOption):
<?php
$parent = $modx->getOption('parent',$scriptProperties,0);
$parentObj = $modx->getObject('modResource',$parent);
if (!($parentObj instanceof modResource)) { return ''; }
$resArray = $parentObj->getMany('Children');
$resources = array();
foreach($resArray as $res) {
  if ($res instanceof modResource) {
    $resources[] = $res->get('pagetitle');
  }
}
$out = implode("||",$resources);
return $out;


I am in need of a second Listbox which pulls the chosen id (for example id 100) of the first Listbox as his parent id (100) to get the child-elements with the ids 103 and 104 as a selectable option. Also it should be possible if i choose the Option 1 (100) and Option 2 (101) in the first Listbox, it should grab the children of all selected (103,104,105).

Is there a way to achieve this? Any help is greatly appreciated!

Thank you and best regards
Sascha]]>
https://forums.modx.com/thread/101901/dynamic-depencency-listboxes#dis-post-549429 Wed, 15 Mar 2017 12:12:07 +0000 https://forums.modx.com/thread/101901/dynamic-depencency-listboxes#dis-post-549429
<![CDATA[Running custom PHP via a Namespace in the Top Menu to clear core/cache folder]]> https://forums.modx.com/thread/101854/running-custom-php-via-a-namespace-in-the-top-menu-to-clear-core-cache-folder#dis-post-549314
<?php
$dir = "/host/site/core/cache";
$di = new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS);
$ri = new RecursiveIteratorIterator($di, RecursiveIteratorIterator::CHILD_FIRST);
foreach ( $ri as $file ) {
    $file->isDir() ?  rmdir($file) : unlink($file);
}
return "Cache cleared.";
?>

(I've moved the core folder outside public_html, so the path is correct.)

If I put the PHP in a file and access it directly at www.site.com/clearcache.php, it works fine, and the core/cache folder is empty until a page or the manager is loaded.

To make it more accessible I:
- put the contents inside core/components/clearcache/index.php file
- created a new Namespace called "clearcache" with a Core path of "{core_path}components/clearcache/"
- created a new Top Menu item with an Action of "index" and a Namespace of "clearcache"

When I click on the new menu item, it returns "Cache cleared", however, the core/cache folder isn't empty. Is this because clicking on the menu item and loading the new page actively caches new content, or is there something in my PHP Modx doesn't like?

I'm running:
Modx Revolution 2.5.2-pl
PHP 5.5.38]]>
https://forums.modx.com/thread/101854/running-custom-php-via-a-namespace-in-the-top-menu-to-clear-core-cache-folder#dis-post-549314 Sat, 11 Mar 2017 07:44:42 +0000 https://forums.modx.com/thread/101854/running-custom-php-via-a-namespace-in-the-top-menu-to-clear-core-cache-folder#dis-post-549314
<![CDATA[Snippets execute in wrong order when pdoTools is installed]]> https://forums.modx.com/thread/101053/snippets-execute-in-wrong-order-when-pdotools-is-installed#dis-post-549166
The Placeholder value is set by a snippet eg. [[regFile? &item=`file1`]]. Each time the snippet is called the value passed by &item is concatenated to the previous value and stored in the placeholder.

Calling [[regFile? &item=`file1,file3`]] then calling [[regFile? &item=`file7`]] results in [[+myPlaceholder]] being set to: file1,file3,file7

So far so good.

At the end of my Template a second snippet [[outputScripts]] is called. It parses myPlaceholder and returns an HTML block with script tags based on the files stored in the Placeholder eg.

<script src="file1.js"></script>
<script src="file3.js"></script>
<script src="file7.js"></script>

However when placed at the end of my Template it returns

<script src="file1.js"></script>
<script src="file3.js"></script>

If I change the [[regFile]] snippet to output the current Placeholder value each time it is called the Placeholder value is correct, after the second call the 3 .js files are included.

If both snippets also output the current microtime() you can see that [[outputScripts]] is called before [[regFile]] even though [[outputScripts]] is the last tag in my Template. To illustrate:

0.624 [[regFile]]
0.911 [[regFile]]
0.896 [[outputScripts]] <<< this should be the 3rd event but the timer shows it is the 2nd.

I don't know why but calling [[!outputScripts]] uncached while pdoTools is installed also resolves the issue.

Changing the System Setting for pdotools_fenom_default to No has no effect (I don't think it should though, I think this relates to the way pdoTools snippets handle Chunks).

Disabling the pdoTools Plugin has no effect.

Can anyone suggest what might be the cause or how I can investigate further?

The issue seems vaguely similar to the Placeholder issue which was influenced by pdoTools reported at https://www.bountysource.com/issues/33123926-issue-defined-placeholders-have-to-be-uncached-in-order-to-use-output-modifiers-in-2-4-4]]>
https://forums.modx.com/thread/101053/snippets-execute-in-wrong-order-when-pdotools-is-installed#dis-post-549166 Sat, 04 Mar 2017 05:38:36 +0000 https://forums.modx.com/thread/101053/snippets-execute-in-wrong-order-when-pdotools-is-installed#dis-post-549166
<![CDATA[Resources Toolbar has disappeared.]]> https://forums.modx.com/thread/101294/resources-toolbar-has-disappeared#dis-post-546563
Please help!!

]]>
https://forums.modx.com/thread/101294/resources-toolbar-has-disappeared#dis-post-546563 Mon, 21 Nov 2016 09:17:20 +0000 https://forums.modx.com/thread/101294/resources-toolbar-has-disappeared#dis-post-546563
<![CDATA[Items going missing from a MIGX TV grid]]> https://forums.modx.com/thread/100756/items-going-missing-from-a-migx-tv-grid#dis-post-544366
I have a really simple MIGX TV, used to store members of a team. When adding data it displays fine in the manager and on the front end, but when you refresh the manager page some items from the grid are missing, though they're showing up in the raw json in the db. Nothing in the error log. Here's the json for the tv setup. Any ideas what could be going wrong?

Thank you!

{
"formtabs":[
{
"MIGX_id":4,
"caption":"",
"print_before_tabs":"0",
"fields":[
{
"MIGX_id":7,
"field":"title",
"caption":"title",
"description":"",
"description_is_code":"0",
"inputTV":"",
"inputTVtype":"",
"validation":"",
"configs":"",
"restrictive_condition":"",
"display":"",
"sourceFrom":"config",
"sources":"",
"inputOptionValues":"",
"default":"",
"useDefaultIfEmpty":"0",
"pos":1
},
{
"MIGX_id":8,
"field":"position",
"caption":"position",
"description":"",
"description_is_code":"0",
"inputTV":"",
"inputTVtype":"",
"validation":"",
"configs":"",
"restrictive_condition":"",
"display":"",
"sourceFrom":"config",
"sources":"",
"inputOptionValues":"",
"default":"",
"useDefaultIfEmpty":"0",
"pos":2
},
{
"MIGX_id":9,
"field":"image",
"caption":"image",
"description":"",
"description_is_code":"0",
"inputTV":"projectimageTV",
"inputTVtype":"",
"validation":"",
"configs":"",
"restrictive_condition":"",
"display":"",
"sourceFrom":"config",
"sources":"",
"inputOptionValues":"",
"default":"",
"useDefaultIfEmpty":"0",
"pos":3
},
{
"MIGX_id":10,
"field":"id",
"caption":"ID of page to link to",
"description":"",
"description_is_code":"0",
"inputTV":"",
"inputTVtype":"",
"validation":"",
"configs":"",
"restrictive_condition":"",
"display":"",
"sourceFrom":"config",
"sources":"",
"inputOptionValues":"",
"default":"",
"useDefaultIfEmpty":"0",
"pos":4
}
],
"pos":1
}
],
"contextmenus":"",
"actionbuttons":"",
"columnbuttons":"",
"filters":"",
"extended":{
"migx_add":"",
"disable_add_item":"",
"add_items_directly":"",
"formcaption":"",
"update_win_title":"",
"win_id":"",
"maxRecords":"",
"addNewItemAt":"bottom",
"multiple_formtabs":"",
"multiple_formtabs_label":"",
"multiple_formtabs_field":"",
"multiple_formtabs_optionstext":"",
"multiple_formtabs_optionsvalue":"",
"actionbuttonsperrow":4,
"winbuttonslist":"",
"extrahandlers":"",
"filtersperrow":4,
"packageName":"",
"classname":"",
"task":"",
"getlistsort":"",
"getlistsortdir":"",
"sortconfig":"",
"gridpagesize":"",
"use_custom_prefix":"0",
"prefix":"",
"grid":"",
"gridload_mode":1,
"check_resid":1,
"check_resid_TV":"",
"join_alias":"",
"has_jointable":"yes",
"getlistwhere":"",
"joins":"",
"hooksnippets":"",
"cmpmaincaption":"",
"cmptabcaption":"",
"cmptabdescription":"",
"cmptabcontroller":"",
"winbuttons":"",
"onsubmitsuccess":"",
"submitparams":""
},
"columns":[
{
"MIGX_id":1,
"header":"Title",
"dataIndex":"title",
"width":150,
"sortable":true,
"show_in_grid":1,
"customrenderer":"",
"renderer":"",
"clickaction":"",
"selectorconfig":"",
"renderchunktpl":"",
"renderoptions":"",
"editor":""
}
]
}]]>
https://forums.modx.com/thread/100756/items-going-missing-from-a-migx-tv-grid#dis-post-544366 Mon, 22 Aug 2016 03:34:21 +0000 https://forums.modx.com/thread/100756/items-going-missing-from-a-migx-tv-grid#dis-post-544366
<![CDATA[We need better cache clearing control]]> https://forums.modx.com/thread/98098/we-need-better-cache-clearing-control?page=2#dis-post-544312
1. Installing a new plugin clears the cache. Why??? I haven't even used the plugin yet, and maybe it's just to add some scripting ability that I haven't even put in a page yet, and even so I would just need to save that page and clear the cache just for that page.

2. Creating a new page automatically checks off the "clear cache" checkbox, even if I haven't set that page to be published yet. Once again, what's the point until it's published? I'd like to see an option in CacheMaster to disable this on new documents.

3. The Publish and Unpublish buttons in the list views of plugins like Articles and Collections clear the cache.

4. Right-clicking on a resource in the tree and selecting Publish or Unpublish or Delete, and also using the Quick Edit option here, clear the cache.

I'm sure there are other times the cache gets cleared automatically. It drives me nuts.

1. I'd love to see a system setting that makes it an option to NEVER clear the site cache no matter what happens, so that the cache only gets cleared by selecting Clear Cache in the MODX menus.

2. I'd love to see an option to designate a certain area of the site as an "archive", so that the site cache for these files never gets cleared, even when selecting Clear Cache from the MODX menus. Maybe selecting that would bring up an option to include or exclude pages in the archive. I have one site that's fairly small except for one section that has tons of old articles available, and after a site clearing, whenever a search engine hits this site for reindexing, all those thousands of articles have to be needlessly reacreated all over again.

I know there are other cache-related plugins available, but I don't think they address these problems.]]>
https://forums.modx.com/thread/98098/we-need-better-cache-clearing-control?page=2#dis-post-544312 Thu, 18 Aug 2016 12:51:21 +0000 https://forums.modx.com/thread/98098/we-need-better-cache-clearing-control?page=2#dis-post-544312
<![CDATA[Initial blank value appended to @SELECT Binding]]> https://forums.modx.com/thread/45031/initial-blank-value-appended-to-select-binding#dis-post-533871
Here’s the code pasted into the "Input Option Values":

@EVAL return substr($modx->runSnippet('Ditto', array("parents"=>"984","depth"=>"1","display"=>"all","showInMenuOnly"=>"0","sortBy"=>"pagetitle","sortDir"=>"ASC", "tpl"=>"@CODE ||[+pagetitle+]==[+id+]")), 2);


Here’s the generated list in the TV:

<select id="tvcontainsPatterns[]" size="8" onchange="documentDirty=true;" multiple="multiple" name="tvcontainsPatterns[]">
<option value="1069">Ads — Monetization</option>
<option value="1084">Article Feature Section — Multi-Link</option>
<option value="1085">Article Feature Section — Single-Link</option>
<option value="878">Banner — Godzillatron</option>
<option value="1066">Banner — Moodboard</option>
<option value="1048">Banner — Pokemontron</option>
<option value="1079">Bio Layout — Additional Links</option>
...
</select>


And, this is what I’m looking for (note the second line):

<select id="tvcontainsPatterns[]" size="8" onchange="documentDirty=true;" multiple="multiple" name="tvcontainsPatterns[]">
<option value=""></option>
<option value="1069">Ads — Monetization</option>
<option value="1084">Article Feature Section — Multi-Link</option>
<option value="1085">Article Feature Section — Single-Link</option>
<option value="878">Banner — Godzillatron</option>
<option value="1066">Banner — Moodboard</option>
<option value="1048">Banner — Pokemontron</option>
<option value="1079">Bio Layout — Additional Links</option>
...
</select>


I’m sure I could could easily hack it w/ a javascript "clear" button that would deselect all selected values, but I’d like a more elegant solution if possible.

Thanks!]]>
https://forums.modx.com/thread/45031/initial-blank-value-appended-to-select-binding#dis-post-533871 Fri, 30 Oct 2015 08:54:56 +0000 https://forums.modx.com/thread/45031/initial-blank-value-appended-to-select-binding#dis-post-533871
<![CDATA[CacheMaster 1.2.2 not working on TVs, plugins, etc.]]> https://forums.modx.com/thread/98021/cachemaster-1-2-2-not-working-on-tvs-plugins-etc#dis-post-530174 https://forums.modx.com/thread/98021/cachemaster-1-2-2-not-working-on-tvs-plugins-etc#dis-post-530174 Mon, 17 Aug 2015 10:03:46 +0000 https://forums.modx.com/thread/98021/cachemaster-1-2-2-not-working-on-tvs-plugins-etc#dis-post-530174 <![CDATA[Possibility to set a default content for pages directly in the manager]]> https://forums.modx.com/thread/97352/possibility-to-set-a-default-content-for-pages-directly-in-the-manager#dis-post-526579
I'm developing a website on MODx Evolution where many pages are activities.
The top-level pages using Ditto to display summaries of the miscellaneous activities, which are set in the "introtext" field.

Each activity can have a longer "learn-more" text, which is is set in the content field and should be display on the activity page.
Because most of the "Learn more" texts were not written yet, it would be very useful if MODx had some feature to set a default value for the [*content*] field.
For instance, the content could be set to something like:
<h2>[*pagetitle*]</h2>
[*introtext*]

Exactly like the default value for TVs.

This "Default content" field could typically be integrated to the MODx Configuration section of the manager.

Alternatively, is there some plugin to achieve this ?
Something more straightforward than ManagerManager?

I want as much as possible avoiding to create a new template, because this means twice more work when you change something in a template.]]>
https://forums.modx.com/thread/97352/possibility-to-set-a-default-content-for-pages-directly-in-the-manager#dis-post-526579 Mon, 08 Jun 2015 01:25:57 +0000 https://forums.modx.com/thread/97352/possibility-to-set-a-default-content-for-pages-directly-in-the-manager#dis-post-526579
<![CDATA[change migx value with ondocformsave plugin]]> https://forums.modx.com/thread/96642/change-migx-value-with-ondocformsave-plugin#dis-post-523093
i'd like to get links to preview images of vimeo with curl (works as snippet)
Now i need to get the migx parsed and on save and foreach row the url filled with the response from the curl calls.

when i do this at runtime it slows down the site massive because of alot api requests and slow responses, thats the reason why i like to make this only once at savetime.]]>
https://forums.modx.com/thread/96642/change-migx-value-with-ondocformsave-plugin#dis-post-523093 Sat, 21 Mar 2015 06:52:12 +0000 https://forums.modx.com/thread/96642/change-migx-value-with-ondocformsave-plugin#dis-post-523093
<![CDATA[CacheMaster V. 1.1.0-pl Released]]> https://forums.modx.com/thread/83059/cachemaster-v-1-1-0-pl-released?page=3#dis-post-522950
On a large site, MODX's default behavior of clearing the cache for all Resources whenever you save a Resource or Element can really slow things down for your visitors. The CacheMaster Plugin for MODX Revolution allows you to have the cache cleared for a single Resource or Element when you save it, without clearing anything else.

It will also, optionally, uncheck the "Empty Cache" checkbox by default when you edit a Resource or Element.

http://bobsguides.com/cachemaster-tutorial.html]]>
https://forums.modx.com/thread/83059/cachemaster-v-1-1-0-pl-released?page=3#dis-post-522950 Wed, 18 Mar 2015 02:57:21 +0000 https://forums.modx.com/thread/83059/cachemaster-v-1-1-0-pl-released?page=3#dis-post-522950
<![CDATA[Display custom database table in custum manager page]]> https://forums.modx.com/thread/96042/display-custom-database-table-in-custum-manager-page#dis-post-519848 http://bobsguides.com/custom-db-tables.html) tutorial and everythink is working fine. I can display items from my custom table on the page.
The problem is to display them in Manager. I created my own manager page like it is on this page http://rtfm.modx.com/revolution/2.x/developing-in-modx/advanced-development/custom-manager-pages/custom-manager-pages-in-2.3 and i can display on this page static text. Now i want to get on this manager page, my custom table items. I thought i can acces them by
$modx->addPackage('quotes');
but it's giving me blank page.
Custom manager page is in sam path as bobs snippet (core/components/quotes/).
How can I get this custom table?

Edit: my MODx version is 2.3.3]]>
https://forums.modx.com/thread/96042/display-custom-database-table-in-custum-manager-page#dis-post-519848 Tue, 03 Feb 2015 07:51:44 +0000 https://forums.modx.com/thread/96042/display-custom-database-table-in-custum-manager-page#dis-post-519848
<![CDATA[Messages to other backend users]]> https://forums.modx.com/thread/95946/messages-to-other-backend-users#dis-post-519525 https://forums.modx.com/thread/95946/messages-to-other-backend-users#dis-post-519525 Fri, 30 Jan 2015 02:10:17 +0000 https://forums.modx.com/thread/95946/messages-to-other-backend-users#dis-post-519525 <![CDATA[Package Manager: grid columns not sortable]]> https://forums.modx.com/thread/95945/package-manager-grid-columns-not-sortable#dis-post-519296 (MODX 2.3.2-pl)

Edit:
It's the same with the table of Messages.]]>
https://forums.modx.com/thread/95945/package-manager-grid-columns-not-sortable#dis-post-519296 Tue, 27 Jan 2015 05:52:17 +0000 https://forums.modx.com/thread/95945/package-manager-grid-columns-not-sortable#dis-post-519296
<![CDATA[Manager Menu items]]> https://forums.modx.com/thread/95865/manager-menu-items#dis-post-518939 https://forums.modx.com/thread/95865/manager-menu-items#dis-post-518939 Wed, 21 Jan 2015 04:04:18 +0000 https://forums.modx.com/thread/95865/manager-menu-items#dis-post-518939 <![CDATA[Saving Resources and Chrome]]> https://forums.modx.com/thread/92434/saving-resources-and-chrome#dis-post-505213
I'm hoping this isn't a post which has already been logged. I recently upgraded my Modx install to 2.3.0 and then 2.3.1. One thing I've noticed within Chrome and using the manager is that when I try to save resources in Chrome it just sits with the window "Please Wait... Saving..." which never seems to refresh even though it does seems to save what has been done. Is there a fix for this at all.

Cheers

Graham]]>
https://forums.modx.com/thread/92434/saving-resources-and-chrome#dis-post-505213 Thu, 31 Jul 2014 03:57:17 +0000 https://forums.modx.com/thread/92434/saving-resources-and-chrome#dis-post-505213