Hi,
sorry my fault. I inverted the parameters for strpos....
Maybe you like the idea. One HTMLText- field
and you can add a class ('additionalcolumn') to split it into two 'physical' columns.
Useful for me, cause the client has very short text mostly , which is aligned to center.
If he has a long text he can split it into two columns now by adding the class 'additionalcolumn' to the element which is on the 'splitpoint'.
Gives a much better visual experience for the visitor ;) Might be intersting for responsive proposals too...
public function getContent01(){
$string=$this->dbObject('Content')->Value;
$tagPos=strpos($string,'additionalcolumn');
if($tagPos){
$end=strrpos(substr($this->Content,0,$tagPos),'<',0);
return substr($this->Content,0,$end);
}else{
return $this->Content;
}
}
public function getContent02(){
$tagPos=strpos($this->Content,'additionalcolumn');
if($tagPos){
$start=strrpos(substr($this->Content,0,$tagPos),'<',0);
return substr($this->Content,$start);
}else{
return false;
}
}
In template you can ask for the getContent02 to decide if you want a one or two column layout...