Tuesday, 21 January 2014

Joomla 3 template and bootstrap

So, after making a nice template the same as I'd done in Joomla 2.5, there are some slight differences when you log onto the front-end. Noticably that the cute little icons of yesterday are gone.

Reading into it, there's this new thing called BootStrap. Very good once you get the hang of it. I found a nice tutorial on it here

The main things to do to get bootstrap are:

  1. In the index.php file for your template, right at the top include (tutorial here):
    1. $doc = JFactory::getDocument();
    2. $doc->addStyleSheet($this->baseurl . '/media/jui/css/bootstrap.min.css');
  2. Secondly, make sure the including your stylesheets here

Just be sure to override stuff in your template when it pops up.

Saturday, 18 January 2014

JEA search box improvements

In trying to create a good website for an estate agent it needs to have good search facilities. JEA provides some straight forward search, but I want a nice simple 'one box only' solution for the front page.

I found this forum discussing the issue and someone suggested JEA TagCloud. Sounds good.

also found this advanced search plugin, turns out to be for Joomla 1.5

The way I'm working it is to add any search stuff to the title, that way you can just use the 'search by ref or title' option and you've then just got one search box. A bit of a sell out but who's looking!?

Friday, 17 January 2014

installing MFD canon IR 5840 and 4080 printers using only one queue

So we have a print management system, and Canon Multi Function devices installed everywhere. When we send a print, it goes to only one queue, and will print on whatever MFD you log on to. TRouble is there are multiple models, i.e.

Canon IR C4080
Canon iR C4580
Canon 5840

When we send a print to the 4080 using the 4080 PCL drivers from a Mac, it prints fine. If we send them to the 5840 it prints gobble-de-goop.

So now I'm testing the 5840 drivers on both to see what happens. I'm not sure which to try, the PS drivers or the UFR II (whatever that means) drivers.

Trying the Mac CUPS UFRII/UFRII LT Printer Driver (v10.2.1)  driver:
4080 - blank A3 page

Canon PS Printer Driver for MacOSX v4.00 (v4.00)  driver:
4080 - blank A3 page

Monday, 13 January 2014

Find the IP address of a computer with know MAC address (ethernet ID)

So, on my server it is reporting an issue with a computer with MAC address AA:BB:CC:DD:EE:FF (obviously I made this one up).

Trouble is, I know this computers MAC address but not it's IP address. So how do you find it?

Well, found this forum and this forum which basically tells you to use the command 'arp':

arp -a | grep "AA:BB:CC:DD:EE:FF "

arp lists all MAC address of computers on your subnet. But it's taking a long time. Reading more in the forum it looks like it works by pinging all the IP addresses, then asking it for it's MAC address. Long winded!

Wednesday, 8 January 2014

Joomla contacts lists with Photos and misc information

I'm making a website for a client and I want it to be easy for the client to edit the "meet the team" page. Previously I just made an article and add the information in the article and format.

Of course there is the contacts section in Joomla which can be used. A menu item can display all contacts in a list, only problem is also want a photo and the 'misc information' field.

I've looked at a few different extensions, but couldn't find something which simply added these two things to the list view.

I found a forum here which describes how to add the picture to the table in the contacts list view. It involves editing the default_items.php file and inserting:

<th class="item-picture">
<td class="item-picture">
   <?php if ($item->image) : ?>
      <a href="<?php echo JRoute::_(ContactHelperRoute::getContactRoute($item->slug, $item->catid)); ?>">
         <img alt="<?php echo $item->name; ?>" src="<?php echo $item->image; ?>" />
   <?php endif; ?> 

I wonder how hard it is to also get another cell with misc-information in?

To get the misc info in I inserted this code:
<div class="item-misc"> &lt;?php echo $item->misc; ?&gt; </div>

I've also read here that you can override the default_item.php by creating folders with your template directory /com_content/views/featured/

Will need to look into both of these. But not sure if I currently have the time!

So, looking further into it looks like in Joomla 3.2 you can create overrides from within the management system which I found here.

Go into the template files, then there is a tab called "create overrides". Sorted.  I picked the "com_contact" > Featured. This placed some new files in the template directory so that only this template overrides the defaults.

From there you can access the "default_items.php" file.

I basically replaced all li elements with div elements. Then I styled it with CSS

Monday, 6 January 2014

Joomla changing background image depending on menu item

So I want to change the background picture depending upon the page you're on. When I first looked at the problem I thought it'd be easiest to create a Page Class on the menu item, and then within the content area, make an item which appears behind everything (z-depth) and fills the whole screen. The proved quite difficult.

Turns out there is a much easier way, still using the Page Class on each menu item. Found the answer here in a forum, and here in a Joomla Help Page.

Basically, you can use PHP to find the page that is being displayed, and put the class suffix anywhere in the document, i.e. in the
  1. put this code inside the head tag:
    1. <?php $app = JFactory::getApplication(); $menu = $app->getMenu()->getActive(); $pageclass = '';   if (is_object($menu)) $pageclass = $menu->params->get('pageclass_sfx'); ?>
  2. Put this in the tag you want a class to. I.e. the body tag:
    1. <body id="<?php echo $pageclass ? htmlspecialchars($pageclass) : 'default'; ?>">
You can also add another stylesheet to keep the css even more streamlined. Sorted! (oh, by the way, I havent tested any of this!!!!)

Well, after leaving it a while I came up with a problem. The specific page I want to change is a "featured-blog" menu item, so when I put the Page Class, I have to put a space to separate it from the word 'featured-blog'.

But alas, the pageclass picks this up! I had to get a php line in which trimmed the spaces from the pageclass:

$pageclass = trim($pageclass);