Order Note
In php programming, we may notice that if we sort a group of datas by a string field storing numbers , maybe we can not get the correct order we want .For example:
image1.jpg,image2.jpg,image10.jpg,image20.jpg,
after using function sort(),得到:
image1.jpg,image10.jpg,image2.jpg,image20.jpg,
this may be not what we want, so we can use natsort() to fix it .
But in the database if the field is varchar or text,how should we fix it ?
We can use this function :CAST.For example
select * from image order by CAST(`image_order` AS SIGNED INT)
just to convert string to int, that is all. Anyway , if noticing it before , we can change the type of image_order with SIGNED INT, that is better.
Realurl configuration
Sometimes we need friendly reading url which realurl can support it powerfully.But when we built our own extension ,What should we pay attension to ?
At first .Note that make the link with plugin class method.
$this->pi_getPageLink($pageId,”,$param).
Here $pageId is the Id of page ,$param is like this
$param = array(‘tx_bookonline_pi1[cID]‘=>$cat_uid);
Then we just need change the configuration file of realurl to let it know how to translate our parameter tx_bookonline_pi1[cID].
add this code
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT']['postVarSets'] = array(
‘_DEFAULT’ => array (
‘category’ => array(
array(
‘GETvar’ => ‘tx_bookonline_pi1[cID]‘,
‘lookUpTable’ => array(
‘table’ => ‘tx_bookonline_category’,
‘id_field’ => ‘uid’,
‘alias_field’ => ‘name’,
‘addWhereClause’ => ‘ AND NOT deleted’
)
),
),
);
So realurl can work and translate the url to /category/name.Good luck!