Mod x Page not updating - modx

I've created a snippet and included it on my template and when I make changes to the file it does not show. If I view the snippet it looks like it has changed
This is my snippet (really simple):
echo date();
This is my update:
echo rand(0, 1000);
Shown above is the change however in my template it will not change.
I know this might seems stupid (it is). However I hope you can help.

If partial cache is enabled then you will find you will have to clear the Modx cache manually.
To do this, log into the admin area, and go to:
Site -> Clear Cache

I had this problem again, then I realised the template wasn't linked to a static file.
So if this happens to you, check your template.

Related

Updated less files, not showing up after page refreshes

As the subject states, I have made some minor CSS updates via one of the LESS files on a Ghost theme but when I refresh I don't see the changes reflected. I'm assuming since I'm new to LESS and node that perhaps I'm missing compiling LESS to convert it and save the CSS output. Is this like a "watch" task I need to add to a gruntfile? I'm trying to understand how is that all these work together.
For those as me new to LESS and facing similar issue, I found this article really helpful http://ericnish.io/blog/compile-less-files-with-grunt/ after some reading I was able to update LESS files and see the results on css styles and the site.

PHPMaker created pages give 403 error

I created an admin section for a website of mine using PHPMaker - as I usually do. The website is made from scratch, no wordpress or anything else involved.
In some apparently "innocent" tables, if I try to edit them, I get a 403 error. It never happened, and I used PHP maker for at least 15 websites of mine, so I am puzzled.
It happens only on 2 tables out of 15, and as said, they are fairly innocent. Nothing fancy compared to the other ones.
This is what I've tried:
there was no .htaccess file in the admin directory, so I also tried to insert an empty one
clearing the cache
visiting the page in private mode
all file/directory permissions are ok
regenerating the project and uploading it again, to a different directory
What else can/should I check?
There is a .htaccess file on the root directory of the server to handle some "pretty url", but it should not matter since the admin section is under a specific directory. Or should it matter?
Thank you
At least, I found the problem: every time I was trying to insert an iframe or a script, somewhere somehow somebody (...) was parsing it and it was blocking it for - I guess - security issues, so I let the user to insert the script without the <script> tags, added later in PHP simply with:
print "<script>$readFromDB</script>";
In each insert action, PHPMaker will parse the word
<script
and converted to
<s<x>cript
You have either get the inserted rowid and update the value again OR each time you have to remove the '< x >' to view the value correctly.
Take a look at my answer here: PHPMaker issue

How to tell MODX wayFinder to detect the resource ID it is currently on

I am new to WayFinder but I have been working with it a bit and it has worked great for me, However I need something a little more dynamic that I'm not sure how to do.
I have a set of 5 pages in my website and each page has another side menu, but each menu for all five resources will be slightly different
I need wayfinder to detect what the current ID is and then display the appropriate menu
I've tried a couple things but nothign i can get to work:
[[!If? &subject=[[*28]] &then=[[Wayfinder? &startId=27&excludeDocs=28,29,30,31,32,33,89]]]]
So I need to say if the ID is = to 28 display this menu if the ID is = to 29 display this one and so on.
I've also tried &idIs=28 and a couple other variations but couldn't really find anything to help me out on this Does anyone else have any ideas how to make this work? Thank you.
With the solution typeset suggest, wayfinder will be called each time thereby causing uneeded loading time to your site. This will be faster because wayfinder only will be called when id = 28.
[[[[*id:is=`28`:then=`Wayfinder? &startId=27 &excludeDocs=28,29,30,31,32,33,89`:else=``]]]]
Read more on it here: http://modx.com/blog/2012/09/14/tags-as-the-result-or-how-conditionals-are-like-mosquitoes/
You can use output filters for conditional calls. Documentation for them is here
You code would looks something like this:
[[*id:is=`28`:then=`[[Wayfinder? &startId=27&excludeDocs=28,29,30,31,32,33,89]]`:else=``]]
If the menu needs to start from the current ID then you'd use
&startId=`[[*id]]`
If you want it to show all the resources in the current folder, you can use UltimateParent, so
&startId=`[[UltimateParent]]`
Hope this helps!
This should work. The subject is just the parameter you are comparing it against so it shouldn't contain the value.
[[!If?
&subject=`[[*id]]`
&operator=`EQ`
&operand=`28`
&then=`[[Wayfinder? &startId=`27` &excludeDocs=`28,29,30,31,32,33,89`]]`
]]

Hook active trail path views Drupal7

I' am trying to make a custom module to set an active trail path to a menu.
I created a views page.
The active trail must be to a node or taxonmy term.
When I open the pages created by the view the active trail is not active.
I wrote the script here below but it doesn't work, can somebody please help???
function mymodule_views_default_views(&$view, &$display_id, &$args){
if( $view->name = 'productdetail';)
{menu_tree_set_path('menu-categorie', 'node/39');
}
}
Script is the wrong word, I used views and added the fields as mentioned above.
Sorry for the misunderstanding. I hope it helps.
I am happy, I have found the answer to my own question.
I like to share this answer, and hope, that this although helps others...
Here the answer:
In the view I added a field with the term-id / node ID which is although used for my menu and hide the output and do a rewrite of the output
I pasted the following code in text field for rewrite.
field_categorie-tid is my reference term from the menu
menu_tree_set_path('menu-categorie', 'taxonomy/term/[field_categorie-tid]');.
instead of taxonomy term you can although use node/[nid]
I added in the head section a global field
with php and token and put this script:
Thats all.
No hooks or custom scripting in template
I hope this helps someone else.

View. Show values as Links. Strange behaviour

Xpage (listPostits.xsp) has a "View" container control, where one of the column is set "show values in this column as links".
Now, here comes "Strange behaviour".
When i work with this application on my own (developer) PC (Win XP, Chrome or IE), the Domino generate the link, which can't be really processed:
/servername/db/postit/postit.nsf/listPostits.xsp/onePostit.xsp?documentId=many_numbers&action=editDocument
Namely, the Bold-marked portion shouldn't be there ! This portion is the name of the XPage, where the View control is in.
When i work with the application from other PC (Mac, Firefox) then i get the correct link (the same as above but without the XPage name inbetween):
/servername/db/postit/postit.nsf/onePostit.xsp?documentId=many_numbers&action=editDocument
update: let us leave for the moment the differencies in generated links between two machines. The first question is - why the extra portion is inserted into automatically generated link?
After playing around i think i might have found the reason for this strange behaviour. Namely, the "Substitution" Rules on the server side. One of them is to substitute "*/postit/all" with "/db/postit/postit.nsf/listPostits.xsp"
If i switch it off, then the Links are generated properly. Still, it's pretty strange to me that these settings influence the way Domino generates the links. I thought it works on the fly with them and those settings have nothing to do with the way how Links are generated inside the application.
So, the help now is needed regarding Web Site Rule Topic, but for that, i guess, i have to create another topic. But in case somebody has some good Info on this, please share it with me. I'm a bit confused at the moment :)
Final Update: Spent some more hours of testing and the results confirmed the initial idea.
If i open the page with the standart URL, i.e.
http://servername/db/postit/postit.nsf/listPostits.xsp then everything is fine, links are generated properly. When i however open the same page with short URL http://servername/postit/all , then server adds the substitute URL (db/postit/postit.nsf/listPostits.xsp) to every single link he generates automatically to be used as the link to open/edit the underlying document.
Is it bug or feature ? Don't know.
As a workaround (because i want to keep simple URL's for the application) i have to manually generate links.

Resources