patrizia.vergassola Posted August 24, 2018 Share Posted August 24, 2018 Hello, is it possible to make an element appear only in a specific view (list or grid)? Like a conditional if I can insert? Thank you in advance, Patrizia Link to comment Share on other sites More sharing options...
shacker Posted August 26, 2018 Share Posted August 26, 2018 yes, you can add a css, for example if is an image under the #list you can use #list img {display:none} Link to comment Share on other sites More sharing options...
patrizia.vergassola Posted August 27, 2018 Author Share Posted August 27, 2018 Hello, but I need to make a conditional statement inside the .tpl file, do you think is that possible? Thank you in advance, Patrizia Link to comment Share on other sites More sharing options...
Knowband Plugins Posted August 27, 2018 Share Posted August 27, 2018 Call the list & grid view JS functionality manually (Kindly note that changes will be applied after page load). Functions for the same: display('list'); // To dislay in List View display('grid'); // To dislay in Grid View The function definition can be found in themes/default-bootstrap/js/global.js (Check the same according to your theme). Link to comment Share on other sites More sharing options...
Guest Posted August 27, 2018 Share Posted August 27, 2018 You can check the display cookie for list or grid value then work from there. Link to comment Share on other sites More sharing options...
patrizia.vergassola Posted September 7, 2018 Author Share Posted September 7, 2018 I was trying to do it using jquery. Like appending a div if the class is list or remove it if it's grid but it isn't working. Have you tried doing it with Jquery? Do you think the page needs to load? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now