Widget displaying if all disabled & tab displaying if no posts found

HomeSupportPopular WidgetWidget displaying if all disabled & tab displaying if no posts found

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #49878
    jrf
    Participant

    Hiya,

    Me again… with yet another suggestion…

    I found that if all tabs are disabled (bit silly, but see the usability suggestion I posted just before, it did happen), the widget heading is still displayed, but no tabs are there, which is a bit confusing.

    Similarly for a new blog where there are for instance no views yet or no comments, the tabs (when enabled) would be displayed, but there would be nothing underneath them. Which may confuse or even frustrate an (end-)user.

    Might it be an idea to use some PHP magic to overcome this ?

    What about something like this:

    * Check if all tabs are disabled: if yes -> return without sending any output.

    * If some or all tabs are enabled:

    create an empty tabs string variable

    create an empty widget content output string variable (or whatever it would be called)

    for each tab:

    * Get the query results, if there are more than 0:

    *   add the tab html to the tabs variable

    *   add the result html to the content output variable

    end with stringing together the html in the right order and echo-ing it out.

    That way empty tabs or an empty widget won’t happen.

    If you’d like me to contribute some code to this end, please let me know as I’ll gladly support your excellent plugin with a code-contribution.

    Hope this helps & keep up the good work!

    Smile,

    Juliette

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.