Addon as default page?

airworks

Member
I'm wondering if it's possible to set an addon as the default page instead of the forum? For example, in IPB you can change the default application by editing the value of a constant. If you set that value to say 'portal' your main page would now show the portal instead of having it at /portal. The forum index could then be located at /forums, /index, or another subdirectory. Is it possible to do that in XenForo?
 
Sure it is!

There is a section in the Basic Board Information Options that allows you to set your forum's URL (e.g: http://www.yoursite.com/forum) and your site's home page (e.g http://www.yoursite.com/ or whatever you want). This will set your Home tab to whatever your homepage is set to. Mine is currently set to just my forum's home page.
Not sure if you misunderstood, but I wasn't really asking about the home tab.

What I meant was for example say you have your forum in the root at:
"myforum.com"
And you have an addon at:
"myforum.com/myaddon"

Is it possible to have "myforum.com" show the contents of "myforum.com/myaddon" (let's say the addon is a portal and thus the portal is now shown at "myforum.com" instead of the forum index), and now the forum might be accessed from "myforum.com/forums" instead.

Hopefully that is more descriptive.
 
First you would install xenForo in the web root of your site (yoursite.com).

Then setup friendly URLs like what you see here on xenforo.com. Friendly URLs are a built-in feature of xenForo. This creates the appearance of subdirectories using xenForo's own URL paths. For example, this non-friendly URL:

http://xenforo.com/community/index.php?threads/addon-as-default-page.8510/

...becomes this:

http://xenforo.com/community/threads/addon-as-default-page.8510/

Addons usually have their own URL paths within xenForo.

Then you need to change the URL paths to your liking. I am a little fuzzy on this part, but I think you can do this with custom rewrite rules or a xenForo addon. This gets into custom code. You can always post a request in this forum. I am sure you will find some one to help.
 
Sorry, you're correct I misunderstood you.

Currently, there isn't a default way to do that with the XenForo setup. However I do believe that the Portal Addon/Mod does do something similar to this. I don't use Portal pages so I am not sure.
 
Kovifor was able to do this, and I think he is intending to write a guide at some point to share it with the community (Not sure).

This was a few weeks ago, so I could be wrong.
 
Kovifor was able to do this, and I think he is intending to write a guide at some point to share it with the community (Not sure).

This was a few weeks ago, so I could be wrong.
This was actually a few days ago. but the basic steps I used to accomplish this, was to define a new route prefix (I used forum-index) in the Development section and set the route class to be one of my own making. And since I couldn't figure out a way to accomplish it... I copied & pasted the contents of the XneForo_RoutePrefix_Index::actionIndex() class to a new actionIndex() function in my route prefix. I could probably write up a new method to get it set up. But this method provides a few errors I haven't sat down to figure out yet.
 
This was actually a few days ago. but the basic steps I used to accomplish this, was to define a new route prefix (I used forum-index) in the Development section and set the route class to be one of my own making. And since I couldn't figure out a way to accomplish it... I copied & pasted the contents of the XneForo_RoutePrefix_Index::actionIndex() class to a new actionIndex() function in my route prefix. I could probably write up a new method to get it set up. But this method provides a few errors I haven't sat down to figure out yet.
Does this indicate that you had to alter the core forum code, or is this still all code within your own addon?

Well I guess in any case that answers my question, that I'd need some custom solution in order to do this. :(
 
Kovifor was able to do this, and I think he is intending to write a guide at some point to share it with the community (Not sure). This was a few weeks ago, so I could be wrong.
I did an add-on, but I copied core code.
But I am looking for a way to not copy code.

Many many people look forward to this breakthrough.
Is there a way to explain what you did, including what code to copy, that could help others ?
 
I'm not sure what you have planned.

But I think people mostly want is for whichever Addon (which usually has it's own Tab) to be displayed when a user goes to www.site.com. People don't want the Forum tab highlighted ....
FYI, I do know there is a MOD which allows you to Highlight a certain tab when a certain page is displayed.
 
I'm not sure if I could modify the tab. I'll see what I can get done and all, but mostly, this works. I need to figure out how to get this to work if invalid input is placed in there.
 
Top Bottom