Support Online : Mon - Fri / 10am - 6pm (GMT +6)

Your Time: Our Time:

Jump to open tab via link

Featured Lock Resolved
Hello,
first of all thanks for your great work!

I use the accordion module to display my FAQs and now i want to link to a certain Question. So if a visitor clicks the (external) link, he should be redirected to the site with the FAQ accordion with the right question already expanded. What i’ve done so far is to add a html anchor to each question using $item->title; as a name so that there is a unique name to link to. Unfortunately i don’t really have a plan how to achieve that the question also get’s expanded when jumped to.


Any help is much appreciated.

9 Answers

Thump

More than a month ago #Permalink
I need to do the exact same thing, any support reply please? :(

Ehsan Riyadh

More than a month ago #Permalink
This is customization and beyond our support. You can do it yourself on accordion module.
Regards.

Steve

More than a month ago #Permalink
Hi Peter

Take a look at this article it may help you achieve what your after
Anchors in Joomla

When you link the anchor to the article use the full url in the browser as the link.
Like so....
http://www.yourdomain.com/index.php/page.html#test

Hope this helps

Regards
Steve

Thump

More than a month ago #Permalink
Just need a little help to get this working please, I managed to give a unique anchor name to every part of the accordion with this:

<div class="toggler">
<span><span><a name="<?php echo $item->title; ?>"><?php echo $item->title; ?></a></span></span>
</div>


So each loads like this:

<div class="toggler">
<span><span><a name="Title01">Title01</a></span></span>
</div>


So far everything is perfect except for one thing: the accordion doesn't open when I use a link.

For example with http://www.website.com/articles#Title02 the page loads and it takes you exactly where "Title02" starts, but all accordions are closed.

My guess is that I need to add/change something over here:

 alwaysHide: true,       
onActive: function(toggler){
toggler.addClass('active');
},
onBackground: function(toggler){
toggler.removeClass('active');
}


ANY help is more than welcome.

Jay Haydon

More than a month ago #Permalink
Hi there,

I was given this task by a client this afternoon and was glad to read the suggestions on this thread above, although ultimately I've taken a different approach, piggybacking on an existing function within the module. The only edit is within the file:

/modules/mod_sp_accordion/tmpl/default.php

Look for the following code:


<?php if ($hidefirst) { ?>
display:-1,
<?php } ?>


And replace it with the following code:


<?php if ($_GET['p'] > 0) { ?>
display: <?php echo ($_GET['p']-1); ?>,
<?php } elseif ($hidefirst) { ?>
display:-1,
<?php } ?>


Then add the URL parameter 'p' to your URL with a positive integer to indicate which of the tabs you would like to have automatically opened, e.g.:

http://www.domain.com/page.html?p=3

This would open the third tab on loading the page. Note that there's a setting in the module itself called 'Hide first item'. If a value is set for 'p', this will override this setting. If 'p' isn't set the setting will work as usual.

This was enough for my client, but it would be easy enough to add in a unique class to each tab span which related to the title of that tab and then use the URL parameter to reference the title of the tab. With a little bit of Javascript you could see if the URL parameter matched any of the titles, and if so, count which span it is and feed that value into the function I've used above.

Hope this helps! :-)

Cheers,
Jay

Haydon Webdesign Munich
http://www.haydon.eu

Thump

More than a month ago #Permalink
I love you Jay Haydon! haha

I used your mod + this type of links:

http://www.website.com/page.html?p=7#Anchor Name

So the browser goes right where "Anchor Name" starts with the tab number 7 opened, simply perfect ;) .

A HUUUGE THANK YOU FOR YOUR POST!

xdcc

More than a month ago #Permalink
Jay Haydon wrote:

Hi there,

I was given this task by a client this afternoon and was glad to read the suggestions on this thread above, although ultimately I've taken a different approach, piggybacking on an existing function within the module. The only edit is within the file:

/modules/mod_sp_accordion/tmpl/default.php

Look for the following code:


<?php if ($hidefirst) { ?>
display:-1,
<?php } ?>


And replace it with the following code:


<?php if ($_GET['p'] > 0) { ?>
display: <?php echo ($_GET['p']-1); ?>,
<?php } elseif ($hidefirst) { ?>
display:-1,
<?php } ?>


Then add the URL parameter 'p' to your URL with a positive integer to indicate which of the tabs you would like to have automatically opened, e.g.:

http://www.domain.com/page.html?p=3

This would open the third tab on loading the page. Note that there's a setting in the module itself called 'Hide first item'. If a value is set for 'p', this will override this setting. If 'p' isn't set the setting will work as usual.

This was enough for my client, but it would be easy enough to add in a unique class to each tab span which related to the title of that tab and then use the URL parameter to reference the title of the tab. With a little bit of Javascript you could see if the URL parameter matched any of the titles, and if so, count which span it is and feed that value into the function I've used above.

Hope this helps! :-)

Cheers,
Jay

Haydon Webdesign Munich
http://www.haydon.eu


Sorry to push up such an old thread, but I need exactly the same thing. The approach does not work anymore though, because Accordion is now an SP page builder addon and not a stand alone module anymore.

Is there anyway I can achieve this effect with the new addon?

Thanks!

Kind regards
Peter

uschmi

More than a month ago #Permalink
Hello,
i would also like to link from page 1 to an special accodion tab on page 2.
After reading several pages and forums i still have no solution.

I also can not find the file/path "/modules/mod_sp_accordion/tmpl/default.php" in my joomla.
(Latest version of Joomla and Pagebuilder, using at_business template)

Can you give me a hint or maybe some easy solution?

Thanks a lot!
Marcel

Bölker/Bölker GbR

More than a month ago #Permalink
Hey there, since the tab plugin is included in the page builder, where can I find the code mentioned above?
I tried to add to custom code, but this won't work.
But it seems to be a good solution, for the open problem


There are no replies made for this post yet.
Be one of the first to reply to this post!

Leaderboard (30 days)

Paul Frankowski

Paul Frankowski

Total Accepted Answers: 133
Toufiq

Toufiq

Total Accepted Answers: 105
Sifat

Sifat

Total Accepted Answers: 59
Jan

Jan

Total Accepted Answers: 1
RV

RAFFAELE VIOLA

Total Accepted Answers: 1

116

Templates

300084

Community Users

Newsletter

Don’t miss any updates of our new templates and extensions and all the astonishing offers we bring for you.
We never spam

Joomla! ® name is used under a limited license from Open Source Matters in the United States and other countries. JoomShaper.com is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.

Connect Us