• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Generic Dialogue Box

Myke623

Active member
#1
Is there a recommended way of using a generic dialogue box for the purposes of informing/warning the user?

To date, I've been using a simple template:
Code:
<xen:title>{$title}</xen:title>
<xen:h1>{$title}: {$subtitle}</xen:h1>

<div class="sectionMain">
    <div class="primaryContent">{$message}</div>
    <div class="sectionFooter overlayOnly">
        <a class="button primary OverlayCloser">{xen:phrase close}</a>
    </div>
</div>
In my controller, depending on what conditions are met I'll either return the intended view or the above "info" view with context specific $title, $subtitle and $message.

Just wondering if there's a facility within XenForo that will achieve the same thing and forgo the need for me to have this template?
 

Brogan

XenForo moderator
Staff member
#4
You could use the default error overlay?

PHP:
$this->error(new XenForo_Phrase('please_enter_message_with_no_more_than_x_characters', array('count' => $maxLength)), 'message');
upload_2014-10-26_13-27-41.png
 

Myke623

Active member
#5
I don't think 'error' is a valid Controller method, and that's where I'm looking to use this functionality.

But following on from this, I can return a responseError() to achieve the same thing. Thanks for the tip!