⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Use of Grocery Crud inside existing admin template



alain
  • profile picture
  • Member

Posted 10 February 2014 - 08:51 AM

Hi!

 

I am just interested in list and form generated by Grocery CRUD.

I have already webdesigned the other pages of my codeigniter-based admin interface.

 

How to use of Grocery Crud inside existing admin template?

 

How to integrate my own viewHeader.php and viewFooter.php in $this->_example_output($output) ?

 

Alain


Amit Shah
  • profile picture
  • Member

Posted 12 February 2014 - 08:30 AM

Hi there...

 

here is the example for the same

<?php include APPPATH . 'views/components/header2.php';?>
	<!-- loading animation -->
    <div id="qLoverlay"></div>
    <div id="qLbar"></div>
    
    <?php include APPPATH . 'views/components/top_header.php';?>
    <?php 
    foreach($css_files as $file): ?>
    	<link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" />
    <?php endforeach; ?>
    <?php foreach($js_files as $file): ?>
    	<script src="<?php echo $file; ?>"></script>
    <?php endforeach; ?>
    
    <div id="wrapper">
    	<?php include APPPATH . 'views/components/sidebar.php';?>
<!--Body content-->
        <div id="content" class="clearfix">
            <div class="contentwrapper"><!--Content wrapper-->
                <!-- Build page from here: -->
                <div class="row-fluid">
					<?php echo $output; ?>
                </div><!-- End .row-fluid -->
                <!--End page -->
                
            </div><!-- End contentwrapper -->
        </div><!-- End #content -->
    
    </div><!-- End #wrapper -->
<?php include APPPATH . 'views/components/footer.php';?>

the ones higlighted in red are the only elements required to display the grocery crud element in any view....

Rest apart - u can have your own layout in the same.

 

Happy GCing :)


alain
  • profile picture
  • Member

Posted 12 February 2014 - 15:06 PM

Thanks Amit for your answer!

 

My real problem is the conflicts with other CSS and JS used by the view header and the view footer of existing template!

For example: the existing template use Jquery older version than GC, GC and existing templete use both twitter bootstrap!


ceroberoz
  • profile picture
  • Member

Posted 12 February 2014 - 17:01 PM

Thanks Amit for your answer!

 

My real problem is the conflicts with other CSS and JS used by the view header and the view footer of existing template!

For example: the existing template use Jquery older version than GC, GC and existing templete use both twitter bootstrap!

it's ok, just remove your jquery from the head. here's mine

<head>
    	<TITLE>Distro Nekogear Works | Admin Panel</TITLE>
        <link rel="stylesheet" href="<?php echo base_url();?>assets/metroui/css/metro-bootstrap.css">
		<link rel="stylesheet" href="<?php echo base_url();?>assets/metroui/css/custom.css">
		<?php foreach($css_files as $file): ?>
			<link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" />
		<?php endforeach; ?>
		<?php foreach($js_files as $file): ?>
			<script src="<?php echo $file; ?>"></script>
		<?php endforeach; ?>
        
        <script src="<?php echo base_url();?>assets/metroui/min/metro.min.js"></script>
    </head>

the GC jquery works fine with my layout.

Untitled.png

*note: I've only test it with using metroui, twitter bootsrap, & direct script.


alain
  • profile picture
  • Member

Posted 13 February 2014 - 07:31 AM

ok thanks ceroberoz!

 

Effectively, I remove call of jquery, jquery ui, bootstrap.js in my template, they will be replaced by Grocery Crud jquery!

 

It remains a little problem because there are already some customizations in jquery-ui-1.9.2.custom.css of the template.

 

And how to integrate another parameter to the $output??

 

The following code does not work:

public function _output($output = null)
{
    $output["menu_active"] = "accueil";
    $this->load->view('admin/vwFicheEntreprise', $output);
}

Amit Shah
  • profile picture
  • Member

Posted 13 February 2014 - 10:58 AM

well there is a simpler solution

u can just do a $crud->unset_jquery()

 

or in the grocery crud library - u can change the jquery u intend to use


alain
  • profile picture
  • Member

Posted 13 February 2014 - 12:20 PM

cool, GC is about to be packed with features.

 

Do you think it will be easy to customize GC form because I am searching to create a form with tabs :

 

customized_form.jpg


Amit Shah
  • profile picture
  • Member

Posted 13 February 2014 - 14:01 PM

i will prefer u use extension like i did in mine...!!! gc with groups...

that way u wont hamper out the existing library.. else everywhere it will act the same way...!!

 

u surely are free to alter / modify .... but others might not just accept....

message me in personal.. will get in touch with u on chat if u want to discuss stuff!!


MiamMiam
  • profile picture
  • Member

Posted 14 February 2014 - 08:27 AM

@alain : for the tabs in forms, check this : /topic/2428-tabs-in-forms

I didn't test yet Amit Shah's extension but it might be worth a glance also.

 

Salut


alain
  • profile picture
  • Member

Posted 14 February 2014 - 14:24 PM

Can I get the link to Amit's extension? GC Group?

 

Before that, I'm going to test MiamMiam's solution!


alain
  • profile picture
  • Member

Posted 17 February 2014 - 08:13 AM

Ah ok, Amit's contribution: https://github.com/blakdronzer/POWER-GCrud I will see it

 

But for now, I use MiamMiam's solution, it's simple and wonderful. It is not a plugin but a good use of Grocery Crud (GC callback and javascript).


Jessmoi
  • profile picture
  • Member

Posted 21 April 2015 - 05:42 AM

Eh itu gimana ngubah jadi bahasa indonesia ya?


Jessmoi
  • profile picture
  • Member

Posted 21 April 2015 - 05:43 AM

it's ok, just remove your jquery from the head. here's mine

<head>
    	<TITLE>Distro Nekogear Works | Admin Panel</TITLE>
        <link rel="stylesheet" href="<?php echo base_url();?>assets/metroui/css/metro-bootstrap.css">
		<link rel="stylesheet" href="<?php echo base_url();?>assets/metroui/css/custom.css">
		<?php foreach($css_files as $file): ?>
			<link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" />
		<?php endforeach; ?>
		<?php foreach($js_files as $file): ?>
			<script src="<?php echo $file; ?>"></script>
		<?php endforeach; ?>
        
        <script src="<?php echo base_url();?>assets/metroui/min/metro.min.js"></script>
    </head>

the GC jquery works fine with my layout.

*note: I've only test it with using metroui, twitter bootsrap, & direct script.

eh itu gimana ngubah ke bahasa indonesia ya?