Grid layout
-
Hi,
this plugin is great, love it.
Do you think it is possible to show messages in a grid or masonry layout ?
Could be a great option for a modern design.Best regards
Olivier
-
Found a way with masonry jquery script http://masonry.desandro.com,
working great, but could be a little optimized i think.Would be a great feature for next update, don’t you think ?
Will post a link when the website i’m working on will be online.
Have a look…
https://drive.google.com/file/d/0B-5jHL8cyLspdDI2S2k0NGh3Z00/view?usp=sharing-
This reply was modified 9 years, 1 month ago by
alfazzz.
Hi, I am not planning to add this feature inside the plugin itself. I want to keep the CSS as simple as possible, so people can integrate it the way they want.
Did you need anything for this? I can imagine you wanted to add the class ‘grid’ to div#gwolle_gb_entries.
Hi, ok no problem.
I have already implanted the masonry grid system into your plugin. I just need to be carefull with updates…i don’t know how to override a plugin.What exactly did you change?
Because there are ways to make those changes stay on updates, but I don’t know if that is currently possible.I modified 2 files to put the masonry css class :
gb-read.php line 97
$output .= '<div id="gwolle_gb_entries" class="' . $infinite . ' grid" data-book_id="' . $shortcode_atts['book_id'] . '">';gwolle_gb-entry.php line 35
$entry_output = '<div class="gb-entry grid-item';anything else 🙂
OK, looks good.
I added 2 filters to current trunk. Could you test if it works for you? You can download the zipfile for the Development Version here:
https://wordpress.org/plugins/gwolle-gb/developers/Then you can use this code to use the filters (add it to functions.php of your theme):
function my_gwolle_gb_entries_list_class( $classes ) { // $classes is a string $classes .= ' grid'; // Add to it or use str_replace. Mind the space. return $classes; } add_filter( 'gwolle_gb_entries_list_class', 'my_gwolle_gb_entries_list_class', 10, 1 ); function my_gwolle_gb_entry_class( $classes ) { // $classes is a string $classes .= ' grid-item'; // Add to it or use str_replace. Mind the space. return $classes; } add_filter( 'gwolle_gb_entry_class', 'my_gwolle_gb_entry_class', 10, 1 );This way upgrading should be fine for you in the future.
-
This reply was modified 9 years ago by
Marcel Pol.
Ok, thank you for the support.
Unfortunately, can’t get it to work, class are not added. I think i’m not doing it right…I downloaded and uploaded the current version 2.1.5 on the link you provided, added your script to function.php file in my child theme folder, but nothing.
Is this the right procedure ?
Thank’s
Oh, you need the Development Version. It is listed on that page I linked. You can download the zipfile for that. It is the same as 2.1.5, but with these filters added.
ok my mistake…downloaded the wrong file, sorry.
Working fine now, that’s great thank you.Last question, does this means i will need to only download the development version for future release ? or these filters will be integrated in the next official update ?
This development version will become 2.1.6, so these changes will stay on every update.
The whole point of hooks and filters is that you can customize things like this. It is the way most plugins and themes can be customized. The maintainer must provide these hooks ofcourse, but it does now provide these two hooks from now on.Ok nice !
Thank you for your help and support.
And bravo for this plugin, simple, nice and complete…Best regards
OlivierHi,
Another question about the widget guestbook. Is there a way to show random entries in diaporama mode ?Diaporama is a layout in masonry?
That would mean adding the same type of filters to the widget. I will add it to the todo list.If that is indeed what you meant, could you test with the current Development version?
This code works for me:
function my_gwolle_gb_widget_list_class( $classes ) { // $classes is a string $classes .= ' grid'; // Add to it or use str_replace. Mind the space. return $classes; } add_filter( 'gwolle_gb_widget_list_class', 'my_gwolle_gb_widget_list_class', 10, 1 ); function my_gwolle_gb_widget_item_class( $classes ) { // $classes is a string $classes .= ' grid-item'; // Add to it or use str_replace. Mind the space. return $classes; } add_filter( 'gwolle_gb_widget_item_class', 'my_gwolle_gb_widget_item_class', 10, 1 ); -
This reply was modified 9 years, 1 month ago by
The topic ‘Grid layout’ is closed to new replies.