Coding

Magento: convert all wrong product links in their canonical equivalent.

Sometimes in magento product links are listed in the following mode:
catalog/product/view/id/3/s/product-name/category/3/
which can be very inconvenient from the SEO point of view. To solve this issue you can force a canonical form of product url in following mode:

In theme/template/catalog/product/list replace all instances of

$_product->getProductUrl()

with

Mage::getUrl($_product->getUrlKey())

Edit attribute(show,x) template in EzPublish

You know when you are using attribute(show,2) on some variable and you can’t understand levels of variable’s contents? I do, so i decided to tweak a bit this function.

All you need to do is open
lib\eztemplate\classes\eztemplateattributeoperator.php
and replace all instances of $spacing = str_repeat( “>”, $cur_level ); with $spacing = str_repeat( “==”, $cur_level );

Now it’s a bit more understandable.

Trovare il nodo corrente con EzPublish

Ecco come trovare il nodo corrente con ezPublish se vi trovate nel pageLayout:

{def $currNode=fetch( content, node, hash( 'node_id', $module_result.node_id) )}

Invocare il debug verso PhpEd da uno script php cli

All’interno dello script aggiungere

debugbreak('[email protected]');

Dove 192.168.0.17 è indirizzo ip su cui è in essecuzione phped (localhost nel caso in cui fate il tunneling con putty)

Ottenere il percorso completo per un Immagine con EzPublish

{$node.object.data_map.sfondopagina.content[original].full_path|ezroot}

Configurare la codifica Utf8 come predefinita su Elipse

Nella cartella “.settings” (che si trova nel vostro progetto) aprire il file “org.eclipse.core.resources.prefs” ed aggiungere dentro seguente testo

eclipse.preferences.version=1
encoding/ =UTF-8

Analogo di html_entity_decode per Android

Come convertire le entità html sotto android:
Unico modo fino ad adesso che ho trovato è seguente (veeeery lame)

Continua…

Risolvere errore “ERROR: the user data image is used by another emulator”

Più di una volta mi è capitato questo errore mentre sviluppavo per android. La via più veloce per risolverlo sembrerebbe di essere quella di riavviare il servizio adb con il commando

adb kill-server && adb start-server

Conversione da unixtime alla data human

Funzione per la conversione dalla unixtime a date time
Continua…

Convertire unixtime in date su android

Piccolo snipplet per convertire una data in unixtime in un formato “umano”.
Continua…