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

What would that be used for ? The only situation i've heard about for frames is iframes when trying to get one software to appear integrated into another software. The big criticism was major SEO problems.

accomplish something similar to XenForo splash page, link to different pages of information, but I would prefer to use buttons.. just a thought at this point. this would be more to your concept of being able to edit pages/data outside of XenForo itself .. peace
 
There's nothing ATM, but we decided to use one, because we need 3 areas (2 sidebars) for the cms (left,center,right) and a own navigation. Also it's IMHO better for us to use own dependencies, so we don't need to deal to much with the original xenforo public dependencies and inserting own data into them...

EXACTLY!

At this point I would be more interested in working with bare bones shell of xenforo for the external page, then start customizing at that point.
 
Playing around with iFrames and external pages. The SRC within each iframe may be html, a text file, a PDF, or an image that exists on your server. This is nothing much to look at right now, but here is my sample:

http://www.masterchief.com/en/advertise/

FYI - source can also be a link to websites, etc.

Code:
<xen:h1>iFrames</xen:h1>
<xen:title>iFrames coming to masterchief TEAM</xen:title>
<xen:description>EP_Advertise template</xen:description>

<iframe
    src="page.txt"
    style="float: left;
    width: 700px;
    height: 600px;
    margin-left: 0px;
    border: 1px solid black;"
    name="left">
    Alternative Content
</iframe>

<iframe
    src="another.txt"
    style="float: right;
    width: 450px;
    height: 290px;
    margin-left: 0px;
    border: 1px solid black;"
    name="top">
    Alternative Content
</iframe>

<iframe
    src="newpage.txt"
    style="float: right;
    width: 450px;
    height: 290px;
    margin-top: 16px;
    margin-bottom: 0px;
    pargin-left: 0px;
    margin-right: 0px;
    border: 1px solid black;"
    name="bottom">
    Alternative Content
</iframe>
 
what about something like that?
PHP:
<div class="pageWrapper">
    <div class="pageContent">
          <xen:include template="custom_Page_Content" />
    </div>
    <div class="pageSidebarRight">
          <div class="pageModule">
              <xen:include template="custom_Page_module_A" />
          </div>
          <div class="pageModule">
              <xen:include template="custom_Page_Module_B" />
          </div>
    </div>
</div>
 
Lets play with alternate page containers. It is done this way. Change last value in the responseview array to name of alternate page container.

Code:
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();

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

        return $this->responseView(
            'ExternalPages_ViewPublic_Advertise',  //  view name
            'EP_Advertise',  //  content template
            $viewParams,  //  data to be passed to content template
            array('containerTemplate' =>
                'PAGE_CONTAINER')  //  container template
        );
    }
}
 
Hey Robdog.
Your Addon sounds nice and looks great,
but didn´t work in my instance.
What I´v done:
I´ve extracted all files in the Folder XenForo under Library.
There are folders with the same name, I added them to it.
Then I´ve created a Prefix like it is in your post.
I don´t add an Listener, because its optional.

Then I try to open http://localhost/xen/en/tickets/.
That should be one of your sites.
But it didn´t work.

Do you know what is missing?
What I do wrong?

Hope to hearing from you.

Faithfully
 
You need to specify a template in Tickets.php and create it in Xenforo Admin CP

Is there someone who needs to remove the en prefix? I found a way to do it :)
 
Hey Lu Jia.
Thanks for your reply.
I defined a new template, but how can I specify this in Tickets.php?
Can you give me some examples for the full integration in this part?

Faithfully
 
For example you can use this code as base:

PHP:
            $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();
            $var = 'gogo';

            $viewParams = array(
                'onlineUsers' => $onlineUsers,
                'boardTotals' => $boardTotals,
                'value' => $var,

            );

            return $this->responseView('ExternalPages_ViewPublic_En_Tickets', 'EP_Tickets', $viewParams);
        }

The last line is the important one, EP_Tickets is the template name you can change it with your template name and $viewParams is an array who contain all var you can output in the page. Just put {$value} (in this example) and you'll see "gogo".
If you have more questions just ask :)
 
Hey Lu.
At the moment I feel like a stupid child.
With your source I create a new Template.
But what is the next level?
Then I have the same look then before.
At the moment I miss the right point for me to walk alone :-(

Faithfully
 
Can you post me Tickets.php code?
I'll try to post a EP_Tickets code:
HTML:
<xen:h1>tickets system</xen:h1>
<xen:title>Tickets!</xen:title>
<xen:description>description of page</xen:description>
<xen:navigation>
    <xen:breadcrumb href="somelink">Tab name</xen:breadcrumb>
</xen:navigation>
<xen:sidebar>
    <link rel="xenforo_template" type="text/html" href="sidebar_online_users.html" />
    <link rel="xenforo_template" type="text/html" href="forum_stats.html" />
</xen:sidebar>
My contents... {$var} if I need to output a var
 
Hey Lu.
Thaks for your time.
My Tickets.php looks like this:
Code:
<?php

class ExternalPages_ControllerPublic_Tickets 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();

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

        return $this->responseView('ExternalPages_ViewPublic_Tickets', 'EP_Tickets', $viewParams);
    }
}

I´ve created a new template named EP_Tickets with your source and add it to the AddOn External Pages in my XF.
The AddOn is acvtive.
But when I now open a page like http://localhost/xen/en/tickets.php there comes only a failure HTTP 404 to me.
This means, that he can´t find the page.
But the file could be found in ....\Xen\library\XenForo\ControllerPublic
Is this the right way? What is the mistake in my brain at the moment?
I think, the system can´t find my pages or doesn´t understand the created add on...
Or it is me who doesn´t understand the system?

Faithfully
 
the file should be in library/ExternalPages/ControllerPublic/En/Tickets.php
you should controll the route command can you post it the route of en?
Maybe you can try to activate SEF and remove the .php from link, just try to do it
 
Hey Lu.
I´ve moved the pages to your destination.
My route prefix looks like the added File.
The failure is like ever, nothings changed.
I don´t understand the logic of the addon at the moment....

Faithfully
 

Attachments

  • Prefix.webp
    Prefix.webp
    52.1 KB · Views: 28
Mmmmh, can you screenshot the localhost/xen/en/tickets screen or tell me if it will return a blank page or an error.
Sorry for the move to En folder, just turn it back to old folder i moved it for my own reason XD because i need more prefix :P
 
Really I don't know where is the problem :(
Did you upload all files in right folder?

library/ExternalPages
library/ExternalPages/ControllerPublic
library/ExternalPages/ControllerPublic/Tickets.php
library/ExternalPages/Route/Prefix/En.php
 
Top Bottom