For the site I am currently working on I need several directories, eg company directory and weblinks directory.
However I want this to appear on the site as two different directories, although they share a common design and layout. To complete this illusion I wanted to get rid of the Root-link displayed in the category list on the Bookmarks-component detail page.
Also, I put all my "new root categories" directly below the category named "Root".
This is how you do it.
Here is the file that needs editing:
joomla15/components/com_bookmarks/bookmarks.php
Change
while ( $curcat != -2 ) { // Until Cat is RootCat's parent (-2)...
to
while ( $curcat != -1 ) { // Until Cat is RootCat's parent (-2)...
AND a few lines down comment out the arrowimage output:
/*
if (!$pathway) {
$ref = mosBookmarksTools::imageArrow() . ' ' . $ref;
}
*/
You will also need to do some hacking to get the menu link right. You need to use the menu type "External URL" and then send in something like this for the URL:
index.php?option=com_bookmarks&mode=0&catid=1
then you do the same for your other menu items linking to your specific directories:
index.php?option=com_bookmarks&mode=0&catid=2
...
That's it!
Only problem remaining is how to get the menu items to light up when they have been clicked...
Wednesday, January 21, 2009
Thursday, January 15, 2009
Gallery2, UserAlbum and breadcrumbs
With eg the Matrix theme in Gallery2 you get a BreadCrumbs trail at the top of your page. If you are also using the module UserAlbum for Gallery2 your user's albums will be shown as the real name of the user in the breadcrumbs. Maybe you would rather show the name of the user?
Help has arrived! You simply have to edit the file:
/gallery2/modules/core/templates/blocks/BreadCrumb.tpl
And replace the ELSE-case with this:
Help has arrived! You simply have to edit the file:
/gallery2/modules/core/templates/blocks/BreadCrumb.tpl
And replace the ELSE-case with this:
...
{else}
<span class="BreadCrumb-{counter name="BreadCrumb"}">
{if ($theme.item.entityType == 'GalleryAlbumItem') }
{if ($theme.item.pathComponent == '') } {* case for root album *}
{*(GalleryAlbumItem-empty)*}
{$theme.item.title|markup:strip|default:$theme.item.pathComponent}
{else}
{*(GalleryAlbumItem)*}
{$theme.item.pathComponent|markup:strip|default:$theme.item.pathComponent}
{/if}
{else}
{*(GalleryPhotoItem)*}
{$theme.item.title|markup:strip|default:$theme.item.pathComponent}
{/if}
</span>
{/if}
Wednesday, January 14, 2009
Stuck in a rut editing Gallery2 templates?

So, you got stuck editing templates in Gallery2? Some error in the template makes the entire application refuse to load? Well, have I got the cure for you:
As you can see, you have to force the Smarty templating system to reload the template.
Just don't forget to reset that after you are done...
Monday, January 12, 2009
Joomla 1.5 extensions, modules and experiences

Finally, it is all coming together. Joomla installed, all extensions I want installed into Joomla, some other nice to have extensions also. This is what I'm using for the new community site I'm working on:
- Community Builder - the basis for any community site
- Gallery2 - an image gallery with a gazillion features. Most of them should be turned off I think so that the community users aren't overwhelmed by all possibilities...
- FireBoard - a forum extension. Pretty nice, not too feature heavy but still got what counts.
- JoomlaPack - a backup-solution for your entire site - be sure to use it!!!
One thing that really amazes me is that I haven't had to code a single line of PHP, almost...
Mostly it's all been down to configuration. Actually a lot of configuration. But hey, for one hour of configuration I get 50-100 hours of code for free, so there's no point in compaining about that.
About the 100% configuration almost, well, one specific functionality that I wanted was to show the latest image comments from the gallery. But that module had not yet been released. So I went ahead and made a simple SQL-executor-with-a-row-template-kind-of-module. Works pretty nice actually. Also I'm pretty sure I'll have use for it in the future as well.
It lets you execute any SQL and then format the rows as you please. Very flexible. Maybe not exactly the Joomla-API-way, but good enough for me, for now.
Here's the important piece of code for the module:
echo '<div class="moduletable"><ul><li>';
$result = mysql_db_query($db_name, $sql);
while ($row = mysql_fetch_assoc($result)) {
$rowTpl = $tpl;
$keys = array_keys($row);
for ($i = 0; $i < sizeof($keys); $i++) {
$key = $keys[$i];
$val = $row[$key];
//echo '==>' . $key . '=' . $val . '<br/>';
$rowTpl = str_ireplace('#'.$key.'#', $val, $rowTpl);
}
echo $rowTpl;
//echo '<hr>';
}
echo '</li></ul></div>';
Etiketter:
configuration,
joomla,
modules,
open source,
php
Friday, January 2, 2009
Joomla CMS and the power of open source
My previous projects on the web have all used my own homegrown CMS (content management system) all made in Java. Over the last months I have realized that there is so much functionality I want that is already implemented somewhere else out there that me implementing it all over again just seems a big waste of time. Time I don't have.So I started looking around for a new CMS based on Java. Well, there are some out there. I am a Java-guy. But the truth is, for every Java CMS there is 10 php-based CMS:s. And there are also more users, documentations and plugins for these CMS:s. Also it is a lot easier (and cheaper) to find webhotels for php-solutions than java-solutions.
I arrived at the conclusion that I really needed Drupal or Joomla - two of the biggest players around. Drupal have been in the game longer, but Joomla seems more modern is growing fast. I first tried Drupal for a while but then switched to Joomla. I'm quite happy with that decision so far. And every time I browse for plugins I'm just amazed at how much coding is going on out there!
In the future I hope to be able to contribute some plugins myself as well. Stay tuned!
Subscribe to:
Posts (Atom)