Jump to content

Recommended Posts

Posted (edited)

The site I am working on has 2 different languages. All the other multi-language pages areworking fine. The issue arised when I tried to load a page in a modal window in the 2nd language (not the default).

This is the call to modal window:

<div id="modal-form" class="uk-flex-top" uk-modal>
    <div class="uk-modal-dialog uk-width-auto uk-margin-auto-vertical">
        <button class="uk-modal-close-default" type="button" uk-close></button>
        <div class="uk-modal-header">
        <h4 class="uk-modal-title"><?php echo $header; ?></h4>
        </div>
        <div class="uk-modal-body" uk-overflow-auto>
        <?php
            $curpage = $pages->get('template=contact-interest');
        ?>
        <iframe src="<?php echo $curpage; ?>" width="920" height="400" uk-responsive></iframe>
        </div>
    </div>
</div>

It always loads the page in default language.

I found out that the solution that correctly returns the page in the desired language is below:

<div id="modal-form" class="uk-flex-top" uk-modal>
    <div class="uk-modal-dialog uk-width-auto uk-margin-auto-vertical">
        <button class="uk-modal-close-default" type="button" uk-close></button>
        <div class="uk-modal-header">
        <h4 class="uk-modal-title"><?php echo $header; ?></h4>
        </div>
        <div class="uk-modal-body" uk-overflow-auto>
        <?php
            $reserve = $pages->get('template=contact-interest');
            $language = $user->language;
            $curpage = $reserve->localUrl($language);
        ?>
        <iframe src="<?php echo $curpage; ?>" width="920" height="400" uk-responsive></iframe>
        </div>
    </div>
</div>

Hope this will help someone else that faces the same problem.

Edited by sp1ke

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...