Quote from: BobRay at Aug 24, 2009, 06:55 PM
I’m not exactly clear on what you want, but this might get you close. This code is in the file: core/model/modx/modtemplatevar.class.php:
At first sight this is exactly what I want many thanks.
I’m not sure why it wasn’t clear 8-) unless I’m misunderstanding the process here. I would have thought it a very frequent use of a dropdown list that it contains information that actually may not apply to the article in question. I’m assuming that all this dropdown does is produce a set of values which are then stored in the template variable.
I have a website called the Week in Chess. A site sorely in need of a CMS. Putting this together is taking forever and I keep thinking it is like doing a million piece jigsaw. Anyhow I am finally making serious progress. I have individual tournaments I want to cover and I’m glueing the whole thing together with an individual identifier for that tournament contained in a template variable.
This way I can have sections for individual writers on each event and can bring up the material using a search with ditto, this actually works better than I ever could have dreamed.
About 2 months ago I realised that it didn’t make sense to put everything in Modx. The game files (records of the games and results and a calendar/details of the tournaments) belonged in a separate database, which I then had to learn to create and update. What I’m trying to do is join all this together using the same template variable above. I’ve got that bit working. But it would be even better if I didn’t have to remember the code I used in the external database but just got a drop down list of them. However not all stories are about tournaments, they may be obituaries or something else that will never need this TV, or events I haven’t put in the database, hence the need for NULL. I just can’t believe this hasn’t come up before.
But even if you didn’t think you understood the problem, you I think did anyhow. Many thanks, unless I misunderstood your reply in return. Although what you suggest is maybe hacking the core?
The suggestion from Bruno above is also a possibility as well, although I had trouble making the databbase query system $MODX->query->select work and ended up just doing the query in snippet as standard php (that is probably a very trivial misunderstanding on my part) which works great as the query is cached.
Mark Crowther