weblog, content management & redaktion
RSS Feed für `Formatierung` Seite drucken

Fließtext über mehrere Spalten

Nachdem Sie einen Text geschrieben oder eingefügt haben können Sie diesen markieren und in der Formatselectbox 2 oder 3 Spalten auswählen. Dies funktioniert jedoch nur in der neuen Browsergeneration. Als Fallback wird in älteren Browsern der Text in herkömmlicher Form angezeigt.

 

Beispiele:

 

Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

 

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

 

Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.

 

Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

 

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

 

Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.

Darstellung von Quellcode im Inhalt

Durch die Integration des SyntaxHighlighter können Profis nun auch gut lesbaren Quellcode publizieren.

 

Hier einige Beispiele:

 

HTML:

  <div class="search">    
  <form action="?"
        method="get"
        name="sf2"
        onsubmit="return sendSearchForm(this);"  
        style="padding:0px">  
    <input name="q"  
           onKeyUp="getSuggestions(event, this)"  
           value="Suche"  
           onFocus="if(this.value=='Suche'){this.value=''}"  
           onBlur="showSuggestion('');if(this.value==''){this.value='Suche'}"  
           class="search_box c_border c_text c_textcolor c_content_background"/>  
  </form>  
</div>


CSS:

#edit_external{    
  position:fixed!important;  
  top:-1px!important;  
  left:50px!important;  
  display: block!important;  
  border:none!important;  
  z-index:5010!important;  
}  
.mceExternalClose{  
  display:none!important;    
}  
.mceToolbar{  
  background-color: transparent!important;    
}  
.mceIcon{  
  cursor:url(/img/edit.cur),default!important;  
}

 

Javascript:

///////////////////////////////////////////////////////////////////////////////////////////
// Formular per Ajax senden
function sendAjaxForm( form ){    
  data = getAjaxFormData(form);  
  AXSendForm = new ajaxObject("?action=save", callBackFunc );  
  AXSendForm.update(data,"post");  
  return false;  
}
///////////////////////////////////////////////////////////////////////////////////////////
// Formular auslesen und zu AjaxPostData zusammenfügen
function getAjaxFormData( form, data ){
  data = data || "";
  for(i=0; i<form.elements.length; i++){
    el = form.elements[i];
    if(el.type!=null) switch(el.type.toLowerCase()){
      case "hidden":  
      case "text":  
      case "password":  
      case "textarea":
      case "button":
        data += "&" + el.name + "=" + encodeURIComponent(el.value);
      break;
      case "radio":
      case "checkbox":
        data += (el.checked ? "&" + el.name + "=" + encodeURIComponent(el.value) : "");
      break;
      case "select":
      case "select-one": if(el.options.length>0) data += "&" + el.name + "=" + encodeURIComponent(el.options[el.selectedIndex].value); break;
      // TODO multiselect auswerten
    }
  }
  return data;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Ajax Object - cns version 2011
function ajaxObject(url, callbackFunction) {
  var that=this;
  this.updating = false;
  this.abort = function() {
    if (that.updating) {
      that.updating=false;
      that.AJAX.abort();
      that.AJAX=null;
    }
  }
  this.update =
  function(passData,postMethod) {
    if (that.updating) { return false; }
    that.AJAX = null;
    if (window.XMLHttpRequest) {
      that.AJAX=new XMLHttpRequest();
    }else{
      that.AJAX=new ActiveXObject("Microsoft.XMLHTTP");
    }
    if (that.AJAX==null) {
      return false;
    }else{
      that.AJAX.onreadystatechange = function() {
        if (that.AJAX.readyState==4) {
          that.updating=false;
          that.callback( that.AJAX.responseText, that.AJAX.status, that.AJAX.responseXML, that.AJAX.getAllResponseHeaders() );
          that.AJAX=null;
        }
      }
      that.updating = new Date();
      if (/post/i.test(postMethod)) {
        var uri=urlCall+(/\?/i.test(urlCall)?'&':'?')+'timestamp='+that.updating.getTime();
        that.AJAX.open("POST", uri, true);
        that.AJAX.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        that.AJAX.setRequestHeader("Content-Length", passData.length);
        that.AJAX.send(passData);
      }else{
        var uri=urlCall+(/\?/i.test(urlCall)?'&':'?')+passData+'&timestamp='+(that.updating.getTime());
        that.AJAX.open("GET", uri, true);
        that.AJAX.send(null);
      }
      return true;
    }
  }
  var urlCall = url;
  this.callback = callbackFunction || function () { };
}

PHP Code :

  function reorderArray( $arr, $order, $desc=false ){  
  if(count($arr)==0) return $arr;
  $keys = array_keys( $arr[0] );
  $z = 0; $tmp[0]='';
  $tmp = explode(",", ereg_replace("([ ]*)", "", $order));
  for( $f=0; $f<sizeOf( $tmp ); $f++ ){ $new_keys[$z] = $tmp[$f]; $z++; }
  for($f=0; $f<sizeOf($keys); $f++){
    if( !in_array( $keys[$f], $tmp ) ){ $new_keys[$z] = $keys[$f]; $z++; }
  }
  for($f=0; $f<sizeOf( $arr ); $f++){
    for($n=0; $n<sizeOf( $new_keys ); $n++) $arr_res[$f][$new_keys[$n]] = $arr[$f][$new_keys[$n]];
  }
  if( $desc ) rsort( $arr_res ); else sort( $arr_res );
  return $arr_res;
}

 

SQL:

  SELECT DISTINCT  
  pathid AS id,    
  tree_level,
  cat.title,
  cat.url,
  cat.stat,
  tree_sort
FROM
  ( SELECT
       pathid,
       @tree_level := IF(@last_tree_id = id, @tree_level +1, 1) AS tree_level,
       @last_tree_id := id AS id,
       @tree_sort := IF(@tree_level > 1, CONCAT(@tree_sort, '.', LPAD(pathrang, 4, 0)), LPAD(pathrang, 4, 0)) AS tree_sort
    FROM
      ( SELECT
            @rownum := @rownum+1 AS rownum,
            IF(@lastid <> mylist.id, @id := mylist.id, @id) AS pathid,
            IF(@lastid <> mylist.id, @rang := mylist.rang, @rang) AS pathrang,
            @lastid := mylist.id AS id,
            @id := (SELECT p_id FROM cat WHERE id = @id) AS parentID,
            @rang := (SELECT rang FROM cat WHERE id = @id) AS rang
            
            
        FROM
            (SELECT @id := 0, @lastid := 0, @rownum := 0, @rang := 0) AS vars,
            (SELECT id FROM cat) AS myloop,
            (SELECT id, rang FROM cat) AS mylist
      ) AS t,
      (SELECT @tree_sort := '', @last_tree_id := 0, @tree_level := 0) AS lvars
    WHERE
        pathid IS NOT NULL
    ORDER BY id, rownum DESC
  ) AS t1,
  cat
  WHERE cat.id = t1.pathid
ORDER BY tree_sort