Componenet Only Template
Sunday, 20 December 2009 17:03
The power and flexibility of Joomla allows for the creative use of template techniques to expand its capabilities. One such technique is the use of a component only template. It expands the possibilities of a Joomla website by providing the ability to include content such as splash pages, full-screen Flash movies, and even pseudo 404 pages for hiding a website from a casual passerby. The following tutorial will show you how to implement a component only template.
To give you an idea of what can be accomplished with a component only template, we have put together the following demos. Each one is an article contained in this website. The only difference is the template.
A component only template is exactly as the name implies, only the component. No module positions or other elements are included in this type of template. This allows for the possibility to exclusively display the content of an article.
Modify RokDownloads Date Format
Monday, 23 November 2009 08:30
RocketTheme produces some great Joomla! templates and extensions. Of them, we find ourselves using RokDownloads quite often. One of the most requested change that we need to make to it is the date format.Originally posted by Brian Towles of Team RocketTheme at the RocketTheme Forum:
Add this line for the languages/en-GB/en-GB.com_rokdownloads.ini
DATE_FORMAT_LC4=%m-%d-%Y
Web Hosting and Property Taxes
Friday, 20 November 2009 08:16
Web hosting is a lot like property taxes. Think about it...
Let's say you invest $500,000 in building a custom home, a modest home of your dreams. It's not unrealistic to expect, and easily accept, paying $500 a month in property taxes. That's .1% of the cost to build your home, not including the cost to furnish and maintain it. So what does that $500 a month get you? It gets you Police (security), City Hall (support), Public Works (maintenance) and a road department (connection to the outside world). Without property taxes, and subsequently these services, your home would end up being in a run down area that yo may not want to live in.
The same thing can be said for websites and web hosting. When considering a web hosting partner, ask yourself where you would want to live.
Redirecting Joomla's View (MVC)
Wednesday, 09 September 2009 09:52
In some cases, redirecting the view of a component of module can be easily accomplished by a bit of JavaScript. For instance, the component ccNewsletter doesn't allow for an option (as of this writing) to redirect after a successful event occurs. To accomplish this task, simply add the following code at the end of a template override for the view of the component.
You can control the time and destination of the redirect. Time is 1000 milliseconds in this case, and the destination is http://betweenbrain.com/.
For example, ccNewsleter's activate view was:
After the redirect code addition, it is now:
Download the ccNewsletter overrides. Extract the contents to the HTML folder of your template and enjoy.
Customizing the print pop-up
Tuesday, 08 September 2009 14:26
As Andrew Eddie at The Art of Joomla reports, the file /templates/$template/component.php controls the print view of a given article. Component.php acts just like index.php, which controls your template layout, module positions and CSS, among other things.Component.php can be equally customized with features like module positions and custom CSS files. This is done using the same methods as with index.php.
At the heart of component.php is:
Pop-up only Styles
To add a specific stylesheet for your print pop-up, simply change the stylesheet in the head section to one that suits your needs. I'd also recommend using the media attribute to limit this new stylesheet to print and / or screen. For example our head may now look like:
Depending on whether or not you have separated your stylesheets by form and function, you could even use @import to grab your typography, module overrides, browser normalization rules and other styles. In some cases you may need to add a few extra lines of CSS to our new screen.css file to override some of your other rules. For example, screen.css could look like:
Pop-up only Modules
Component.php allows for the same code to be used for creating module positions. This can be especially useful if you want a specific header image or content displayed on only certain articles when they are printed. To add a module position, use the same code that you would with index.php.Since we want this to be displayed only certain print pop-ups, I use the countModules method. For example:
Now, you can create a new module to contain whatever content or images that you'd like, assign it to your newly created position ("popup" in this example) and control when it appears by use of menu assignments.
The final contents of your new component.php could look like:
Refrences:
The Popup Template File
Creating a Basic Joomla Template
Counting Modules in a given module position
More Articles...
Page 1 of 3
