Static page conditional

26 views
Skip to first unread message

stef.emi...@maxcommunications.co.uk

unread,
Feb 23, 2022, 6:33:27 AM2/23/22
to AtoM Users
Hi,
I'm looking for a way to hide the login button except for on a designated static page. Can you tell me what php code I should use to specify this condition? e.g. something like:

        <?php
          if( // is static page name 'login' or similar ) {
             echo get_component('menu', 'userMenu');
          }
        ?>

Thanks
Stef

stef.emi...@maxcommunications.co.uk

unread,
Feb 23, 2022, 6:45:47 AM2/23/22
to AtoM Users
Forget this - I'm being stupidly thick. Was looking for an AtoM solution when I should have been looking for a php solution:

        <?php
          $actualPage = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
          if($actualPage == "http://url-of-page") {
            echo get_component('menu', 'userMenu');
          }
        ?>

Dan Gillean

unread,
Feb 23, 2022, 4:17:45 PM2/23/22
to ICA-AtoM Users
Hi Stef, 

Just to clarify your second post, did you already solve your own question? Or are you still looking for further input?

Hope you figured out what you were looking for!

Cheers, 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory
he / him


--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/f53700c7-228c-47ea-92bc-2aeee927288dn%40googlegroups.com.

Stef Emiljanowicz

unread,
Feb 23, 2022, 5:30:52 PM2/23/22
to ica-ato...@googlegroups.com
Hi Dan - apologies, I sorted it out myself. Just had a brain freeze when I wrote the initial one :-)
Thanks
Stef



--

Stef Emiljanowicz

Web Development Manager

Tel. 0208 309 5445

 

Max Communications Ltd.

2-3, Gunnery Terrace

Cornwallis Road

London SE18 6SW


www.maxcommunications.co.uk

www.royalwarrant.org/company/max-communications-ltd


 



Please note, this email together with any attachments must be treated as confidential. If you are not the intended recipient, please contact the sender immediately and delete the original email. Any use, copying, disclosure, alteration or reliance on the contents of this email for purposes without the named sender’s express authorisation is strictly prohibited



Reply all
Reply to author
Forward
0 new messages