You could create a placeholder. If the placeholder (var) value is empty, run the query, if not, skip it.
cool, thats an idea - but is there a way i can include the query in the individual snippets?
with an additional snippet, chunk or so...
like with standard php u could also make a php file with the query and then include it to the main file, just that here i dont want to place it in a file.
point is that i want to be able to edit the query at one place and not have to go to X amount of snippets and edit it everywhere - additionally i might forget one and alredy i have bugs ocurring
cheers
well, in that case try
include_once("path/to/your/script.php");
ye i would know that one too, but i dont want to do it over a file...
i want to have everything in the modx manager - because depending on where i am i cant access the ftp and in this case i could not edit the file on the server
You can just put the query in a separate snippet and assign the result to a placeholder or a global variable. Then place that snippet before the others on the page. You could probably also do what you want with a TV, a plugin, or PHx...
Quote from: enigma at Nov 08, 2007, 09:06 AM
ye i would know that one too, but i dont want to do it over a file...
i want to have everything in the modx manager - because depending on where i am i cant access the ftp and in this case i could not edit the file on the server
Just so you know, if your host provides a cPanel interface, you can log on to cPanel and use the cPanel file manager, navigate to the file, then open it in an editor. My host provides three different editors to use for remotely editing files (a text editor, and html editor, and a code editor). It’s almost exactly the same amount of work it is to edit them in the MODx manager and sometimes, the host’s editor is better.
Bob
i would have u a good tip if u dont like some editors =)
theres a firefox plugin called "its all text"
with this u can set an editor for all textboxes,
and ive set it so when i press ctrl+e it opens my editor
and i can edit nicely, when u then press ctrl+s
its saved directly into the textbox ;-)
ps. ive got a dedicated host and i dont like cp
enigma,
You could create a checkbox TV that says "if thisTV == checked, the runsnippet".
PS - I second, using "its all text"