irislines web design
irislines web design

Posts Tagged ‘Joomla!’

Permissions for global_checkin can’t be set

I tried to have administrators use the global checkin function on a Joomla 2.5 site and in spite of how the permissions were set, the administrators did not have access to use the global checkin.

I found this solution on the joomla forum (http://forum.joomla.org/viewtopic.php?f=616&t=642208)

“The reason why we can’t give access to administrators is that Joomla team hardcoded permision for com_checkin (and some others) inside the component itself. So it is irrelevant what do we do on admin panel. This is quite stupid, because Joomla could simply hide options for permissions if that does not make any change.

Now, the solution:
Open file administrator/components/com_checkin/checkin.php and find  line 13

Code:
// Access check.
if (!JFactory::getUser()->authorise(‘core.admin’)) {
   return JError::raiseWarning(404, JText::_(‘JERROR_ALERTNOAUTHOR’));
}

This code causes the problem I was talking about. Change it with this to allow this component to be controlled by permissions settings.

Code:
if (!JFactory::getUser()->authorise(‘core.manage’, ‘com_checkin’)) {
   return JError::raiseWarning(404, JText::_(‘JERROR_ALERTNOAUTHOR’));
}

BT Content Slider

I’m upgrading a site from J1.5.26 to J2.5.6 and needed a replacement for an extension that will not work in 2.5:   the Ultimate Content Display extension.

Today I found a free extension from bowthemes.com  called BT Content Slider.

With persistence I got it to work but….  there are a few caveats:

I needed to be able to select article to display in a sidebar module — one at a time,  fade in effect as they rotate from one to another.

The format for entering items is this:    id1, id2, id3 (1,2,3)

where the numbers are the article item ids.

There’s another place to specify article order — and I was having trouble with this — some articles just wouldn’t show up, even though I knew the id was good.

What worked:   be sure list is in low to high order by ids   AND  set order to “random”.

OK.  I can live with that.

Another issue came up though with an article that had no associated menu item.  

The BT Content slider has a parameter for you to set a menu item “if the article id is not found” —  I figured this was a placeholder article to show if the content selection tool had no results.   But NO!    If an item is found, it will display the page header of the menu item set in this parameter.    Odd results — click to see a schedule of an event and get “Ways to Give”  as a heading over the schedule content.    NOT OK!

So… the MORAL of this story is to use that hidden menu — and be sure all articles exists in at least one menu — even if its only the hidden menu.

May I give a plug for NoNumber.nl‘s wonderful Add to Menu extension.   Create your menu item right from the article creation/edit screen!

 

Invalid entry

Ever get the message  “Invalid entry”  when trying to access the Joomla! backend?

The url will be   yoursite.com/administrator/index.php.

You know the password is correct,  but maybe a session cookie is getting in the way…

Try deleting the /index.php from the url — for me,  I find that it let’s me back in.

 

 

How to repair Joomla _session table.

A recently launched Joomla 2.5 site was down this morning with the following error:

Table ‘./xxxx_suffix/xxxx_session’ is marked as crashed and should be repaired SQL=INSERT INTO `xxxx_session` (`session_id`, `client_id`, `time`) VALUES (’87b1b689ed654ea16833779add58ee44′, 0, ‘1342450283’)


Repairing a database table is not difficult,  but the error causes panic for the clients and I am not always sitting at my computer….

I created a ScreenSteps tutorial on how to handle an error like this and share it.

How to repair SQL database table

Joomla Bamboo template fix

The center column of my site, using Joomla Bamboo’s Meridian template was not behaving.

The template uses javascript to calculate the height of the columns and some tabs and sliders were causing problems.

Anthony wrote:

“The code at the bottom of the js/template.js file. The crucial bit is: jQuery(‘ul.jbtabs li,.moduletable-panelmenu span.mainlevel,h3.pane-toggler’).click(function(){ setTimeout(calculateEQ,200); }); The 200 is the delay in ms for the script to calculate the height of the item. In your case because the accordion content was large we set it to 500. The selectors that trigger the function are here: ul.jbtabs li,.moduletable-panelmenu span.mainlevel,h3.pane-toggler So you just need to add your selector there to get it to work.”

Today I had to add another selector:  h3.pane-toggler-down  so that a weblinks list spilled open would be considered in the calculations.  I didn’t need to submit a new ticket or ask for help, I just needed to access the ticket explaining how the problem was solved the first time.

The pesky part was that I had to renew my account to be able to access the old tickets with this solution.  So from now on I’ll remember to document solutions here as well and not rely on the ticket system from a limited-time support contract.

Device detection to single out the ipad for special styling

”   on the body element of the index.php file.

(Of course I also added a line to the template with that variable for testing  that would display the results and not force me to examine the code to see if it was working.)

In my stylesheet I could then write rules specifically for the ipad:

.ipad  element-needing-custom-styles  {property: value;}

I was doing this to solve a problem with how the quicktime player displayed on the ipad (fallback for no flash when using Allvideos)

I increased the height of the player container to 72 px in the plugin parameters,  then set the theses styles:

/* adjust allVideos audio player */

.avPlayerWrapper {text-align:left; width:230px; clear:none; }
        .avPlayerWrapper .avPlayerContainer {margin:0;}

.avAudio .avPlayerContainer {height:24px; overflow:hidden; }
        .avAudio .avPlayerBlock {position:relative; top:-48px;}

#ipad .avAudio .avPlayerContainer {height:72px;}
         #ipad .avAudio .avPlayerBlock {position:relative; top:0;}

The results made mp3 players that were ugly, but functional.

The much better solution was to use WidgetKit’s Media Player from YooThemes.com, but I’m still glad to know how to target the ipad specifically should I ever need to.

-->

My friend and colleague Bill from Grumpy Engineering  helped me with this one:

I added this to the php block at the head of my template:

$isIPad = preg_match('/ipad/i', trim($_SERVER['HTTP_USER_AGENT']));
if ($isIPad) $device="ipad";
else $device="not-ipad";

and then could use

class=“<(question mark)php echo $device;  ?>”   on the body element of the index.php file.

(Of course I also added a line to the template with that variable for testing  that would display the results and not force me to examine the code to see if it was working.)

In my stylesheet I could then write rules specifically for the ipad:

.ipad  element-needing-custom-styles  {property: value;}

I was doing this to solve a problem with how the quicktime player displayed on the ipad (fallback for no flash when using Allvideos)

I increased the height of the player container to 72 px in the plugin parameters,  then set the theses styles:

/* adjust allVideos audio player */

.avPlayerWrapper {text-align:left; width:230px; clear:none; }
        .avPlayerWrapper .avPlayerContainer {margin:0;}

.avAudio .avPlayerContainer {height:24px; overflow:hidden; }
        .avAudio .avPlayerBlock {position:relative; top:-48px;}

#ipad .avAudio .avPlayerContainer {height:72px;}
         #ipad .avAudio .avPlayerBlock {position:relative; top:0;}

The results made mp3 players that were ugly, but functional.

The much better solution was to use WidgetKit’s Media Player from YooThemes.com, but I’m still glad to know how to target the ipad specifically should I ever need to.

Joomla solution for non-flash mp3 player

I searched the JED and the best I could come up with was to use Allvideos to create simple, single mp3 players for a website I’m working on.

The syntax of this pluggin is nice and simple:   {mp3}Name-of-file-without-extension{/mp3} or

{mp3remote}http://other-site.com/name-of-file-with-extension.mp3{/mp3remote}

But…  Allvideos uses Quicktime as a fallback when flash is not available and on the ipad the Quicktime controller was clunky.   I did get a snippet of php to detect the ipad and then could address styling the controller to make it better — but it was still clunky.

WidgetKit from youtheme.com

I kept looking for a solution that would provide html5 audio  and finally found it in youtheme’s widgetkit media player.   This uses html5 audio and falls back to flash instead of the other way around.  It suits me!

The syntax is just a bit more complex, but certainly doable:

 

Menu item ordering bug in Joomla 1.7.x

I have a site that started its life in 1.7.0.  After upgrading to 1.7.3 I lost control of the order of menu items.   Numbering and saving didn’t work.  Tweaking with the blue arrows only worked in some places, and then didn’t seem to stick.  I “solved” the problem by using the MOVE function at the bottom of the menu items manager page, selecting an item and moving it to the same menu — this would add it at the bottom of the list.   I repeated until all were in the order they had been in before the upgrade to 1.7.3.

Searching the joomla forum I found a few related posts in this thread:

http://forum.joomla.org/viewtopic.php?f=579&t=636152&p=2615670#p2615670

>>Infograf and I seem to have found the problem! It is a problem with JUpgrade – the column “ordering” in table “_menu” is filled with different numbers – it should be just zero’s as the ordering of the menu items is drawn from the columns “lgt” and “rgt”.

They then give the sql command to set all to zero.   I can’t paste the code here just now.

Many in the forum were pointing at jUpgrade as the source of this problem and someone uploaded a mini component to do the above sql task.

Category — Categories — which menu item to choose?

I’m preparing a talk for JoomlaDay NYC on Alternative Layouts and Custom Menu Item Types.  There had been so many posts on the joomla.org forum about these new capabilites of Joomla 1.6 and 1.7,  and so many were complaining that the “feature” simply didn’t work, I was getting a bit worried about the presentation.   I had proved them working back in the spring for a presenation at Joomla Day New England, but had things changed in the subsequent versions?

Finally last week I had a chance to put them all through their paces and the good news is that Alternative Layouts and Custom Menu Item Types DO indeed work —  for all kinds of Joomla items:   articles, contacts, weblinks, and category displays like blogs and lists.

The ONE Joomla entity where my template overrides (which worked) could not be turned into Alternative Layouts OR  Custom Menu Item Types  was the com_content layout for Categories.

I was trying to demonstrate using the sample data and the Parks Photo Gallery which is a demonstration of using regular articles to create a photo album of sorts.   I didn’t like that the Categories layout said  “Article count”  for each sub-category and wanted to change that to “Image count”. 

In the sample data, the menu item for the Parks Photo Gallery was set as a Categories  list.   When that didn’t work, I changed it to a Category list menu type and then applied my changes there.   Since there was a menu item to the top level category I had to take the further step and create the custom menu item type and then use that for the menu.   All well and good.   A parameter allowed me to skip the verbage  “There are no articles for this category”  and proceed directly to listing the sub-categories with their Image counts.

It’s had me thinking about when you would ever need the Categories layout, since I was able to get the same results with the Category layout.   Any ideas anyone?   Please email me!

 

Szaki Table (Joomla Extension)

Szaki Table is a Joomla Extension that allows sorting a table by any column header.

I used it on a client’s site to make a list of educational opportunities sortable by date, location, type.   All was well until we added a column for cost and entered cost in US Dollars using the $ sign.

The entire table was replicated in the cell with the $!  

Fortunately one only needs to “escape” the $  by including   before the guilty character.

In researching the extension’s website to see if this had been covered already, I discovered that the extension has many more possibilities — but the English version of the developer’s site is hard to decipher.  I’ll consider this for future projects if a client needs to have interactive data tables.   I think you’re supposed to be able to get the table code from pasting in a csv (with semi-colons rather than commas)!  That’s worth investigating!

IrisLines LLC
101 Washington Street
Brattleboro, VT 05301

802 257 7391

info@irislines.com