The Super Secret Sitemap Trick

Did you know you can have a sitemap in your Joomla site without installing any additional extensions?

Really? How?

The menu module already does everything we need: it’s essentially a tree with all the items in the system. All we need to do is make it look like a component.

  1. Create a new article called ‘Sitemap’. In the body, type {loadposition sitemap} and save it.
    (screenshot)
  2. Make a new menu item called Sitemap, and point it to the article.
    (screenshot)
  3. In the module manager, make a new Menu module. Set ‘Menu name’ to the menu you want to display as a sitemap.
    (screenshot)
  4. In the position box, type ‘Sitemap’. Obviously this refers to the position we used earlier in the {loadposition…} tag
  5. Make sure you set ‘Always show submenu items’ and ‘Expand menu’ to yes, and save.
    (screenshot)
  6. Add more modules for each menu
  7. You should now have a nice sitemap in the frontend.
    (screenshot)
    You can style it with CSS or if you’re creative, you can add some folding using javascript.
  8. Post a link here to your sitemap, to show the world what you did

Got any quick’n’dirty tricks to do cool stuff in Joomla that was never intended to be used that way? Let us know!

Read more

Saying goodbye to an old friend !

Today we say goodbye to mambodocman.com. Launched in March 2004 it has served the DOCman project for over 4 years. Last November we moved the forums over and today we are letting the curtain fall over the old site.

Saying Thanks!

This is an excellent opportunity to say thanks. First of all a big round of applause goes to Vasco Nunes, founder and original developer of DOCman. Vasco started development of DOCman in the summer of 2003 and worked on the project from versions 1.0 to 1.3.

Vasco is also the one who invited me to join the DOCman project in early 2004 to help out with DOCman 1.2. My work on DOCman later caught the eye of the Mambo core team which I joined in April 2004.

I would also like to thank all the previous contributors for the efforts they have put into the DOCman project over the past years (in random order):

  • Charles Gentry (developer)
  • Timothy Beutels (developer)
  • Mathias Verraes (developer)
  • Shayne Bartlett (doc writer)
  • Peek (graphic designer)
  • Alexander Krestinin (tester)
  • Mark Semczyszyn (tester)
  • Marko Milenovic (tester)
  • Krisstoffer & Harri (forum moderators)

These are the people that have made DOCman one of the most popular extensions for Mambo and Joomla!.

Looking into the future

DOCman development has been a little slow of late, because we’re working on Nooku all the time. Mathias, current lead developer for DOCman, already answered this question in a comment on one of his recent blog posts:

We’ll make an announcement on the future of DOCman soon. Don’t worry, DOCman is not dead — it’s not even sleeping, just taking a quick nap!

We have big plans for DOCman future, keep a close eye on this blog in the coming weeks…</p>

From today forward all information about DOCman can be found on our extensions page.

Read more

Hidden feature: Joomla’s media folder

Traditionally, Joomla extensions stored all their assets (images, javascript, css, flash files…) inside the extension’s folder. However, because these files are supposed to be publicly accessible, and all other files should stay hidden, that doesn’t really make sense. Fortunately, this was fixed in Joomla 1.5.4. Extensions can now use the /media folder.

How does it work?

Very easy: simply add a media tag in your extension’s manifest file.

Before:

<files folder="site">
 <folder>some_folders</folder>
 <folder>css</folder>
 <folder>images</folder>
 <folder>js</folder>
 <file>index.html</file>
 <file>mycomp.php</file>
</files>

After:

<files folder="site">
 <folder>some_folders</folder>
 <file>mycomp.php</file>
</files> 

<media destination="com_mycomp" folder="media">
 <folder>css</folder>
 <folder>images</folder>
 <folder>js</folder>  
 <file>index.html</file>
</media>

Inside your installable package, you should now have the folders /site and /media. During the extension’s installation, the files from /media will be copied to /media/com_mycomp (or plg_myplugin or mod_mymodule).

Benefits

Separating publicly accessible assets from the rest of the system like this has some security advantages. Ideally, you’d move all other files below the document root, increasing security. Joomla doesn’t support this yet. What you can do however, is add a htaccess file in /com_mycomp with ‘deny from all‘. This way you don’t need to litter your component with index.html files and defined(‘_JEXEC’) or die(); statements. Of course, this assumes that the end user’s host has AllowOverride turned on.

Read more

Using Joomla! as an intranet

If you’re using Joomla! for an intranet, or any site that is closed down completely for all non-registered, there’s a simple trick: put your site in offline mode. Out of the box this will lock down everything for everyone who hasn’t got backend permissions, but there’s a way to change that.

Offline mode

Step one is to put the site offline. There’s an option for that in the Global Configuration. You’d normally use that when making significant changes to your site, to keep users out, but allow managers and administrators in. In our case, we want to allow all registered users. I suppose that with the new ACL in Joomla! 1.6, there will be a place where you can change this. For now, we’ll just make a small hack to /includes/application.php

// Find this line:
if ($this->getCfg('offline') &#038;&#038; $user->get('gid') &lt; '23' ) {

//Change it to: 
if ($this->getCfg('offline') &#038;&#038; $user->get('gid') &lt; '18' ) {

The template

You might also want to adapt the look of the login page to your site. Here we don’t need to hack a thing, as we can use template overrides. Copy the file /templates/system/offline.php to /templates/[YOUR_TEMPLATE]/offline.php. It’s plain HTML with some PHP tags, so you should have no problem editing it to your liking. Changing the graphics and some text will be sufficient for most people.

Read more