Jump to content

How to get the clientAlerts variable in custom page


SametALMDR

Recommended Posts

Hello everyone ,

I would like to ask a question about variables that came in and out in new version. In previous versions , I could use $clientAlerts variable in every custom page. In the new version, ı can't do it.

I check the variables that exist in the page using {debug} in a custom tpl file. But it seems that some of the variables are gone. How can ı access or define the $clientAlerts variables guys or moderators? Can you explain? Thank you before you answering ...

Link to comment
Share on other sites

20 hours ago, SametALMDR said:

I would like to ask a question about variables that came in and out in new version. In previous versions , I could use $clientAlerts variable in every custom page. In the new version, ı can't do it.

are you sure? you should be able to.

20 hours ago, SametALMDR said:

I check the variables that exist in the page using {debug} in a custom tpl file. But it seems that some of the variables are gone. How can ı access or define the $clientAlerts variables guys or moderators? Can you explain?

it works for me on a custom page - if i take the code from header.tpl and put it in a custom .tpl file...

                        {foreach $clientAlerts as $alert}
                            <li>
                                <a href="{$alert->getLink()}">
                                    <i class="fas fa-fw fa-{if $alert->getSeverity() == 'danger'}exclamation-circle{elseif $alert->getSeverity() == 'warning'}exclamation-triangle{elseif $alert->getSeverity() == 'info'}info-circle{else}check-circle{/if}"></i>
                                    <div class="message">{$alert->getMessage()}</div>
                                </a>
                            </li>
                        {foreachelse}
                            <li class="none">
                                {$LANG.notificationsnone}
                            </li>
                        {/foreach}

lmh3XVR.png

it works for me in Six, 21 or a child of either.

Link to comment
Share on other sites

6 hours ago, brian! said:

are you sure? you should be able to.

it works for me on a custom page - if i take the code from header.tpl and put it in a custom .tpl file...


                        {foreach $clientAlerts as $alert}
                            <li>
                                <a href="{$alert->getLink()}">
                                    <i class="fas fa-fw fa-{if $alert->getSeverity() == 'danger'}exclamation-circle{elseif $alert->getSeverity() == 'warning'}exclamation-triangle{elseif $alert->getSeverity() == 'info'}info-circle{else}check-circle{/if}"></i>
                                    <div class="message">{$alert->getMessage()}</div>
                                </a>
                            </li>
                        {foreachelse}
                            <li class="none">
                                {$LANG.notificationsnone}
                            </li>
                        {/foreach}

lmh3XVR.png

it works for me in Six, 21 or a child of either.

I'm so sorry because ı forgot to initialize the page using $ca->initPage() 😄

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated