For my mobile website builder I would like to change the positioning of my icons. Basically meaning that every navigation button comes with a page title and an icon I can select. Currently the icons are displayed on the left side of the page titles, while I would like them positioned on the right side.
Original code
if($page->buttonicon){
$icon = "<img src=\"icons/".$page->buttonicon."\" style=\"position:relative; top:33px\">";
}
else{
$icon = "<img src=\"images/noicon.png\" style=\"position:relative; top:33px\">";
}
$menurow = "<li id=row_".$page->id." style=\"display:$rstyle\">$icon<a class=\"".$bs."\" href=\"".trim($page->url)."\" $target >".$page->title."</a></li>\n";
I've played around with it a bit leading to some change, but although I'm getting there - I'm missing something I can't seem to get solved.
Current outcome and desired outcome
[ATTACH]4991[/ATTACH]
Edited code
<?php
if($page->buttonicon){
$icon = '<img src="icons/'.$page->buttonicon.'" style="float:right;margin-top:33px">';
}
else{
$icon = '<img src="images/noicon.png" style="float:right;margin-top:33px">';
}
$menurow = '<li id="row_'.$page->id.'" style="display:'.$rstyle.'">'.$icon.'<a class="'.$bs.'" href="'.trim($page->url).'" style="float:left;" '.$target.'>'.$page->title.'</a></li>';
?>
Outcome edited code
[ATTACH]4993[/ATTACH]
Looks like I'm getting there. Can someone help me out with the correct code? 😕
I'm just a beginner so any help is more than welcome! Many thanks in advance! 😃
icon-positioning.png
icon-positioning-updated2.0.png