• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

How I created my external pages.

Hey Lu.
Yes, I´ve checked it a few moments ago.
There are all files in this structure.
I don´t understand where the problem is,
but we take a lot of energy to fix it wihtout sucess.
There is no developer of the addon in this thread actually I think...

Faithfully
 
Hey Lu.
No, I didn´t change anything in it.
Here´s my file:

Code:
<?php

class ExternalPages_Route_Prefix_En implements XenForo_Route_Interface
{
    public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
    {
        $urlComponents = explode('/', $routePath);
        $subPrefix = strtolower(array_shift($urlComponents));

        switch($subPrefix)
        {
            case 'advertise':
                $controllerName = 'ExternalPages_ControllerPublic_Advertise';
                $routeName = 'en/advertise/';
                break;
            case 'draft':
                $controllerName = 'ExternalPages_ControllerPublic_Draft';
                $routeName = 'en/draft/';
                break;
            case 'privacy':
                $controllerName = 'ExternalPages_ControllerPublic_Privacy';
                $routeName = 'en/privacy/';
                break;
            case 'schedule':
                $controllerName = 'ExternalPages_ControllerPublic_Schedule';
                $routeName = 'en/schedule/';
                break;
            case 'tickets':
                $controllerName = 'ExternalPages_ControllerPublic_Tickets';
                $routeName = 'en/tickets/';
                break;
            case 'tos':
                $controllerName = 'ExternalPages_ControllerPublic_TOS';
                $routeName = 'en/tos/';
                break;
            default:
                $controllerName = 'ExternalPages_ControllerPublic_Tickets';
                $routeName = 'en/tickets/';
                break;
        }

        return $router->getRouteMatch($controllerName, 'index', $routeName, $routePath);
    }
}

Faithfully
 
This file is fine, maybe you can change it with a dynamic controllername is better if you don't want to add a new case every new pages.

Btw, did you activate SEF? Try to enable it
 
you don't need an external page to callback php in a custom page node because you can call it from the node's option.
 
I want to utilize custom page nodes to do the same thing as my external pages, basically getting away from external pages.
 
I know this is an amateur question, however when trying to implement the add-on, I do not even see a development section in the ACP. I'm guessing it was under Development in the prior version of XF?? And then when I go to Home > Install Add-on, I need a XML file to upload, not the directories in post #1 in this thread. Any help would greatly be appreciated :)
 
I could not find any documentation about enabling debug mode in the ACP or the help manual. I'll try to keep searching.
 
I have implemented this add-on and got it working, made my new home tab, got it positioned in the home position (not the middle), however after reading through the thread multiple times, as well as numerous other threads, I still cannot understand two things.

One I never found a clear concise way to remove the route prefix, and after creating my EP_Home template, it is still not showing up on the site? I do have Home.php under ControllerPublic and inside there I have replaced every instance of Tickets with Home, including where I call the EP_Home template.

Any suggestions or help would greatly be appreciated :)
 
update: When I created the EP_Home template in the ACP I pasted in the template content info yet it would not show up on the home page. I exported the style to search through the XML doc and the template was not there. So I copied another template, replaced the content, changed the template addon_id to External_Pages (I added an underscore to my add on ID in the ACP) and then imported that style. It works this way, but I do not think that is the right way? Any insight?
 
Hey Lu.
No, I didn´t change anything in it.
Here´s my file:

Code:
<?php
 
class ExternalPages_Route_Prefix_En implements XenForo_Route_Interface
{
    public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
    {
        $urlComponents = explode('/', $routePath);
        $subPrefix = strtolower(array_shift($urlComponents));
 
        switch($subPrefix)
        {
            case 'advertise':
                $controllerName = 'ExternalPages_ControllerPublic_Advertise';
                $routeName = 'en/advertise/';
                break;
            case 'draft':
                $controllerName = 'ExternalPages_ControllerPublic_Draft';
                $routeName = 'en/draft/';
                break;
            case 'privacy':
                $controllerName = 'ExternalPages_ControllerPublic_Privacy';
                $routeName = 'en/privacy/';
                break;
            case 'schedule':
                $controllerName = 'ExternalPages_ControllerPublic_Schedule';
                $routeName = 'en/schedule/';
                break;
            case 'tickets':
                $controllerName = 'ExternalPages_ControllerPublic_Tickets';
                $routeName = 'en/tickets/';
                break;
            case 'tos':
                $controllerName = 'ExternalPages_ControllerPublic_TOS';
                $routeName = 'en/tos/';
                break;
            default:
                $controllerName = 'ExternalPages_ControllerPublic_Tickets';
                $routeName = 'en/tickets/';
                break;
        }
 
        return $router->getRouteMatch($controllerName, 'index', $routeName, $routePath);
    }
}

Faithfully

Check out post#55 .. you will be glad that you did.
 
Top Bottom