ich möchte eine linkliste mit dem con_type "CMS_LINKEDIT[x]" erzeugen.
ziel - der redakteur soll einfach in der konfiguration des artikels z.b. 3 eingeben und dann im editor 3 mal untereinander
headline eingeben
link definieren
können. dazu habe ich ein modul mit nachfolgendem input-/outputcode angelegt. das problem ist nun, das wie immer auch ich die contypes im output ansprechen will, es funktioniert nur solange dort hardcodiert z.b. 1 steht (siehe unten)
will ich aber z.b. CMS_LINKEDIT[1] mit CMS_LINKEDIT[$i], CMS_LINKEDIT[".$i."], CMS_LINKEDIT[\"$i\"] ansprechen funktioniert es nicht

wie kann ich bitte CMS_LINKEDIT[x] -> x eine variable in einer schleife zuweisen?
input:
Code: Alles auswählen
?><table>
<tr>
<td><?php echo mi18n("Anzahl der Links:");?></td>
<td><input type="text" name="<?php echo "CMS_VAR[1]";?>" value="<?php echo "CMS_VALUE[1]"; ?>"></td>
</tr>
</table>
<?php
Code: Alles auswählen
<?php
$a = "CMS_VALUE[1]";
$i = 1;
$editmode = false;
if($contenido&&($view=="edit")){
$editmode = true;
}
while ($i <= $a){
echo "CMS_LINKEDIT[1]<br/>";
if (!editmode) {
echo "<b>".strip_tags("CMS_HTMLHEAD[1]")."</b>";
} else {
echo "<b>"."CMS_HTMLHEAD[1]"."</b>";
}
echo "<a target=\"CMS_LINKTARGET[1]\" href=\"CMS_LINK[1]\" title=\"CMS_LINKTITLE[1]\">CMS_LINKTITLE[1]</a><br/>";
$i++;
}
?>