=== JS Archive List === Contributors: skatox Donate link: http://skatox.com/blog/jquery-archive-list-widget/ Tags: javascript, archive, list, gutenberg, block Requires at least: 4.7 Tested up to: 6.5.3 Stable Tag: 6.1.4 A JS widget (can be used in posts) for displaying an archive list with some effects. == Description == This plugin provides a widget and a filter to display a collapsible archive list in your sidebar or posts using the JS JS library. = Features = 1. Support for Gutenberg blocks. Add it to any FSE theme or Gutenberg compatible theme. 1. Display a collapsed list of your archives to reduce space. 1. Uses vanilla JS to add effects and to be compatible with all browsers. 1. Select your expand/collapse symbol and date format. 1. Support for archive filters. 1. Auto expands current/select year from posts. 1. Select the categories to exclude 1. Multiple instances support. 1. Shortcode support *[JsArchiveList]* 1. Generates valid HTML code. 1. Supports multiple languages. 1. Compatible with most JS cache and minify plugins. 1. And more to come... == Installation == 1. Make a directory js-archive-list-widget under */wp-content/plugins/* 1. Upload all downloaded files to */wp-content/plugins/js-archive-list-widget/* 1. Activate plugin at the plugins section. 1. Go to *Presentation -> Widgets* and drag the JS Archive List to your sidebar and configure it, if you want to display it inside a post then write *[JSArchiveList]* at the location where it will be shown and save it. == Configuration == * Title: title of the widget. * Trigger Symbol: characters to be displayed as bullet. * Effect: Effect to use. * Month Format: month's display format of the month. * Expand: when to expand the content of the list. * Hide years from before: older years will be hidden under a link. To save space in the page on old sites. * Show days inside month list: group posts by day. * Show number of posts: display how many post are published in the year or in the month. * Show only posts from selected category: show only posts from the selected category when visiting a category page. * Only expand/reduce by clicking the symbol: select if animations start when click the link or just the bullet. * Only expand one at the same time: select if you want to have only one expanded at the same time. * Show posts under months: show post's title under months. * Show post date next to post title: show post's date next to post title. * Sort posts by: select how to sort the posts under months. * Include or Exclude categories: Select the categories to include or exclude. == Frequently Asked Questions == = Why there are 2 widgets? = Since version 6.0 the widget was migrated to a Gutenberg block. So there will be a Gutenberg block with the most modern code and compatibility and a legacy version that is 100% made in PHP to keep compatibility with older installations. = Why this plugin is not working? = By support experience, like 99% of problems are due to: * There's a Javascript error caused by other plugin, and it stops any further code execution, check your browser's logs to find the problem and deactivate the conflict plugin. * Your template doesn't have a wp_footer() function, this plugin requires this function to load JS code at the end of the website to improve speed. = I'm using custom permalinks, How can I change the links? = Currently, there's no function in WP API for getting link for date archives when using custom permalinks. So, you'll need to modify/hack the source code to support your custom link structure, you can do this by changing the lines where I call **get_month_link** and **get_year_link**. = How can I exclude some categories from navigation? = This plugin only shows the posts from included/excluded categories. It does not remove them from the navigation. If you want to do it you have to install a 3rd party plugin like *Ultimate Category Excluder* or *Simple Exclude Categories* = How I can send you a translation? = Send me the translated .mo file to migueluseche(a)skatox.com and indicate the language, I can read english or spanish, so please write me on these languages. = Can I use images as bullets or trigger symbols? = Yes, select 'Empty Space' as trigger symbol and Save, then you can add any custom background using CSS, just play with the widget's classes: .jaw_symbol, .jaw_year, .jaw_month. = Can I show this list inside posts? = Yes, just add the *JS Archive List* block or add a shortcode block and write *[JsArchiveList]* anywhere inside a post or page's contest and it will be replaced for the archive list when rendering the content. You can add the following parameters to change its behavior: 1. **showcount** ( boolean ): select if you want to show the count post inside that month/year. 1. **showpost** ( boolean ): show post's titles under months. 1. **expand** ("none", "never", "expand"): never expand by default, current year only and always expand. 1. **month_format** ("short", "full", "number"): the format of the date. 1. **ex_sym**: the expansion symbol. 1. **con_sym**: the collapse symbol. 1. **only_sym_link**: only expand/collapse when clicking the bullet. 1. **effect** ("", "slide", "fade"): the JS effect to implement. 1. **exclude**: IDs (comma separated) of the categories to exclude. 1. **type**: ID of the type of the posts to show, this is if you're using custom type posts. By default will show posts. So for example: *[JsArchiveList month_format=number showpost=1 showcount=1 ex_sym=+ con_sym=- effect=slide type=page]* Will show a widget with months as numbers, show posts under months and their count, the symbols are + and - and the effect is fadeIn. You can check source code for more information. = How I contribute to this plugin? = By using it, recommending it to other users, giving it 5 starts at plugin's WordPress page, suggesting features or coding new features and finally by **DONATING** using plugin's website's donate link. = How can I add multiples instances? = Since 2.0 you can add as many instances as you want, but there's another way to do it, just add a new Text widget only with the shortcode [JSArchiveList] then it will have a new copy of the widget. = Can I have different instances with different configuration? = Since 2.0 it's possible. Each instance has its own configuration. Shortcode widgets are controlled by shortcode attributes. == Screenshots == 1. A list of the archives, archives for each month are hidden under years. 2. A list of archives and its month archives expanded. 3. Block options to configure the list. == Changelog == = 6.1.4 = * Solving a bug when expand was selected to all and no symbol was set. = 6.1.3 = * Legacy widget: solving settings save bug when changing checkboxes. * Legacy widget: solving settings load when using the widget mode. * Legacy widget: rewriting clicking event function to avoid bugs and issues with certain settings. = 6.1.2 = * Solved scrolling bug when clickin day's link. = 6.1.1 = * Solved post's list bug when using the shortcode. * Solved title bug of showing 1 when using the shortcode. * Updated translations for spanish and portuguese. = 6.1.0 = * Added option to sort month's posts by id, date or title. * Added option to add post's date to the month's post list. * New option to display posts grouped by day. * New option to hide older years in a toggle (good for old sites). * Improved frontend code to make it more efficient and slightly faster. * Fixed bug of changing the symbol when data was not loaded. * Legacy version: added `jawl_widget_title` hook to allow changing the widget's title (helpful for translations). = 6.0.5 = * Improved Gutenberg block to be more efficient and faster. * Changed block's animation from CSS to JS to increase compatibility. * Changed legacy widget's animation from CSS to JS to increase compatibility. * Fixed shortcode name and updated documentation to reflect the change. * Fixing shortcode parameters and values to make it work ok. * Adding support for accordion option for the Gutenberg block. = 6.0.1 = * Code migrated to Gutenberg block. Now you can use this plugin as a Gutenberg block on any modern theme. * The block version reads the archive dynamically. It saves bandwidth and reduces old DOM size on old sites. * JS code is only loaded if there's a widget or block is added to page. No more always loading JS and CSS code. * Updated CSS code to improve animations on all browsers. * Depecrated old php version. It will only be on maintenance mode and new Gutenberg block will be supported. * Improved automated tests and code, to make future versions easier to develop. = 5.1 = * Fixed 'missing array key accordion' bug. = 5.0 = * Removed jQuery dependency and rewrote the plugin in full vanilla Javascript. * Added compatibility with Gutenberg's block. * Added option to include categories. You can now just select the categories to include. * Renamed plugin name, shortcode now it's [JSArchiveList] but old one is kept for backwards compatibility. * Improved caret down symbol when selected. * Fixed wrong HTML at settings page (thanks to Cosam_jp for the report). * Fixed bad use of selected function at settings page (thanks to Cosam_jp for the report). * Solved expansion bug when current post belong to an excluded category. * Solved an expansion/collapse problem when activating this option and excluding or including categories. * Solved bug when post titles were empty. = 4.0.1 = * Better JS file caching: enqueue URL now uses plugin version number when included (instead of WordPress version). * Solving CSS typo error introduced in 4.0.0 * Fixing Data Source instance bug (thanks to imlwebadmin for the fix) * Solving incompatibility with Recent Post Widget( thanks to Ramanan for the fix). = 4.0.0 = * Title is translated on showing, so the widget title is updated in real-time when a user switches languages on the site. (thanks to @udi86) * Added 'widget_archive' class to the widget. Many people requested this. * Added Ukrainian and Russian translation (thanks to Alex Popov). * Added support for 'Remove Widget Titles' plugin. * Added option to work as an accordion. * Changing collapse icon to – so it has the same width as the + sign. * Fixed closing wrong