I am building a jobs posting app and I want to create an “Apply for this job” button in my list view that takes users to an external site (the job applications that are not hosted in Knack, but on Indeed, LinkedIn, etc.). I want the button to be tied to the record field that will have the link information.
Job application links can be rather long, so I want to hide the long links behind an “Apply for this job” button. I already have the CSS code for the look of the button. What I need is the CSS code to properly link the information from field to page view.
I know this will need custom CSS and I am having trouble finding a solution in the forms. Any developer help is appreciated. I am clearly not one.
// Change view_8308 to your view the link is on
$(document).on("knack-view-render.view_8308", function (_, { key: viewId }) {
const viewElement = $(`#${viewId}`);
// Change the field_5395 the the fieldId of your linkfield
viewElement.find('.field_5395 a').addClass('kn-button is-secondary').text('Apply for this Job');
});
You need to then add this to the css pane in the builder: