Home › Forums › Add-ons › Repeater Field › Give URLs to Sub-fields (inside accordion)
Hi there, I am the webmaster for website http://www.universitaeuropeadiroma.it/ where ACF was used to create custom “Accordion” fields. Now, the former developer gave every accordion an anchor URL /#_name. Is there a way to do the same for sub-accordions? Developer wasn’t able to answer this
Thanks a lot
That would depend on how the dev built the accordion in the first place and the code used to display it in the templates. In any case it will probably require altering the admin and/or the template files, but anything is possible.
Thanks for your answer! I’ll try to give a better explanation.
The accordion is built using a repeater field for posts and shown through a shortcode that displays posts from a specific category (e.g. [accordion_post cat=”category_name”])
Accordion fields also contains a field “Accordion content” which is a repeater for sub-accordions.
Basically every page in the website only contains a shortcode that shows the accordion. Every article can be shown as a single using its permalink, and as an accordion tab typing #tab_ before the last part of the permalink itself.
For an example, the post “Struttura” in category “Ateneo” can be shown as a single post typing https://www.universitaeuropeadiroma.it/struttura/ and as a collapsed accordion if you type https://www.universitaeuropeadiroma.it/ateneo/#tab_struttura.
Now, inside every post there is a field called “accordion content” which allows the author to create an accordion inside the post. In this case, accordion has no permalink, and cannot be found, shared or seen inside the post (well, it can be only seen by opening the post as a collapsed accordion)
Here’s the example: If I try to open the post “Biblioteca” in category ateneo, which contains nothing but 3 accordions” typing https://www.universitaeuropeadiroma.it/ateneo/biblioteca I will see just an empty page.
This gave me issues with social sharing plugins and SEO (Google indexes pages which seem to be empty)
I hope this helps you to understand better
Thanks a lot!
It would all depend on the shortcode and how it was built [accordion_post cat="category_name"]
is likely a custom built shortcode since I cannot find any information about it. The php code for the shortcode would need to be altered.
The topic ‘Give URLs to Sub-fields (inside accordion)’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.