mgsisk / webcomic

Comic publishing power for the web. Turn your WordPress-powered site into a comic publishing platform with Webcomic.
http://wordpress.org/plugins/webcomic
GNU General Public License v2.0
110 stars 29 forks source link

webcomic_dropdown_collections not working as intended #185

Closed Mihari closed 10 years ago

Mihari commented 10 years ago

webcomic_dropdown_collections when called in atleast in raw templates in either raw code or when using do_shortcode function do not result in any output. Infact the only way to get any output is using the webcomics argument, however when used the list appear however it will not process any other arguments regardless if they are listed in the array or not.

A even more baffling note is when this example used:

<?php webcomic_dropdown_collections( array( 'hide_empty' => false, 'target' => 'first', 'webcomics' => true, 'show_option_all' => '- Archive -' ) ); ?>

The dropdown will render, listing all webcomics, but target is ignored, obviously hide_empty is ignored because webcomics is used. The show_option_all does generate correctly no matter what.

But getting back to the baffling part, when it does render single comic pages will lose their postbit, and will be replaced with the last item in the dropdowns post bit.

mgsisk commented 10 years ago

Thanks Mihari; it looks like there is a minor error in that function that's messing up output in certain situations; I'll push a fix to the plugin directory later tonight (or you can grab it from here in a bit).

For the example you posted Webcomic is actually working correctly (I may need to update the Wiki page to clarify this). When you set webcomics => true, the generated dropdown becomes a drop down of webcomic posts grouped by collection, so each option in the dropdown goes directly to the webcomic. There's no way to actually select a Collection when webcomics => true is set, so the target setting is ignored.

Can you post some other examples you've tried? I'm not sure the bug I found accounts for all of the issues you're describing…

Mihari commented 10 years ago
<?php webcomic_dropdown_collections( array( 'class' => 'archive-dropdown', 'hide_empty' => 'true', 'show_option_all' => '- Archive -' ) ); ?><!-- archive-dropdown -->

Yields what is currently on: http://laslindas.katbox.net

I'm willing to actively try any combination you wish to help diagnose it.

mgsisk commented 10 years ago

I just pushed the fix for this function to GitHub; can you update Webcomic using the version on GitHub (4.1.0.4) and see how that works?

Mihari commented 10 years ago

The listing works now, however, the issue with it pulling the postbit from the last item listed in the dropmenu is still present as shown here:

http://laslindas.katbox.net/comic/pursuit-of-happiness/

(Note: You can see the correct postbit for that comic on the homepage.)