Hi all:
I’ve been playing with ModX for a month or so now, trying to use it as a framework for a custom application. So far, so good.
Coming from a software development background, there are a few things I really miss, but the biggest are:
- version control
- using my programmer’s editor
I understand that the CMS concept is to edit the site directly using MODX and to save the changes in the DB. This is convenient for making edits to a big site, but seems perilious when your making massive changes and building out infrastructure. As nice as the modx WYSIWYG editor is, there’s nothing like have 20 files open at once, search and replace across multiple files, unlimited undo, etc, etc.
I guess the optimal solution for me would be to be able to edit/ftp my HTML/javascript using my programmer’s editor. And CVS for version control, so I can back out my mistakes, allow for multiple developers, etc... Do all the early development that way.
Once the site is solidified, I’d then want to be able to push everything into the DB, and let my admins make minor tweaks to the site.
Maybe I’m dreaming, but is there a way to have the best of both worlds???
Perhaps, I’m seeing this more because I’m trying to use ModX as an application framework. I’m reusing the user management, templates, etc. But we’re making a serious DB driven/PHP site within the framework. Lots of HTML, PHP, and ajax. Good stuff.
Does this make any sense? Or am I just not "getting" MODX?
-
☆ A M B ☆
- 24,524 Posts
You are dreaming the same dream we all are. This is definitely on the horizon. First the core developers want to get the core slimmed down and modularized, with better APIs and event hooks, the better to hook on workflow and revision control functionality.
-
MODX Staff
- 10,725 Posts
Current Ideas
I use Eclipse to develop my sites with MODx and often ending up keeping all the source in php files under the snippets or plugin or modules directory, and include those files in my snippet code. Then I can edit and FTP the source of the includes without ever having to save changes in the manager, unless I add a new file or similar.
Future Roadmap
The 1.0 roadmap will include built in versioning capabilities for all content and I’m looking into ways that FTP, WebDAV or other protocol access could be setup for managing multi-cultural content (with revisioning and rollback) throughout MODx, be it PHP code, CSS, JS, XHTML, or whatever.
We’re definitely striving to bring the application framework up to par with the content management and templating systems in MODx. It’s good, but it’s going to be even better come this summer.
Cheers
-
☆ A M B ☆
- 24,524 Posts
Indeed, I’m working with someone who uses an IncludeFile snippet for the entire template! All the template consists of is [[IncludeFile?fileName=`filename`]]. Then when the site is finished, he moves the template into the database to eliminate the extra overhead. He says he’s addicted to his "undo" button
>> [[IncludeFile?fileName=`filename`]]
That sounds like it could be decent.
Can it include PHP?
If the included file contains TV’s or other MODX tags, do they get parsed?
Is your customer will to share that snippet?
-- Jorge.
-
☆ A M B ☆
- 24,524 Posts
Here’s the exact code he uses. The template has the usual MODx tags, no problems. The template file he includes is a .php file that actually has no php code.
if ( !isset($phpfile) || $phpfile == "" ) return "No file specified."; //check if there's a file given.
ob_start();//Start the buffer
include $phpfile; //include
$ob_contents = ob_get_contents();//get contents from the buffer
ob_end_clean();//and kill/delete the buffer
return $ob_contents;//return it to etomite.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="nl">
<head>
<title>[(site_name)] » [*pagetitle*]</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
[[GetKeywords]]
<style type="text/css">
@import url('assets/templates/Template/style.css');
</style>
<script type="text/javascript">
[*Marquee*]
</script>
<!--[if lt IE 7]>
<style type="text/css">
ul.navigation li.category:hover ul{
position:absolute;
top:0;
left:186px;
}
.content h1{
font-size:15px;
}
</style>
<script src="assets/js/ie7-standard-p.js" type="text/javascript"></script>
<![endif]-->
</head>
<body>
<table cellpadding="0" cellspacing="0" class="mainTable">
<tr align="left" valign="top">
<td colspan="2">
<table width="100%" cellspacing="0" cellpadding="1">
<tr align="left" valign="top">
<td class="w22">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle" class="logoBox">
<a href="[~[(site_start)]~]">{{FlashLogo}}
</a></td>
</tr>
<tr>
<!-- Start Navigation -->
<td>[!DropMenu?&levelLimit=2&topnavClass=navigation&removeNewLines=`1`!]</td></tr>
<!-- End navigation -->
<tr><td> {{address}}</td>
</tr>
</table>
</td>
<td class="pad" id="content"><div id="searchForm">[!FlexSearchForm?FSF_landing=`22` &FSF_showResults=`0`!]</div><div class="content">[*content*]</div></td>
</tr>
</table></td>
</tr>
<tr><td colspan="2" align="right" class="smallText">{{footer}}</td></tr>
</table>
</body>
</html>
Some of you may recognize the Etomite AlexRedux template here...
I’m not so keen on developing in modx, I rather tend to isolate my business rules outside the CMS and use it for what it’s good at: managing content and presentation.
My snippet all look like the one below... and I do have access to modx db connection et al.
[tt]$html = ’’;
require_once( ’./assets/templates/.../lib.dbio.php’);
require_once( ’./assets/templates/.../lib.dcio.php’);
$html = ShowSearchForm();
return $html;
[/tt]
A thing of beauty is a joy forever ( John Keats)
Quote from: protocol0 at Sep 09, 2006, 08:14 PM
gave this method a shot, and modx api calls no longer work
Did you declare a
global $modx; in your functions??
A thing of beauty is a joy forever ( John Keats)