Page Element visible only to logged in Hubspot Admin

A client wants certain page info to only be visible to themselves when logged into Hubspot.

I know that I can use

{% if request.postDict.inpageEditorUI %}

to only show content on the edit page but I’m struggling to think of a way to achieve this on the published page without looking into something like memberships which seems like overkill.


Barry Grennan

Freelance HubSpot CMS Developer

Website | Contact | LinkedIn

I’m not finding anything in the docs for this; the only variables they have are for being directly in the app, not on a page. Only thing I can think is you could use JavaScript to check for the HubSpot toggle on the page and show/hide the content based on that. Having a variable like the preview ones to determine if they’re a user in the account would certainly be the better option though. If no one else knows of one I’d submit this to the Ideas forum.

@alyssamwilie that was the last thing I tried :joy:, detecting by the “hs-tools-menu” class, but no joy, my guess is it’s some event after page load similar to forms.
I’m digging around with Dev Tools now to try to try to event listening(?) but it’s all a bit needle in a haystack.
What I’ll probably end up doing is creating a password protected version of the page. It’s a product catelog made with HubDB, then I can show the admin info on the product pages if it’s the admin url. Not perfect, but it’ll work and it’s not a mad amount of extra work. It may even give them a feeling of security that customers couldn’t access it :grinning_face_with_smiling_eyes:


Barry Grennan

Freelance HubSpot CMS Developer

Website | Contact | LinkedIn