tutorials – I'm Knight https://imknight.net From Freelancer to Bootstrapper Mon, 16 Jan 2017 14:12:43 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.8 [FUELCMS] Add a dropdown filter on item listing page https://imknight.net/development/fuelcms-add-a-dropdown-filter-on-item-listing-page/ https://imknight.net/development/fuelcms-add-a-dropdown-filter-on-item-listing-page/#respond Mon, 24 Oct 2011 03:45:13 +0000 https://imknight.net/?p=2481 I m working on Fuelcms again for one of my long-term project, after spending some time to create a feature which you can’t find on the documentation , I have this idea to write a...

The post [FUELCMS] Add a dropdown filter on item listing page appeared first on I'm Knight.

]]>
I m working on Fuelcms again for one of my long-term project, after spending some time to create a feature which you can’t find on the documentation , I have this idea to write a series of blog post on how I did some of the features by using Fuelcms . The admin on  Fuelcms forum is really helpful , I guess this is my way to contribute back to the  Fuelcms community.

This tutorial is suitable for Fuelcms user who have follow the documentation create advance module, but if you try to find a solution for this ,most likely you want to have this feature on your advance module, so I assume that you understand the basic concept and folder structure of advance module.

The item listing page on Fuelcms  is a very standard page, you can find it on almost every module, it provide a search filter, which allow you to search any field that you defined , but what if you want to have a drop down field to filter the result ?

Assume my module is call “Operation”.

1. First you need to edit  operation/config/operation_fuel_modules.php , the should be some config file for your module, add in this filters config. You just need to add in the filters config.

  • date_added is the field name , the field that you want to filter the listing.
  • default is for the default value, in this case the default value is set to ‘all’.
  • label is a tiny text that show beside your drop down filter.
  • type will be the field type, if you never set it as select, it will be a text box input.
2. Change the route by edit operation/config/operation_routes.php, the original routing might be redirect to fuel module folder ( FUEL_FOLDER.’/module’ ) but since we need to override it, we need to route it to a custom controller.
3. Create a new file in the controller folder , this will extend from the module controller and override the default setting. You should assign the drop down value in this controller , either by pre define value or pulling from some other model.
Once this 3 steps is done, you should be able to see the drop down select appear on your items listing page, you can now use this drop down field as part of your list filter , you can have an empty value option for display all items.

The post [FUELCMS] Add a dropdown filter on item listing page appeared first on I'm Knight.

]]>
https://imknight.net/development/fuelcms-add-a-dropdown-filter-on-item-listing-page/feed/ 0
using jQuery serialize to handle posting field https://imknight.net/development/using-jquery-serialize-to-handle-posting-field/ https://imknight.net/development/using-jquery-serialize-to-handle-posting-field/#respond Mon, 17 May 2010 14:45:42 +0000 https://imknight.net/?p=2036 Iwas doing some ajax form submission today with jQuery and just find out this new technique that handle all the posting field. Let’s take a look the jQuery Post syntax jQuery.post( url, [ data...

The post using jQuery serialize to handle posting field appeared first on I'm Knight.

]]>
Iwas doing some ajax form submission today with jQuery and just find out this new technique that handle all the posting field. Let’s take a look the jQuery Post syntax

jQuery.post( url, [ data ], [ success(data, textStatus, XMLHttpRequest) ], [ dataType ] )

as you can see the second parameter is [data] which mean that all the data that you need to pass to your submit form. What i use to do is getting variable from each field and form up a nicely JSON data array like this, which is a very time-consuming way.

{ name: "Knight", Email: "knight@email.com", Age: "30" }

the new way that i just find out today ( late better than never ) is to make use of the serialize function. I created a sample form with the code below.

[html]
<form id="<span class=">regoform</form>" action="submit.php" methd="post">
<fieldset>
<legend>Register Form</legend>
Name <input type="text" name="name" />

Email <input type="text" name="email" />

Age <input type="text" name="age" />

<button id="regobutton">register</button>
</fieldset>
</form>
[/html]

as you can see this is a normal form with 3 text field, by using the jQuery serialize function , I m grabbing all the data from each field and assign the value with the  name variable, example email variable will have the email value that I key in.It is quick and simple solution to handle these posting field.

[javascript]
<script type="text/javascript">
$(document).ready(function() {
$("#regobutton").click(function(){
$.post("submit.php", $("#regoform").serialize());
});
});
</script>
[/javascript]

a few thing to take note when writing the jQuery Post ,  every single field need to be within the form elements, so that every field value will be pick up by the serialize function. Another important thing will be the registration button, you need to make sure it will respond when user click on it.

The post using jQuery serialize to handle posting field appeared first on I'm Knight.

]]>
https://imknight.net/development/using-jquery-serialize-to-handle-posting-field/feed/ 0
I m a tutsplus member now https://imknight.net/web-o-matic/i-m-a-tutsplus-member-now/ https://imknight.net/web-o-matic/i-m-a-tutsplus-member-now/#respond Tue, 02 Jun 2009 14:45:46 +0000 https://imknight.net/?p=1864 I blog about thinking of getting myself tutsplus member account as a present during my bday , finally after some consideration i just sign up last night , now i m an official tutsplus...

The post I m a tutsplus member now appeared first on I'm Knight.

]]>
I blog about thinking of getting myself tutsplus member account as a present during my bday , finally after some consideration i just sign up last night , now i m an official tutsplus member !

tuts-network.jpg

Why am i join tutsplus?

  • showing my support to http://net.tutsplus.com/ for being my favourite site.
  • confident with the quality of tutorials and able to learn something in more details.
  • able to access multiple site resource, currently i m interest on psdtutsplus and nettutsplus resources.
  • when you pay for tutorials , this might motivate yourself to learn.

So i have bought the quaterly membership , the first 3 month most likely will be the warm up period and see is this going to help me.I have set some of the goal on the usageof this site, if i can meet my goal then i will convert into yearly membership. Basically i wish to be able to complete 2 tutorials and come out something new every month for the continuous 3 month.

If you thinking to join the tutsplus member too , you can visit and sign up by clicking the banner below, which will help me to earn some extra income.

Psd Plus: advanced Photoshop tutorials.

The post I m a tutsplus member now appeared first on I'm Knight.

]]>
https://imknight.net/web-o-matic/i-m-a-tutsplus-member-now/feed/ 0