Page 1 of 1

RTL Missing from JA Purity Hornav Menus

Posted: Sun Jun 28, 2009 8:52 pm
by jwwicks
Hello,

I recently answered a question in the JA Purity forum regarding a Right to Left Language issue concerning the Horizontal Menus in JA Purity.

Here's what I discovered...

1. The index.php file does not correctly check for RTL so the correct css file, ja-sosdmenu-rtl.css, is not included.

2. templateDetails.xml does not include this file in the css section

3. ja-sosdmenu-rtl.css has the old cssmenu id not the new mainnav id

Here's what needs to change to work with RTL menus
index.php starting at line 47

Code: Select all

<?php if ($this->countModules('hornav')): ?>
<?php if($this->direction == 'rtl') : ?>
<link rel="stylesheet" href="<?php echo $tmpTools->templateurl(); ?>/css/ja-sosdmenu-rtl.css" type="text/css" />
<?php else: ?>
<link rel="stylesheet" href="<?php echo $tmpTools->templateurl(); ?>/css/ja-sosdmenu.css" type="text/css" />
<?php endif; ?>
<?php if ($tmpTools->getParam('horNavType') == 'css'): ?>
<script language="javascript" type="text/javascript" src="<?php echo $tmpTools->templateurl(); ?>/js/ja.cssmenu.js"></script>
<?php else: ?>
<script language="javascript" type="text/javascript" src="<?php echo $tmpTools->templateurl(); ?>/js/ja.moomenu.js"></script>
<?php endif; ?>
<?php endif; ?>
templateDetails.xml starting at line 312 add

Code: Select all

<filename>css/ja-sosdmenu-rtl.css</filename>
Add ja-sosdmenu-rtl.css to the css folder with the following code

Code: Select all

/* Son of Suckerfish Dropdowns
---------------------------------------------------------
Originally developed by Patrick Griffiths and Dan Webb
http://www.htmldog.com/articles/suckerfish/dropdowns/
---------------------------------------------------------
NOTE: After a deep research, we decide to divide this
CSS into 2 parts. The first part will define the layout.
The second part will define the visual look for this menu.
---------------------------------------------------------*/

#ja-mainnav {
	margin: 0; /* all lists */
	padding: 0;
	float: none;
	text-align: right;
	border-left: 1px solid #555555;
}

#ja-mainnav ul {
	text-align: right;
		margin: 0; /* all lists */
	padding: 0;
}

#ja-mainnav li ul {
	float: right;
}
#ja-mainnav li {
	margin: 0; /* all list items */
	padding: 0;
	float: right;
	display: block;
	background: none;
	cursor: pointer;
	position: relative;
}

#ja-mainnav li ul {
	width: 16.4em;
	position: absolute; /* second-level lists */
	z-index: 99;
	top: -999em; /* using left instead of display to hide menus because display: none isn't read by screen readers */
	height: auto;
	w\idth: 15.9em;
	right: 0;
}

#ja-mainnav li ul ul {
	margin: -1.5em 0 0 14em; /* third-and-above-level lists */
}

#ja-mainnav li li {
	padding: 0 1em 0 0;
	margin: 0;
	width: 14.9em;
}

#ja-mainnav ul a {
	width: 14.8em;
	w\idth: 10.8em;
}

#ja-mainnav li:hover ul ul, #ja-mainnav li:hover ul ul ul,
#ja-mainnav li.sfhover ul ul, #ja-mainnav li.havechildsfhover ul ul, #ja-mainnav li.havechild-activesfhover ul ul, #ja-mainnav li.activesfhover ul ul,
#ja-mainnav li.sfhover ul ul ul, #ja-mainnav li.havechildsfhover ul ul ul, #ja-mainnav li.havechild-activesfhover ul ul ul, #ja-mainnav li.activesfhover ul ul ul {
	top: -999em;
}

