• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

How to create a TOC (table of content) within a repeat group?

mirceat

Member
Hello,

I have a form with a repeat group that can be repeated over 20 times within form. The form is having over 20 elements, so in the end i will end up with a very long form and very hard to use.

I used Sourcerer plugin to create a TOC in form but i can't make it work using anchors or, better says, nothing happen when i click on the links, the page doesn't scroll down at the group. Please note that i don't need to shows the TOC on the fly, it's ok to be updated every time i load the form.

snippet of code using sourcerer used in Group Intro:
PHP:
{source}
<?php
...$myQuery here..
$ancore = $db->loadObjectList();
echo '<ol>';
foreach ($ancore as $ancora) {
echo '<li><a href="#id'.$ancora->id.'">'.$ancora->ab.'</a></li>';
}
echo '</ol>';
?>
{/source}

and in form i have a calc element that gets the record id using calc on load:

Code:
$id = (int)'{contracte_servicii_21_repeat___id_raw}';
//return '<div id="id'.$id.'"></div>'; //tried with id for html5, no changes
return '<a name="id'.$id.'"></a>';

What i'm doing wrong here?

Thank you
 
And what in your TOC?

(and yes, you should better use //return '<div id="id'.$id.'"></div>'; //tried with id for html5, no changes..)
 
Code:
<ol><li><a href="#id15">Abonament Voce Mobila</a></li><li><a href="#id18">Abonament Voce Fixa</a></li></ol>

My understanding of using anchor is when i click on a link, the page should scroll down to that anchor..it doesn't happen here. I'm using the default bootstrap template.
 
It's working on my site (with <div id="subgr1"...)
Maybe idX is not unique?
Try something "unusual" like "tocgroupX"
 
idX is unique, also tried with tocgroupX, same problem, it doesn't scroll to the anchor. Did you test it in a repeat group, so the anchor belongs to the second or third instance of the repeated group?

Update (i cannot post a new reply): @troester, can you confirm: it doesn't work if the calc element is set to hidden, but it works if it's visibile?
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top