Problem variable writing

This is a FORK of the CMS Made Simple project and is not oficially supported in any way by the CMS Made Simple development team.
Locked
colfo
New Member
New Member
Posts: 4
Joined: Wed Feb 24, 2010 9:54 pm

Problem variable writing

Post by colfo »

Good morning Everybody. 
 
I have a problem of writing a variable, I explain:
I use the "Cataloger" module which I put in "Mle".
I shall like to show attribute of article which I created me even. For it no problem:

{$items [numloop].ref}

I would like to make it "Mle", but I do not succeed in writing code!! 
Hollowing-out as this it does not walk:

{$items [numloop].ref$lang}

In that way it works, but not for other languages!!
{$items [numloop].en_US}
 
Thank you for your help
Colflo
Peciura

Re: Problem variable writing

Post by Peciura »

Try Cataloger MLE fork http://forum.cmsmadesimple.org/index.ph ... 479.0.html

Put this smarty code below loop (where  {$items [numloop].ref} is) and post output to forum.

Code: Select all

<pre>{$items|var_dump}</pre>
colfo
New Member
New Member
Posts: 4
Joined: Wed Feb 24, 2010 9:54 pm

Re: Problem variable writing

Post by colfo »

Hi,

Thank you for your help and your answer, here is what is displayed if I put ${items|var_dump}
does it help??

My problem is to succeed in replacing "_fr_fr" in {$ items [numloop] .ref_fr_fr} by $lang or {Lang} ??

Thanks !

