making webpart visible/hidden based on content within

Shawn Ebeyer asked on October 3, 2016 18:38

Hi all,

I'm wondering if anyone could point me in the right direction...

I need to hide a webpart if there is no content inside, and show it otherwise. I've seen macro's that do this but am struggling with the syntax.

I don't want to use JS for this, and want to keep it all within the part itself.

Any help would be amazing!

Thanks,

Shawn

Recent Answers


Jan Hermann answered on October 3, 2016 18:39

It's definitely possible. What web part we are talking about?

1 votesVote for this answer Mark as a Correct answer

Shawn Ebeyer answered on October 3, 2016 19:03

Hi Jan,

It'll be a repeater...

Thanks,

Shawn

0 votesVote for this answer Mark as a Correct answer

Anton Grekhovodov answered on October 3, 2016 19:11

Hi Shawn,

Repeater webpart has property 'Hide if no record found', try to tick it.

4 votesVote for this answer Mark as a Correct answer

Laura Frese answered on October 3, 2016 20:26 (last edited on October 3, 2016 20:27)

Just in case anybody comes across this post & wanted to hide an editable text web part if it was empty

{% (ViewMode != "LiveSite") || (CMSContext.CurrentDocument.editabletext != "") #%}

Where editabletext would be what you have for yor web part control ID

Click the black arrow next to the Visible box in the web part, the macro dialog will open, add the macro there.

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.