• 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 am hoping the guys from vbAdvanced keep true to their promise on xfAdvanced. :) One can dream right!
vBadvanced was something that helped alot of sites become more than just forums.
That being said, I think XenPorta is better than vBadvanced already, IMO. Is there something you liked in vBadvanced that XenPorta doesnt have ?
 
vBadvanced was something that helped alot of sites become more than just forums.
That being said, I think XenPorta is better than vBadvanced already, IMO. Is there something you liked in vBadvanced that XenPorta doesnt have ?

XenPorta works great for the home page, which I integrated nicely into my site. But then I need a number of additional external pages but maintaining the same look and feel as the rest of the site and integrating the permission system. vBAdvanced allowed you to quickly and easily create pages and apply number of custom blocks to pre-defined areas or user-created areas.

They say they are working on it, but it is going to take some time.
 
But then I need a number of additional external pages but maintaining the same look and feel as the rest of the site and integrating the permission system.
Doesn't everyone !
I was so saddened when Xenforo's native Pages didn't meet this requirement.
vBAdvanced allowed you to quickly and easily create pages and apply number of custom blocks to pre-defined areas or user-created areas.
XenCarta has robust templating that might somewhat work for some of your needs ..... But .... I think what you've done in this thread is probably the best bet for what you want.
XF/vB/advanced say they are working on it, but it is going to take some time.
Time is not on my side.
Never, ever !
 
Please provide a sample CSS file for EP_Advertise template. I am stumped for creating an accompanying css template. ....peace.
 
can we add php to these pages?

You can add custom PHP to each external page. You would place this in the ControllerPublic file for that specific external page. The function is called actionIndex and you will assign the data to a value in the viewParams array.

In the example files you will see onlineUsers and boardTotals in the viewParams array, but you can add as many more as you need.

Please provide a sample CSS file for EP_Advertise template. I am stumped for creating an accompanying css template. ....peace.

Each external page should have the default CSS files. I added more CSS values to the EXTRA.css file. None of my external pages has its own CSS file.
 
You can add custom PHP to each external page. You would place this in the ControllerPublic file for that specific external page. The function is called actionIndex and you will assign the data to a value in the viewParams array.

could you provide some examples of custom PHP ... I am just not getting it this morning, sorry.
 
could you provide some examples of custom PHP ... I am just not getting it this morning, sorry.

Absolutely. Here is the Advertising.php file in the ControllerPublic directory:

class ExternalPages_ControllerPublic_Advertise extends XenForo_ControllerPublic_Abstract
{
public function actionIndex()
{
$visitor = XenForo_Visitor::getInstance();
$sessionModel = $this->getModelFromCache('XenForo_Model_Session');

$onlineUsers = $sessionModel->getSessionActivityQuickList(
$visitor->toArray(),
array('cutOff' => array('>', $sessionModel->getOnlineStatusTimeout())),
($visitor['user_id'] ? $visitor->toArray() : null)
);

$boardTotals = $this->getModelFromCache('XenForo_Model_DataRegistry')->get('boardTotals');
if (!$boardTotals)
$boardTotals = $this->getModelFromCache('XenForo_Model_Counters')->rebuildBoardTotalsCounter();

// Adding more template variables here.
$someValue = "OMG HI!";
$anotherValueHere = "SWEETNESS!";

$viewParams = array(
'onlineUsers' => $onlineUsers,
'boardTotals' => $boardTotals,
'someValue' => $someValue,
'anotherValueHere' => $anotherValueHere
);

return $this->responseView('ExternalPages_ViewPublic_Advertise', 'EP_Advertise', $viewParams);
}
}

You can now access the {$someValue} and {$anotherValueHere} in the EP_Advertise template.

Does that answer your question?
 
Using my site as an example:
http://www.sitename.com/en/tickets/
http://www.sitename.com/en/schedule/
http://www.sitename.com/en/tos/

But you can change the "/en/" to "/whatever/". You will just need to change the references to "/en/" to "/whatever/" in a couple of files.

Hi Robdog,

Thank you for the great tutorial, almost everything I have tried is working perfectly from custom route to custom tabs and sub menus, php...... However how did you get the pages to work outside your forum directory?

For example:

I have my forum located at

site.com/forum/

By following your tutorial my new pages are displaying like this:

site.com/forum/en/advertise/
site.com/forum/en/privacy/
site.com/forum/en/mycustompage/
......

How did you do it so that the pages are working like this:

site.com/en/advertise/
site.com/en/privacy/
site.com/en/mycustompage/

Do you need a custom .htaccess file under site.com/ do you create extra .php files for each page to go under the site root?

Thank you :D
 
Hi Robdog,

Thank you for the great tutorial, almost everything I have tried is working perfectly from custom route to custom tabs and sub menus, php...... However how did you get the pages to work outside your forum directory?

For example:

I have my forum located at

site.com/forum/

By following your tutorial my new pages are displaying like this:

site.com/forum/en/advertise/
site.com/forum/en/privacy/
site.com/forum/en/mycustompage/
......

How did you do it so that the pages are working like this:

site.com/en/advertise/
site.com/en/privacy/
site.com/en/mycustompage/

Do you need a custom .htaccess file under site.com/ do you create extra .php files for each page to go under the site root?

Thank you :D

hhmmmm.... :)

I have my site installed here: site.com (so not in a subfolder) So any url will hit the XenForo controller and see if it is an external page or not. My guess would be to have a custom htaccess file in the root and have site.com/en/advertising/ point to site.com/forum/ and see what happens. I would assume the XenForo controller would take over, but I could be wrong.

Try that out and let me know if it works or not. (I am curious now, lol)
 
Something like this will work , but kind of defeat the point as it only redirect the request
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteRule ^en/advertise(.*)$ http://site.com/forum/en/advertise$1 [L,R=301]

</IfModule>

Need to do more testing over the weekend when I'm not to tired :p
 
Take out the [L,R=301] and replace it with [NC,L].

I am just worried about the JS and CSS files breaking.
 
Something like this will work , but kind of defeat the point as it only redirect the request
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteRule ^en/advertise(.*)$ http://site.com/forum/en/advertise$1 [L,R=301]

</IfModule>

Need to do more testing over the weekend when I'm not to tired :p

This is what I have in my .htaccess in my root folder ... works great

Code:
Redirect /en http://www.masterchief.com/community/en
 
This is what I have in my .htaccess ... works great

Code:
Redirect /en http://www.masterchief.com/community/en
All type of redirect are working fine so far.... but....
I still wish I could create the pages outside the forum directory.
 


See my profile comments :)
 
Top Bottom