Bring Your Business to Life › Support › Popular Widget › Widget displaying if all disabled & tab displaying if no posts found
- AuthorPosts
- September 16, 2012 at 5:49 pm #49878jrfParticipant
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
- AuthorPosts
- You must be logged in to reply to this topic.