Skip Navigation

[Resolved] Conditionally displaying a sidebar column

This support ticket is created 7 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by nelsonM-2 7 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#515581

I've customized the Layout for Pages, setting a 3 columns left sidebar and a 9 width columns area for content on the right.

The 3 columns on the left contain a View which outputs all pages which are also child of this page's parent page - so it's like a section sub-navigation.

Yet, when there are no pages to list here, those 3 columns are empty.
In that case, I'd like to know if there's a way to make the 9 columns on the right automatically fill the whole 12 available columns, if those 3 on the left are empty.

thanks.

#515665

Dear Nelson,

There isn't such a feature within the Layouts plugin, as a workaround, I suggest you setup a 12 column row, display only one view, in the view, if there is any result, display the 3 columns + 9 width columns area for content
if there is anything found, display a 12 width columns area for content.

See our document:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-no-items-found
Content wrapped with [wpv-no-items-found][/wpv-no-items-found] will be output if there are no posts,

#516956

Hello,

I've solved it creating a 12 cols row for content (on the Layout) which includes a content template, on which I call a custom shortcode to checks if the current page has brother-pages.
Depending on that condition, I'm displaying:
a) 3 columns + 9 width columns
b) a 12 width column

thanks!

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.