Attach/Display a module to any static page (Homepage, New page...)

Dear,

I would like to display a module to Homepage as a widget, is that possible? And please make it able to choose to accessing the module in the public area (With the same header, footer as static page) or in the private Dashboard. As now, everytime you click in the Menu to access module, it will transfer and display menu in Dashboard area.

Thanks and Regards,

quangmach
quangmach
  • 1 year ago

Yeah you can do it like that

<?php
    $args = array(
                'limit'     => 50,
                'sort'      =>  'ID',
                'order'     => 'asc' ,
                'params'    => '' ,
    )
    ?>
    <div class="wrapper-header ">
        <div class=" container">
            <div class="col-sm-6 col-xs-6">
                <div class="page-title">
                    <h3> Blabla Text
                        <small> Blabla SubText</small>
                    </h3>
                </div>
            </div>
            <div class="col-sm-6 col-xs-6 ">
                <ul class="breadcrumb pull-right">
                    <li><a href="{{ URL::to('') }}">Home</a></li>
                    <li class="active">Blabla Text</li>
                </ul>
            </div>
        </div>
    </div>
    <div class="wrapper-header ">
        <div class="container">
            <div class="row text-center">
                <h3 class="text-center">Blabla Description</h3>
                <br>
                <br>
                <div class="col-lg-2"></div>
            </div>
            <div class="main text-center col-md-12">
                {{ PublicHelpers::init('Yourmodule',$args)  }}
            </div>
        </div>
    </div>

https://sximo.io/bin/x2

Yourmodule => should have the first letter with CAPITAL LETTER

Sorry but where should I put this one in? I'm trying to put code in Page CMS Content but got this error

"FatalErrorException in 1075694f31447dc3b0399adfc090ad38 line 35:

Class 'PublicHelpers' not found"

Thanks

Creed said:

Yeah you can do it like that

<?php
   $args = array(
               'limit'     => 50,
               'sort'      =>  'ID',
               'order'     => 'asc' ,
               'params'    => '' ,
   )
   ?>
   <div class="wrapper-header ">
       <div class=" container">
           <div class="col-sm-6 col-xs-6">
               <div class="page-title">
                   <h3> Blabla Text
                       <small> Blabla SubText</small>
                   </h3>
               </div>
           </div>
           <div class="col-sm-6 col-xs-6 ">
               <ul class="breadcrumb pull-right">
                   <li><a href="{{ URL::to('') }}">Home</a></li>
                   <li class="active">Blabla Text</li>
               </ul>
           </div>
       </div>
   </div>
   <div class="wrapper-header ">
       <div class="container">
           <div class="row text-center">
               <h3 class="text-center">Blabla Description</h3>
               <br>
               <br>
               <div class="col-lg-2"></div>
           </div>
           <div class="main text-center col-md-12">
               {{ PublicHelpers::init('Yourmodule',$args)  }}
           </div>
       </div>
   </div>

https://sximo.io/bin/x2

Yourmodule => should have the first letter with CAPITAL LETTER

PublicHelpers is located

\app\Library\PublicHelpers.php

Well i didn't test it myself since version 4.2 but it was this way before

when i gonna get a free time i will check it or maybe someone else can have a look into this issue

quangmach said:

Sorry but where should I put this one in? I'm trying to put code in Page CMS Content but got this error

you have to edit a page that you create and past it inside

Your code does not work, the one similar to your but on Sximo github (from mangopik) works. However just attach grid and pagination, sort, order and search (filter) does not work.

Could you please help me to attach full functional module (Grid, search, sort order) the same backend to frontend page?

Thank you.

Creed said:

PublicHelpers is located

\app\Library\PublicHelpers.php

Well i didn't test it myself since version 4.2 but it was this way before

when i gonna get a free time i will check it or maybe someone else can have a look into this issue

quangmach said:

Sorry but where should I put this one in? I'm trying to put code in Page CMS Content but got this error

you have to edit a page that you create and past it inside