Jump to content


Use of Grocery Crud inside existing admin template


  • Please log in to reply
12 replies to this topic

#1 alain

alain

    Member

  • Members
  • PipPip
  • 22 posts

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



#2 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

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 :)



#3 alain

alain

    Member

  • Members
  • PipPip
  • 22 posts

Posted 12 February 2014 - 03: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!



#4 ceroberoz

ceroberoz

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts

Posted 12 February 2014 - 05: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.



#5 alain

alain

    Member

  • Members
  • PipPip
  • 22 posts

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);
}


#6 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

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



#7 alain

alain

    Member

  • Members
  • PipPip
  • 22 posts

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



#8 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

Posted 13 February 2014 - 02: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!!



#9 MiamMiam

MiamMiam

    Advanced Member

  • Members
  • PipPipPip
  • 33 posts
  • LocationLimousin - France

Posted 14 February 2014 - 08:27 AM

@alain : for the tabs in forms, check this : http://www.grocerycr...8-tabs-in-forms

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

 

Salut


Grocery CRUD is great ! | Contribute or donate... or do both ;-)


#10 alain

alain

    Member

  • Members
  • PipPip
  • 22 posts

Posted 14 February 2014 - 02:24 PM

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

 

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



#11 alain

alain

    Member

  • Members
  • PipPip
  • 22 posts

Posted 17 February 2014 - 08:13 AM

Ah ok, Amit's contribution: https://github.com/b...zer/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).



#12 Jessmoi

Jessmoi

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 21 April 2015 - 05:42 AM

Eh itu gimana ngubah jadi bahasa indonesia ya?



#13 Jessmoi

Jessmoi

    Newbie

  • Members
  • Pip
  • 2 posts

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?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users