Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

JS Tabs

  • #10271
    Avatar photo[anonymous]

    I want to add tabbed content to my pages.

    I asked GPT to write the html, css, and js needed.

    I added the CSS in publii cms.
    I added the html direct in the page.
    I added the JS to the scripts.js file of my theme.

    But its not working 🙁

    Any ideas?

    #10272
    Avatar photoBob

    any URL?

    #10274
    Avatar photo[anonymous]

    https://mintletterpress.com/tabs-test.html

    See attached images for the html, css, and js I added.

    #10279
    Avatar photoBob

    I couldn’t find the JavaScript tab code in your source code. Where did you paste it?

    #10280
    Avatar photo[anonymous]

    Sorry, I pasted it at the bottom of the scripts.js file in the splitian theme assets… is that the right place for it?

    #10281
    Avatar photo[anonymous]

    Oh wait now I think I figured it out. Publii makes a duplicate of each theme when you add it to one of your sites. I was pasting it on the general themes folder assets. Let me try again now.

    #10282
    Avatar photoBob

    Just to make one thing clear: the script.js file is the non-minified version of the scripts. The template loads the script.min.js file, so after adding your script to the script.js file, be sure to minify the code and place it in the script.min.js file.