jQuery TABS and Mod_ReWrite - Pretty URLS

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
heffegg
Forum Members
Forum Members
Posts: 43
Joined: Sat Mar 08, 2008 2:10 am

jQuery TABS and Mod_ReWrite - Pretty URLS

Post by heffegg »

Sorry if this is the wrong place for this question.
But I need help to get jQuery tabs on a page working when pretty URLs are enabled.

If I run default CMSMS so URL is index.php?page=page_name
With jQuery tabs code

Code: Select all

<div id='tabs'>
<ul>
<a href='#tabs-1'>Link to Tab 1</a>
<a href='#tabs-2'>Link to Tab 2</a>
</ul>
<div id='tabs-1'>
tab 1 content block goes here
</div>
<div id='tabs-1'>
tab 2 content block goes here
</div>
</div>
everything works fine and as expected.

WHEN I enable pretty urls so they appear as domain_name/page.html

The tabs stop appearing as tabs - they are displayed as a list.
AND all tab links return to the home page.
They are converted to: domain_name/#tab-1

See: http://ballinacampers.com.au/index.php? ... -melaleuca this is how the page should look and work after pretty URLs are enabled.

Any help with resolving this would be very much appreciated.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: jQuery TABS and Mod_ReWrite - Pretty URLS - HELP

Post by Dr.CSS »

You need to put your {metadata} tag near/at the top of the template/<head> so your base href has time to kick in before your JS etc. and you need to clean up your code/html, kind of missing a > on the end here...

</head></__body>
<div id="preload"}
<img src="uploads/images/banners/banner_1.jpg"
newagekat
Forum Members
Forum Members
Posts: 161
Joined: Mon Feb 06, 2006 6:06 pm

Re: jQuery TABS and Mod_ReWrite - Pretty URLS - HELP

Post by newagekat »

forgive me for being obtuse. i'm using cmsms v1.9.4.2. i want to add jQuery tabify to a page content. i've done this in older versions without issue, but now it won't tab.

This is what i have:
in template
<head>
{metadata}

below stylesheet call
{literal}
<__script__ src="uploads/js/jquery1-5.js" type="text/javascript"></__script>
<__script__ src="uploads/js/jquery.tabify.js" type="text/javascript"></__script>
<__script__ type="text/javascript">
// <![CDATA[

$(document).ready(function () {
$('#menu').tabify();
});

// ]]>
</__script>

in the page
<ul id="menu" class="menu">
<li class="active"><a href="#individual">individual and sequenced sessions</a></li>
<li><a href="#professional">professional learning programs</a></li>
</ul>

<div id="individual"></div>
<div id="professional"></div>

the url to the site is http://www.tc2.ca/cmsms/index.php?page= ... ortunities

the tabs do show up, but again when you click on the next tab, it still goes to the home page. any suggestions? i will be adding pretty urls when we move the site to root.
Post Reply

Return to “Modules/Add-Ons”