Ok guys, heres my deal. I was wanting to make a nice looking website with a strong foundation for easily changing and adding dynamic content that easily updatable (news blog, photos, etc). Someone over at the Sitepoint forums directed me towards, and it actually looks quite excellent, but I am missing something somewhere...I really don’t know where to get started. I am not really a coding cowboy, I know enough HTML and CSS to make a basic webpage that looks decent, and have setup and hacked about in wordpress, but outside of that I am not too skilled. I read the documentation and installed it on my site, but I am kinda lost otherwise. I basically wanted to use my websites template, but I am not sure where to put the CSS. I was never a big fan of doing inline CSS because then it has to be on every single page. I also tried downloading and installing someone elses template for reference, but it doesnt show up in the menu, even after logging out and back in. I am actually just clueless on where to start after install, and getting my website transferred over to MODx. It looks like a pretty flexible CMS, and I want that, but I dont know where to go from here.
Upload the CSS to wherever you want and edit your template to reference it.
Quote from: bocmaxima at Jan 25, 2007, 05:04 PM
I also tried downloading and installing someone elses template for reference, but it doesnt show up in the menu, even after logging out and back in.
Which "menu"?
Figuring out which bits are added via the Manager backend by copy/pasting into boxes, and which bits are added via normal FTP is a key step in mastering MODx. Some add-ons need both to be done.
The next crucial thing to grasp is that MODx generates HTML by pulling together bits of HTML that you’ve entered and bits that routines generate on the fly. The *reason* that you don’t have to register the CSS as a "resource" is that MODx doesn’t care - the CSS is purely referenced in a bit of template that it happens to regurgitate when building a page. Only the browser cares.
For completeness, it is often felt necessary to point out that a CSS file could easily be a MODx document - which doesn’t really help make matters any clearer. It is also worth knowing that some add-ons can insert inline styles and/or additional style sheet references into the HEAD.
-
☆ A M B ☆
- 24,524 Posts
An example of routines to build HTML on the fly is the Wayfinder snippet. By itself it will scan your documents and build a nested unordered list of links that you can style as you please to make a menu or sitemap. Learn how to use it to the full and you can make any kind of menu or list of your site that you could possibly want.
Ditto is another, somewhat similar snippet that takes bits of content of all the documents in a section of your document structure that you specify and makes a nice blog or news or catalog or whatever else you might want a list of summaries with links to the whole page for each summary listed.
eForm takes a chunk (a bit of HTML you put in the Chunk section of the Manager) to use for a form, validates the input and returns with an error message if there’s anything wrong, then once the form is filled out properly it will email the user’s input from the form to whomever you tell it. It also has "hooks" in the programming code you can use to add your own functions to have it do other stuff at different times during the whole process.
The MODx parser starts with the document ID that the browser requested, gets all of its information including its template, then picks through the template processing all the MODx tags in the template. If any of the tags contain other tags, they get processed as well. Eventually, a complete HTML page is built up, then sent to the server to be sent back to the browser.
You can see this quite clearly if you just copy the source of any HTML page from your browser, paste it in as a template, then use that template for a document. No MODx tags, just exactly what was in your browser’s "View Source" to begin with. When you go to the page using that template, you will see precisely what you had to begin with.
The "trick" is to replace the content, not the structure, of this HTML file with the different MODx tags to get the dynamic building of pages. Replace the menu with [[Wayfiinder]] and now your menu will be built for you; adding or moving pages won’t mean having to re-write your menu. Replace the main content text portion of your page with [*content*] and now every page using that template will have that document’s content. So if you have one or 1,000 pages, they’ll look the same except for the content, and if you need to change your address in the footer, you don’t have to change every page, just your template.
So learn what tags do what, and learn to read the comments at the beginning of most snippets, or the documentation for the really big ones like Wayfinder or Ditto or eForm to see how to make them behave just the way you want, and MODx will produce whatever kind of pages you want on your site.
bocmaxima,
glad to see you found your way here.
You’ve just gotten a helping hand from some of the most, "in-the-know," MODxers!
Just take it slow. Get a feel for the template area and inserting the MODx tags for replacement... content, site name, description.
Understand how links work using [~id~], so if you home page is id=1 then a link on another page would be written as [~1~].
As mentioned, Wayfinder works great for your navigation. It is extremely powerful and can get rather complex, but is also quite capable of running right out of the box. Many snippets provide the ability to template the layout, but always first try just a plain or bare-minimum snippet call first... you might find out that you don’t need to do anything else. Also, view source on your code after trying a snippet so that you get a feel for what code [!Wayfinder!] or whatever snippet you are using inserts in place of the snippet name you inserted.
sottwell also has a limited demo that you can access the manager which I’d recommend taking a peak around in as it might give you a better feel... sometimes it helps to see what someone else has done under the hood.
And when all else fails, you’ll find lots of help reading through the forum and posting your own questions.
|
Identity Developments delivers SEO focused web design and web presence services
- it's not about websites, it's about your identity. |
Hey guys, thanks for all the replies. I think one of the key things I was missing was replacing HTML with MODx script...at first it looked all GUI based, but I couldnt get anything to work right. So to for the menu to work you replace "page.html" with the [~link~], right? Thats one of the concepts I didnt get. Integration of the CMS with your code.
Seriously, I am pretty much a n00b to CMS, and even CSS, so it takes me longer.. I also need to have core concepts down before I can progress in things.