array(16) {
  ["image"]=>
  string(121) "http://www.mage.pro/modules/Cataloger/C ... g&ac=52222"
  ["image_src"]=>
  string(91) "http://www.mage.pro/uploads/images/cata ... _src_1.jpg"
  ["link"]=>
  string(82) "http://www.mage.pro/index.php?page=bloc ... s&hl=fr_FR"
  ["title"]=>
  string(35) "Bloc Traditionnel 8% Laurus Nobilis"
  ["alias"]=>
  string(34) "bloc-traditionnel-8-laurus-nobilis"
  ["menutitle"]=>
  string(35) "Bloc Traditionnel 8% Laurus Nobilis"
  ["modifieddate"]=>
  string(19) "2010-04-19 14:21:36"
  ["category"]=>
  string(19) "Blocs Traditionnels"
  ["cat"]=>
  string(19) "Blocs Traditionnels"
  ["createdate"]=>
  string(19) "2010-02-11 12:52:50"
  ["contenu_fr_fr"]=>
  string(0) ""
  ["ref_fr_fr"]=>
  string(5) "SAV28"
  ["poids_fr_fr"]=>
  string(4) "200g"
  ["dimensions_fr_fr"]=>
  string(0) ""
  ["composition_fr_fr"]=>
  string(70) "Sodium oleate, sodium laurate, sodium lioleate, sodium hydroxide, Aqua"
  ["info_fr_fr"]=>
  string(0) ""
}
array(16) {
  ["image"]=>
  string(104) "http://www.mage.pro/modules/Cataloger/C ... g&ac=71294"
  ["image_src"]=>
  string(74) "http://www.mage.pro/uploads/images/cata ... _src_1.jpg"
  ["link"]=>
  string(65) "http://www.mage.pro/index.php?page=bloc ... l&hl=fr_FR"
  ["title"]=>
  string(36) "Bloc Traditionnel 20% Laurus Nobilis"
  ["alias"]=>
  string(17) "bloc-traditionnel"
  ["menutitle"]=>
  string(36) "Bloc Traditionnel 20% Laurus Nobilis"
  ["modifieddate"]=>
  string(19) "2010-04-19 14:22:37"
  ["category"]=>
  string(19) "Blocs Traditionnels"
  ["cat"]=>
  string(19) "Blocs Traditionnels"
  ["createdate"]=>
  string(19) "2009-05-27 23:32:44"
  ["contenu_fr_fr"]=>
  string(0) ""
  ["ref_fr_fr"]=>
  string(5) "SAV01"
  ["poids_fr_fr"]=>
  string(4) "200g"
  ["dimensions_fr_fr"]=>
  string(0) ""
  ["composition_fr_fr"]=>
  string(70) "Sodium oleate, sodium laurate, sodium lioleate, sodium hydroxide, Aqua"
  ["info_fr_fr"]=>
  string(0) ""
}
array(16) {
  ["image"]=>
  string(122) "http://www.mage.pro/modules/Cataloger/C ... g&ac=98389"
  ["image_src"]=>
  string(92) "http://www.mage.pro/uploads/images/cata ... _src_1.jpg"
  ["link"]=>
  string(83) "http://www.mage.pro/index.php?page=bloc ... s&hl=fr_FR"
  ["title"]=>
  string(36) "Bloc Traditionnel 35% Laurus Nobilis"
  ["alias"]=>
  string(35) "bloc-traditionnel-35-laurus-nobilis"
  ["menutitle"]=>
  string(36) "Bloc Traditionnel 35% Laurus Nobilis"
  ["modifieddate"]=>
  string(19) "2010-03-22 15:52:47"
  ["category"]=>
  string(19) "Blocs Traditionnels"
  ["cat"]=>
  string(19) "Blocs Traditionnels"
  ["createdate"]=>
  string(19) "2010-02-11 12:54:44"
  ["contenu_fr_fr"]=>
  string(0) ""
  ["ref_fr_fr"]=>
  string(5) "SAV26"
  ["poids_fr_fr"]=>
  string(4) "200g"
  ["dimensions_fr_fr"]=>
  string(0) ""
  ["composition_fr_fr"]=>
  string(70) "Sodium oleate, sodium laurate, sodium lioleate, sodium hydroxide, Aqua"
  ["info_fr_fr"]=>
  string(0) ""
}
array(16) {
  ["image"]=>
  string(126) "http://www.mage.pro/modules/Cataloger/C ... g&ac=48109"
  ["image_src"]=>
  string(96) "http://www.mage.pro/uploads/images/cata ... _src_1.jpg"
  ["link"]=>
  string(87) "http://www.mage.pro/index.php?page=savo ... e&hl=fr_FR"
  ["title"]=>
  string(52) "Bloc Traditionnel avec porte-savon en Verre Soufflé"
  ["alias"]=>
  string(39) "savon-avec-porte-savon-en-verre-souffle"
  ["menutitle"]=>
  string(52) "Bloc Traditionnel avec porte-savon en Verre Soufflé"
  ["modifieddate"]=>
  string(19) "2010-05-03 12:28:30"
  ["category"]=>
  string(19) "Blocs Traditionnels"
  ["cat"]=>
  string(19) "Blocs Traditionnels"
  ["createdate"]=>
  string(19) "2010-04-02 14:15:51"
  ["contenu_fr_fr"]=>
  string(0) ""
  ["ref_fr_fr"]=>
  string(0) ""
  ["poids_fr_fr"]=>
  string(0) ""
  ["dimensions_fr_fr"]=>
  string(0) ""
  ["composition_fr_fr"]=>
  string(0) ""
  ["info_fr_fr"]=>
  string(0) ""
}
array(16) {
  ["image"]=>
  string(116) "http://www.mage.pro/modules/Cataloger/C ... g&ac=35039"
  ["image_src"]=>
  string(86) "http://www.mage.pro/uploads/images/cata ... _src_1.jpg"
  ["link"]=>
  string(77) "http://www.mage.pro/index.php?page=savo ... e&hl=fr_FR"
  ["title"]=>
  string(36) "Savon d'Alep Liquide pour la Lessive"
  ["alias"]=>
  string(29) "savon-liquide-pour-la-lessive"
  ["menutitle"]=>
  string(36) "Savon d'Alep Liquide pour la Lessive"
  ["modifieddate"]=>
  string(19) "2010-05-03 12:55:08"
  ["category"]=>
  string(29) "Savon d'Alep pour la Lessive "
  ["cat"]=>
  string(29) "Savon d'Alep pour la Lessive "
  ["createdate"]=>
  string(19) "2010-02-11 13:33:01"
  ["contenu_fr_fr"]=>
  string(0) ""
  ["ref_fr_fr"]=>
  string(8) "SAVLESS3"
  ["poids_fr_fr"]=>
  string(0) ""
  ["dimensions_fr_fr"]=>
  string(0) ""
  ["composition_fr_fr"]=>
  string(0) ""
  ["info_fr_fr"]=>
  string(0) ""
}
array(16) {
  ["image"]=>
  string(123) "http://www.mage.pro/modules/Cataloger/C ... g&ac=63238"
  ["image_src"]=>
  string(93) "http://www.mage.pro/uploads/images/cata ... _src_1.jpg"
  ["link"]=>
  string(84) "http://www.mage.pro/index.php?page=savo ... g&hl=fr_FR"
  ["title"]=>
  string(40) "Savon d'Alep pour Lessive en Copeaux 1kg"
  ["alias"]=>
  string(36) "savon-pour-la-lessive-en-copeaux-1kg"
  ["menutitle"]=>
  string(40) "Savon d'Alep pour Lessive en Copeaux 1kg"
  ["modifieddate"]=>
  string(19) "2010-05-03 12:44:39"
  ["category"]=>
  string(29) "Savon d'Alep pour la Lessive "
  ["cat"]=>
  string(29) "Savon d'Alep pour la Lessive "
  ["createdate"]=>
  string(19) "2010-02-11 13:37:46"
  ["contenu_fr_fr"]=>
  string(0) ""
  ["ref_fr_fr"]=>
  string(8) "SAVLESS1"
  ["poids_fr_fr"]=>
  string(3) "1kg"
  ["dimensions_fr_fr"]=>
  string(0) ""
  ["composition_fr_fr"]=>
  string(0) ""
  ["info_fr_fr"]=>
  string(0) ""
}
array(16) {
  ["image"]=>
  string(130) "http://www.mage.pro/modules/Cataloger/C ... g&ac=28150"
  ["image_src"]=>
  string(100) "http://www.mage.pro/uploads/images/cata ... _src_1.jpg"
  ["link"]=>
  string(91) "http://www.mage.pro/index.php?page=savo ... g&hl=fr_FR"
  ["title"]=>
  string(40) "Savon d'Alep pour Lessive en Copeaux 5kg"
  ["alias"]=>
  string(43) "savon-d-alep-pour-la-lessive-en-copeaux-5kg"
  ["menutitle"]=>
  string(40) "Savon d'Alep pour Lessive en Copeaux 5kg"
  ["modifieddate"]=>
  string(19) "2010-05-03 12:46:28"
  ["category"]=>
  string(29) "Savon d'Alep pour la Lessive "
  ["cat"]=>
  string(29) "Savon d'Alep pour la Lessive "
  ["createdate"]=>
  string(19) "2010-02-11 13:40:53"
  ["contenu_fr_fr"]=>
  string(213) "

Donne d'excellents résultats pour le linge blanc et de couleur, même à basse températures. Une lessive exceptionnelle pour toute la famille, spécialement recommandée pour les peaux les plus sensibles.
"
  ["ref_fr_fr"]=>
  string(8) "SAVLESS2"
  ["poids_fr_fr"]=>
  string(3) "5kg"
  ["dimensions_fr_fr"]=>
  string(0) ""
  ["composition_fr_fr"]=>
  string(0) ""
  ["info_fr_fr"]=>
  string(0) ""
}
Array
Peciura

Re: Problem variable writing

Post by Peciura »

You are using unusual language key 'fr_fr' - not 'fr_FR'.
I guess you have to rename fields in case sensitive manner  like 'dimensions_fr_FR'. But to make sure i have to see '/config.lang.php'.
If i knew all language keys in your site are in lower case i would suggest

Code: Select all

{assign var='tmp' value="dimensions_$lang"|lower}
{$items[numloop].$tmp}
I have not used Cataloger for a while , to make thing  clear to me post Cataloger template you are working on.
Locked

Return to “[locked] CMSMS MLE fork”