Oncord Community Logo
    • Recent
    • Popular
    • Register
    • Login

    Under construction settings/code

    Advanced Coding
    2
    3
    1147
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • BenB
      Ben
      last edited by

      Wondering what the best way is to create single page 'under construction' home page, while being able to freely edit and design the rest of the website—including headers and footers. I tried the PHP redirect from the Oncord Developers page, but it kept throwing a redirect error and would load the page (when not logged in as an admin).

      Ben Johnston
      Evocative | Brand Design
      evocative.cc

      StephenBlignaultS 1 Reply Last reply Reply Quote 0
      • StephenBlignaultS
        StephenBlignault @Ben
        last edited by

        @Ben Hi Ben, we have achieved this same functionality using the following method.

        Step 1) Create a new temporary Design
        Create a design and called it Coming Soon or something similar, and attached this design to your single coming soon / under construction page. (On your page, click on Settings icon and then choose your coming soon template under the Design field.

        Step 2) Lock down your current Design (using PHP method)
        Then your current website design, the default Design template for the rest of your website, click the Source icon and then the PHP tab and add the following code:

        <?php
        
        // disable the website until we are ready to launch website.
        // only homepage 'coming soon' page is available for non admins.
        if (!\Components\Settings\Administrators::currentIsAdministrator())
        {
        	\Framework\HTTP\Redirection::redirect('/');
        }
        
        ?>
        

        This will redirect all non-logged in Administrators to the homepage, which should be your Under Construction page.

        Note, if your Under Construction / Coming soon page is is not the homepage, '/', then replace the code from '/' to your page name, such as '/coming-soon/' or similar.

        Hope this helps

        Stephen Blignault
        Senior Web Developer
        Fueldesign Ltd

        BenB 1 Reply Last reply Reply Quote 0
        • BenB
          Ben @StephenBlignault
          last edited by

          @StephenBlignault Thank you for your detailed response; that certainly looks like the type of solution I was after. Hadn't thought of using two design templates, but that makes perfect sense. Appreciate the insight and code!

          Ben Johnston
          Evocative | Brand Design
          evocative.cc

          1 Reply Last reply Reply Quote 0
          • alex_cumberlandA alex_cumberland moved this topic from Oncord Discussion on
          • First post
            Last post
          Features
          • Website
          • Customer Database
          • Digital Marketing
          • Sell Online
          • Integrations
          Help & Resources
          • Contact Support
          • Learning Centre
          • Latest News
          • Developer Resources
          Oncord
          • Contact Us
          • Client Stories
          • Partner Program
          • Agency Login
          Legal
          • Software: EULA
          • Support & Professional Services
          • Reseller Agreement

          © 2023 Oncord. All Rights Reserved.