/* This "unhides" the sub-menus (left: -999em is what hides them) */
#ja-mainnav li:hover ul, #ja-mainnav li li:hover ul, #ja-mainnav li li li:hover ul,
#ja-mainnav li.sfhover ul, #ja-mainnav li.havechildsfhover ul, #ja-mainnav li.havechild-activesfhover ul, #ja-mainnav li.activesfhover ul,
#ja-mainnav li li.sfhover ul, #ja-mainnav li li.havesubchildsfhover ul, #ja-mainnav li li.havesubchild-activesfhover ul, #ja-mainnav li li.activesfhover ul,
#ja-mainnav li li li.sfhover ul, #ja-mainnav li li li.havesubchildsfhover ul, #ja-mainnav li li li.havesubchild-activesfhover ul, #ja-mainnav li li li.activesfhover ul {
	top: auto;
}

/* STYLING THE MENU
-----------------------------------*/
/* 1st level */
#ja-mainnav li a {
	margin: 0;
	padding: 10px 20px;
	border-right: 1px solid #555555;
	border-left: 1px solid #333333;
	display: block;
	color: #CCCCCC;
	font-weight: bold;
	line-height: normal;
	text-decoration: none;
}

#ja-mainnav li a:hover,
#ja-mainnav li a:active,
#ja-mainnav li a:focus {
	background: url(../../images/arrow2.png) no-repeat bottom center #555555;
	color: #FFFFFF;
}

#ja-mainnav li {
	margin: 0;
}

#ja-mainnav li:hover,
#ja-mainnav li.sfhover,
#ja-mainnav li.havechildsfhover,
#ja-mainnav li.havechild-activesfhover {
	background: url(../../images/arrow2.png) no-repeat bottom center #555555;
	color: #FFFFFF;
}

#ja-mainnav li a.active,
#ja-mainnav li a.active:hover,
#ja-mainnav li a.active:active,
#ja-mainnav li a.active:focus {
	background: url(../../images/arrow2.png) no-repeat bottom center #333333;
	color: #FFFFFF;
}

/* 2nd level and above */
#ja-mainnav li ul {
	border: 1px solid #555555;
	background: url(../../images/opaque.png);
}

#ja-mainnav li ul li {
	border-top: 1px solid #777777;
	border-bottom: 1px solid #444444;
	background: none;
}

#ja-mainnav li ul a {
	border-left: none;
	margin: 0;
	padding: 7px 10px;
	background: none;
	color: #CCCCCC;
	font-weight: normal;
	line-height: normal;
	text-transform: none;
}

#ja-mainnav li.havesubchild,
#ja-mainnav li.havesubchild-active {
	background: url(../../images/bullet2.gif) no-repeat 94% 50%;
}

#ja-mainnav li ul a:hover,
#ja-mainnav li ul a:active,
#ja-mainnav li ul a:focus,
#ja-mainnav ul li:hover,
#ja-mainnav ul li.sfhover,
#ja-mainnav ul li.havesubchildsfhover,
#ja-mainnav ul li.havesubchild-activesfhover,
#ja-mainnav ul ul li:hover,
#ja-mainnav ul ul li.sfhover,
#ja-mainnav ul ul li.havesubchildsfhover,
#ja-mainnav ul ul li.havesubchild-activesfhover {
	background: #333333;
	color: #CCCCCC;
}

#ja-mainnav ul li a.active,
#ja-mainnav ul li a.active:hover,
#ja-mainnav ul li a.active:active,
#ja-mainnav ul li a.active:focus {
	background: none !important;
	color: #FFFFFF;
	font-weight: bold;
}
Jw

Re: RTL Missing from JA Purity Hornav Menus

Posted: Sat Nov 14, 2009 1:14 pm
by oc666
I just try your patch but it's not exactly mirror to the ltr template. There is some differences with the width of the menu items.

Re: RTL Missing from JA Purity Hornav Menus

Posted: Tue Nov 17, 2009 6:00 pm
by oc666
See my problem in the next link (include exmples):
http://docs.joomla.org/Talk:Enable_rtl_ ... _ja_purity