-
☆ A M B ☆
- 24,524 Posts
I am trying to use MyComponent to create a very simple package - one template with one accompanying .css file.
So I have a fresh new installation of Revo 1.0.7 on localhost, with it set up as a project in PHPStorm. All I've done to it is to install MyComponent. All I want to do is create one new template with a link to its .css file.
Now what?
Should I create a new MC project? Do I really need a GitHub repository for this? Or a local git repository? I'll be doing this with dozens of templates - most will have multiple templates and chunks, a snippet or two, and some TVs, as well as js and css and image files. Should I create a new MC project for each template? A git repository for each template, or can I work with a single "templates" git repository and have a branch for each template?
-
☆ A M B ☆
- 24,524 Posts
I created a new project, "template". I edited the template.config.php file to what seemed good to me, but when I ran bootstrap I just got a blank page. So obviously what seems good to me is not so good.
<sigh> missing ) on one line. Seems to be OK so far. Now I'll try just creating a new template with its css file in assets/theme/css/theme.css and see what it'll do with it.
[ed. note: sottwell last edited this post 13 years, 6 months ago.]
I use MyComponentMigxUI to create my packages.
There is an option, where you can export files into your myComponents - directory
I have them in assets/components/nameofmypackage/css/
the configuration for my workingDirs from where to export are this lines:
'workingDirs' => array(
'core' => MODX_CORE_PATH . 'components/' . $packageNameLower . '/',
'assets' => MODX_ASSETS_PATH . 'components/' . $packageNameLower . '/',
),
in this file:
https://github.com/Bruno17/mycomponentmigxui/blob/master/core/components/mycomponentmigxui/elements/chunks/migxexample.config.php
some screenshots:
http://www.revo222.webcmsolutions.de/index.php?id=51
you just need to put your stuff in a category with the name of your package
and do this steps from the CMP after having the configurations done:
1. bootstrap
2. export Objects
3. export files
4. build
That's it.
-
☆ A M B ☆
- 24,524 Posts
Should have guessed MIGx would come into this somewhere

MODx's version of emacs
I did finally figure out how to get the actual template packaged properly, even installed it in another Revo installation. Without the supporting .css files, but it's a beginning. Import what? Export which? I think I'll just do this a few times, maybe with a chunk or TV or two added to the mix, until I'm sure of what it's doing so far.
-
☆ A M B ☆
- 24,524 Posts
Where can I get this package? It doesn't seem to want to show up in Package Manager.
I don't think it's been released. You can clone it from the GitHub link in Bruno17's message, run the build.transport.php file in the _build directory and it should show up in your core/packages directory to be found with "Search Locally for Packages."
You'll have to clone it inside a MODX install and create and/or edit a build.config.php file based on the the build.config.sample.php file.
I think that's everything.
-
☆ A M B ☆
- 24,524 Posts
Well, so far I'm OK with editing the config file manually; old Linux server admin here, not to mention running a Maximus BBS for a couple of years - now THAT was a config file! Just having a bit of a problem figuring out how to specify the css, js and image files. Everything else is working fine.
You don't actually have to specify them (though Bootstrap will create skeleton files if you do). You can just copy them to somewhere under the dev. assets directory and they'll automatically end up where they should if $hasAssets=true;
-
☆ A M B ☆
- 24,524 Posts
By "dev. assets directory" do you mean /assets/themes/itfits/css/itfits.css? and /assets/js/jquery.js? And they'll get included? Because that didn't happen when I was happily packaging up templates and chunks.
-
☆ A M B ☆
- 24,524 Posts
I never did get exactly what the situation is with other packages, for example Wayfinder. Can MyComponent install these as well? (I know the Articles package installs all kinds of stuff).