• 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.

I guess you'll have conflicts problem with xenforo's core page

*EDIT*

Maybe is possible to change the url by .htaccess, what do you think about that?
 
Minor suggestion for the first post. I believe the Add-on ID should be ExternalPages without a space between words.

I like the idea of having pages which are not tied to the Forum tab. Is there a way to not have /en/ or any prefix at all? If I create a page called Schedule I just want the URL to be mysite.com/schedule.
Create an own Router for this.
You just need to change the Route Prefix from the instruction in the 1. post
  1. Create a route at the following URL:
    /admin.php?route-prefixes/
    Route Prefix: en
    Route Type: Public
    Route Class: ExternalPages_Route_Prefix_En
    Use Class to Build Link: Always
    Add-On: External Pages
Then you'll able to have something like http://ragtek.org/xenforo/info/impressum / http://ragtek.org/xenforo/info/privacy
 
Thank you both Ragtek and Vodkaholic. I didn't reply sooner because it took me quite some time to read those articles :) While I don't understand everything, especially the first one, I learned a lot.

I am still left with my original question though. If I wanted to change the path from /en to anything else, I can do that. What I don't know is...when creating a Route, what do I enter if I want to use my default XF install path with nothing added to it. For example:

My xf is installed at my root directory. www.TeraPVP.com is my XenPorta home page. www.TeraPVP.com/forums is my XF forums. When I create a new page I want the path to be www.TeraPVP.com/newpage. I don't want any other folder used. How do I adjust the guide offered in the first post to make that happen?
 
Do you want a blank white page? Is that what you're trying to accomplish here?
I would like to add various pages to my XF site. The content on the pages will vary of course. They will contain HTML, JS, and include xen templates such as side bar blocks. It is my understanding that is what this add-on can do.

If I use XF system to add pages, then all the pages appear under /forum which I do not want.

If I use this add-on as it is offered, all pages appear one level deeper in navigation which is also undesired.
 
Creating a "prefix"/route for each page will do what you want. I'll explain more in detail later when I have time to relook at the route file and the addon info in the control panel.
 
Sorry I still haven't had time to relook at the files. But I have an additional question, what do you mean by one level deeper?
 
@oracle: There are already some great tutorials about own routes & controllers
 
Sorry I still haven't had time to relook at the files. But I have an additional question, what do you mean by one level deeper?
I desire the pages to be located in the URL immediately after the root. www.mysite.com/here

I do not wish to have my page located deeper such as www.mysite.com/en/here

I have read through this thread along with several others:
http://xenforo.com/community/threads/library-set-your-own-route-controller-as-homepage.10156/page-3
http://xenforo.com/community/threads/creating-an-addon.5416/

I can presently create a route and use it as long as I designate a route prefix such as /en.

My sole question is...how can I set up a route so it is used directly off the root URL without any prefix?

Put another way, I have an existing site that is presently designed as follows:

www.mysite.com/index.html
www.mysite.com/page1.html
www.mysite.com/page2.php

I want to add XF to the site, and keep the existing URL structure. I would also like the option to change the URL structure to work without the extensions (.html / .php). I prefer the look of www.mysite.com/page1, but I also need to preserve the existing path so as not to break any existing links.

Create a route at the following URL:
/admin.php?route-prefixes/
Route Prefix: en
Route Type: Public
Route Class: ExternalPages_Route_Prefix_En
Use Class to Build Link: Always
Add-On: External Pages

This is where I am getting hung up. Route Prefix is a required field. It seems I am missing something simple. Is there a way I can leave that blank so I can then use this suggestion without having all my pages prefixed with /en?
 
No.

No prefix. That is the entire point.

The current URL to the pages are www.example.com/page1.html. I need THAT EXACT URL to be maintained with XF installed on the site, otherwise all the old links break.

I would like to "upgrade" the links to improve the appearance by removing the file extension, but that's it.

I have shared this exact information repeatedly, and explained in great detail. No prefix.
So you just want a blank page?
domain.com/myblackpage

?
 
Code:
<?php

class Gallery_Route_Prefix implements XenForo_Route_Interface
{
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
        return $router->getRouteMatch('Gallery_ControllerPublic', 'index', 'gallery/', $routePath);
}
}
And then make the controller class. Should work. let me know if you have any questions or anything. As far as I know you will unfortunately have to make each page it's own route/prefix to accomplish what you want.
 
Top Bottom