Hallo allerseits,
Seit heute haben kann man hier im Forum Code posten dessen Syntax gehighlightet werden kann.
Hier ine paar kleine Beispiele mit erläuterung wie man hier code posten kann.
Um Code zu posten muss man
Tags im Html des Beitrags einbinden. Ihr könnt also zum einen den HTML Button vom WYSIWYG benutzen, oder ihr geht unten links auf “Disable rich-text”
Für Um die Syntax gehighlightet zu bekommen folge Code Tag nutzen:
[code type="html"]
…CODE KOPIEREN UND HIER EINFÜGEN…
Verfügbare Types
[ul]
[li] html[/li]
[li] javascript[/li]
[li] perl[/li]
[li] php[/li]
[li] python[/li]
[li] smarty[/li]
[li] sql[/li]
[li] xml[/ul][/li]Hier ein paar Beispiele
Ein kleines Beispiel mit HTML Syntax Highlighting aus der _left.tpl
[code type=“html”] …
[code type=“html”]
[{ oxmultilang ident=“INC_LEFTITEM_PARTNERANDSEAL” }]
[{include file="inc/trustedshops_item.tpl"}]
[](http://www.zend.com)
[{oxscript add="oxid.blank('link.zendSite');"}]
Ein kleines Beispiel mit Smarty Syntax Highlighting aus der _left.tpl
[code type=“smarty”] …
[code type=“smarty”]
[{ oxmultilang ident=“INC_LEFTITEM_PRODUCTSEARCH” }]
[{ $oViewConf->getHiddenSid() }]
[{if $oView->getSearchCatTree() }]
isAutoSearchOnCat() }]onchange="oxid.search('f.search','f.search.param');"[{/if}]>
[{ oxmultilang ident="INC_SEARCHLEFTITEM_ALLCATEGORIES" }]
[{include file="inc/category_options.tpl" tree=$oView->getSearchCatTree() sSpacer=""}]
[{/if}]
[{if $oView->getVendorlist() }]
[{ oxmultilang ident="INC_SEARCHLEFTITEM_ALLMANUFACTURERS" }]
[{foreach from=$oView->getVendorlist() item=oVendorlistentry}]
oxvendor__oxid->value}] selected[{/if}]>[{ $oVendorlistentry->oxvendor__oxtitle->value }][{ if $oVendorlistentry->getNrOfArticles() > 0 }] ([{$oVendorlistentry->getNrOfArticles()}])[{/if}]
[{/foreach}]
[{/if}]
Ein kleines Beispiel in PHP aus der oxarticles.php
[code type=“php”] …
[code type=“php”]
/**
* Checks if article has visible status. Returns TRUE if its visible
*
* @return bool
*/
public function isVisible()
{
// admin preview mode
$myConfig = $this->getConfig();
if ( oxConfig::getParameter( 'preview' ) == 1) {
return true;
}
// active ?
$sNow = date('Y-m-d H:i:s');
if ( !$this->oxarticles__oxactive->value &&
( $this->oxarticles__oxactivefrom->value > $sNow ||
$this->oxarticles__oxactiveto->value getConfigParam( 'blUseStock' ) && $this->oxarticles__oxstockflag->value == 2 &&
( $this->oxarticles__oxstock->value + $this->oxarticles__oxvarstock->value )
Ich hoffe Ihr mögt das neue Feature
Viele Grüße
Lars Sobanski
Web Developer, technisches Marketing