Hi @_4N, you can achieve something similar with a navigation button and set it to go to whatever the previous page is. Have you tried using the Navigate to action?
Yea but this does not work for records because you can get there from different locations.
Breadcrumps are not an option because they display a link to the underlaying database which only lead to confusion in the past so we abandoned them all together for the user group in question.
Buttons on top of the page make for really nice navigational elements, especially for the mobile view. But not being able to have a dynamic “back” button cripples this approach too
Shoudn’t it be fairly easy to just allow a “dynamically go to previous page” option for the “navigate to…” action?
It would make a huge difference for building a better user experience.
I finally came around trying this today and it seems to work.
Admittedly I used chat GPT to write the script so I quickly wanted to post it here and ask if an actual developer sees any issues with it.
<script>
function attachClickHandler() {
// List of button classes or IDs you want to target
const buttonSelectors = [
'.action-button-z7eyhHFdB', // First button selector
'.action-button-C-hkxyARw' // Second button selector (your new button)
];
buttonSelectors.forEach(selector => {
const button = document.querySelector(selector);
if (button && !button.hasAttribute("data-click-handler")) {
button.setAttribute("data-click-handler", "true"); // Prevents duplicate handlers
button.onclick = function() {
console.log("Button clicked!");
window.history.back();
};
}
});
}
// Run every second to ensure the buttons keep working
setInterval(attachClickHandler, 1000);
</script>
It woudn’t work at first, after some troubleshooting it seemed that noloco was dynamically changing things in the background which caused the script to not function.
I am a bit worried the skript will cause performance issues, if that would be the case, a headsup would be appreciated.