Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-10 of 17 total  RSS 

Disable the RTE for fertenews

// description of your code here


### Javascript configuration for HTMLArea
### Change this in your typoscript template to reconfigure rte

plugin.tx_fertenews_pi1 {
 templateFile = {$plugin.tx_fertenews_pi1.file.template}
 newsTemplateFile = {$plugin.tt_news.file.templateFile}
 storagePID = {$plugin.tx_fertenews_pi1.storagePID}
 newsPID = {$plugin.tx_fertenews_pi1.newsPID}
 mailAdmin = {$plugin.tx_fertenews_pi1.mailAdmin}
 queuePublish = {$plugin.tx_fertenews_pi1.queuePublish}
}

### Allowing news to show tables and other html formating

plugin.tt_news.general_stdWrap.parseFunc.allowTags = b,i,u,a,img,br,div,center,pre,font,hr,sub,sup,p,strong,em,li,ul,ol,blockquote,strike,span,h1,h2,h3,h4,h5,h6,table,td,tr,tbody
plugin.tt_news.content_stdWrap.allowTags = b,i,u,a,img,br,div,center,pre,font,hr,sub,sup,p,strong,em,li,ul,ol,blockquote,strike,span,h1,h2,h3,h4,h5,h6,table,td,tr,tbody


Typo3 -> RealURL -> КраÑ?ивые урлы

// description of your code here

// insert code here..
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
	'init' => array(
		'enableCHashCache' => 1,
		'enableUrlDecodeCache' => 1,
		'enableUrlEncodeHash' => 1,
//		'postVarSet_failureMode' => 'redirect_goodUpperDir',
		),
	'rewrite' => array(
		),
	'preVars' => array(
		/*
		array(
			'GETvar' => 'L',
			'valueMap' => array(
				'de' => '0',
				'de' => '1',
				'valueDefault' => 'de',
				),
			),
		*/
		),
	'pagePath' => array(
		'type' => 'user',
		'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
		'spaceCharacter' => '-',
		'languageGetVar' => 'L',
		'expireDays' => 3,
		'segTitleFieldList' => 'tx_realurl_pathsegment,alias,uid',
		),
	'fileName' => array (
#		'defaultToHTMLsuffixOnPrev' => 1,
		'index' => array(
			'page.html' => array(
				'keyValues' => array (
					'type' => 1,
		        		),
				),
			),
		'print.html' => array(
			'keyValues' => array (
				'type' => 98,
				),
			),
		),
	'fixedPostVarSets' => array(
		),
	'postVarSets' => array(
		'_DEFAULT' => array(
			//archive
			'period' => array (
				array (
					'condPrevValue' => -1,
					'GETvar' => 'tx_ttnews[pS]',
					//'valueMap => array()
					),
				array (
					'GETvar' => 'tx_ttnews[pL]',
					//'valueMap => array()
					),
	  
				array (
					'GETvar' => 'tx_ttnews[arc]',
					'valueMap' => array(
						'non-archived' => -1,
						),
					),
	  			),
	  
			'browse' => array (
				array (
					'GETvar' => 'tx_ttnews[pointer]',
					),
				),
	  		'select' => array (
				array (
					'GETvar' => 'tx_ttnews[cat]',
					'lookUpTable' => array (
						'table'		=>	'tt_news_cat',
						'id_field'	=>	'uid',
						'alias_field'	=>	'title',
						'addWhereClause'=>	'AND NOT deleted',
						'useUniqueCache'=>	1,
						'useUniqueCache_conf'	=>	array (
							'strtolower'		=>	1,
							'spaceCharacter'	=>	'-',
							),
						),
					),
				),
	 		'article' => array( 
				array (
					'GETvar' => 'tx_ttnews[backPid]',
					// 'valueMap => array(
					// ),
					),
				array (
					'GETvar' => 'tx_ttnews[tt_news]',
					'lookUpTable' => array (
						'table'		=>	'tt_news',
						'id_field'	=>	'uid',
						'alias_field'	=>	'title',
						'maxLength'	=>	12,
						'addWhereClause'=>	'AND NOT deleted',
						'useUniqueCache'=>	1,
						'useUniqueCache_conf'	=>	array (
							'strtolower'		=>	1,
							'spaceCharacter'	=>	'-',
							),
						),
					),
				),
			),
		),  
	);

$TYPO3_CONF_VARS["FE"]["pageNotFound_handling"] = 'READFILE:fileadmin/templates/html/404.html';
$TYPO3_CONF_VARS["SYS"]["enable_DLOG"] = 'true';

Vertical Title

temp.menu = IMAGE
temp.menu { 
wrap = | 
file = GIFBUILDER 
file {
XY = 140,[20.h]+80
backColor = #EEEEEE
20 = TEXT
20 {
case = upper 
angle = 90
text.field = title
fontSize = 39,26
fontFile = fileadmin/fonts/xy.TTF
fontColor = #CCCCCC
offset = 80,[20.h]+60
}
} 
}

page.10 < temp.menu

Override settings only for print-template

put whatever you like to override inside the condition, 'alt_print' is the page-object of the print version.

[globalVar = GP:type = 98]
alt_print.10.marks.PAGETITLE.default.10.file.10.fontColor = #000000
#etc
[global]

Content Switch: show a message when no content on a page is inserted

temp.contentSwitch = COA
temp.contentSwitch {
 10 = TEXT
 10.value = <div class="error"><span class="bold">*No contentelements*</span>  on this page!</div>
 10.if.isFalse.numRows < styles.content.get
 20 < styles.content.get
}

# insert the right path to your template here (look in TSOB):

page.10.xy.subparts.content < temp.contentSwitch

Show some useful Page Infos

Note: to function properly insert the right ###markers### in your template.

# INFOBOX

temp.author = TEXT	
temp.author.data = page:author

temp.author_mail = TEXT
temp.author_mail.data = page:author_email

temp.crdate = TEXT
temp.crdate.data = page:crdate
temp.crdate.strftime = %d. %b, %Y
#temp.crdate.date = d. M, Y

temp.lastUpdate = TEXT
temp.lastUpdate.data = page:SYS_LASTCHANGED
temp.lastUpdate.strftime = %d. %b, %Y
#temp.lastUpdate.date = d. M, Y

styles.content.lastUpdate = TEXT
styles.content.lastUpdate {
  data = page:SYS_LASTCHANGED
  if.isTrue.data = page:SYS_LASTCHANGED
  date >
  wrap = <span class="text_b">Last update of this page:</span>&nbsp;|
  strftime = %d. %b, %Y
  data = register:SYS_LASTCHANGED
  if >
}

# Set the right path to your template here:

page.10.xy.marks.lastUpdate < temp.lastUpdate
page.10.xy.marks.author < temp.author
page.10.xy.marks.author_mail < temp.author_mail
page.10.xy.marks.crdate < temp.crdate

Automatic Pagetitle

Renders the current Pagetitle as a Gif File. Put it in your Template above the content.


# PAGETITLE

temp.title = IMAGE
temp.title.wrap = <h1>|</h1>
temp.title.file = GIFBUILDER
temp.title.file {
  XY = [10.w]+4, 23
  backColor = #F6F6F6
  10 = TEXT
  10 {
   text.data = page:subtitle // page:title
   fontSize = 18
   fontFile = fileadmin/template/fonts/THESASBP.TTF
   fontColor = #005277
   offset = 0,16
   align = left
   niceText = 1
  }
}

page.10 < temp.title

Site Path Navigation

Looks like this:

Home : About : Page1 : Page2

temp.nav_bc = HMENU
temp.nav_bc.special = rootline
temp.nav_bc.special.range = 1|8
#temp.nav_bc.excludeUidList = 177
temp.nav_bc.1 = TMENU
temp.nav_bc.1 {
  NO.linkWrap = |&nbsp;:&nbsp;|*||*| |
  NO.stdWrap.htmlSpecialChars = 1
  NO.stdWrap.field = nav_title // title
  CUR < NO
  CUR = 1
  #CUR.doNotLinkIt = 1
  CUR.stdWrap.htmlSpecialChars = 1
}

page.10 < temp.nav_bc

Subvnavigation with Lists (1 Level)

The current Level (one up) is shown above the subnavigation (temp.titleT)

# SUBNAVIGATION

temp.titleT = HMENU
temp.titleT.wrap = <div id="cur_level">|</div>
temp.titleT.special = rootline
temp.titleT.special.range = 1|1
temp.titleT.1 = TMENU
temp.titleT.1 {
  NO.wrap = <span>|</span>
}

temp.subnav = HMENU
temp.subnav.entryLevel = 1
temp.subnav.1 = TMENU
temp.subnav.1 {

  wrap = <ul> | </ul>
  NO.wrapItemAndSub = <li>|</li>
  NO.stdWrap.htmlSpecialChars = 1
  NO.ATagParams = | |*||*|class="last"|
  ACT < NO
  ACT = 1
  ACT.wrapItemAndSub = <li class="act">|</li>
  ACT.stdWrap.htmlSpecialChars = 1

}

temp.subnav_area = COA
temp.subnav_area.10 < temp.titleT
temp.subnav_area.20 < temp.subnav

page.10 < temp.subnav_area



Style it with CSS

/* 1.Level */
#subnav UL { padding:0; margin:0; list-style:none; border-top:5px solid #bcc2be;}
#subnav UL LI A { display:block; text-decoration:none; background:#e4e7e5; padding:4px 2px 4px 7px; width:100%; border-bottom:1px solid #FFF;}
HTML>BODY #subnav UL LI A  { width:auto;}
#subnav UL LI A:hover { background:#f1f3f2 url('bg_nav_arr.gif') no-repeat 152px 8px;}
#subnav UL LI.act A { background:#f1f3f2 url('bg_nav_arr.gif') no-repeat 152px 8px;}
#subnav UL LI A.last { border:0;} 



Suckerfish Navigation with Typoscript (2 Level)

# Suckerfish Navigation

temp.nav_main = HMENU
temp.nav_main.entryLevel = 0
#temp.nav_main.excludeUidList = 48
temp.nav_main.1 = TMENU
temp.nav_main.1 {
  expAll = 1
  wrap = <ul id="nav"> | </ul>
  NO.wrapItemAndSub = <li>|</li>||*||*|<li class="last">|</li>|
  NO.stdWrap.htmlSpecialChars = 1
  ACT < NO
  ACT = 1
  ACT.wrapItemAndSub = <li class="act">|</li>||*||*|<li class="act last">|</li>|
  ACT.stdWrap.htmlSpecialChars = 1
}

temp.nav_main.2 < temp.nav_main.1
temp.nav_main.2 {
  wrap = <ul> | </ul>
  NO.ATagParams =
  ACT.wrapItemAndSub = <li class="act2">|</li>
}

page.10 < temp.nav_main



Note:
For windows IE include the following Javascript Snippet on your page:

// patch IE's :hover & :focus problems with tags other than <a>

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			sel = document.getElementsByTagName("select");
			for (var i=0; i<sel.length; i++) {
				sel[i].style.visibility = 'hidden';	
			}
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			sel = document.getElementsByTagName("select");
			for (var i=0; i<sel.length; i++) {
				sel[i].style.visibility = 'visible';	
			}
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
	
}
// only win:
if (window.attachEvent) window.attachEvent("onload", sfHover);



Style it with CSS:

/* 1. Level */
#nav, #nav UL { padding:0; margin:0; list-style:none;}
#nav LI { float:left; padding:5px 21px 3px 21px; background:#3477b5; border-top:5px solid #1b5e96; border-bottom:4px solid #3477b5;}
#nav LI.last { background-image:0;}
#nav LI A { display:block; color:#FFF; text-transform:uppercase; font-size:10px; font-weight:bold; letter-spacing:1px;}
#nav LI:hover , #nav LI.sfhover { background:0; background:#1b5e96; border-top-color:#1b5e96; border-bottom-color:#1b5e96;}
#nav LI.act { background:0; background-color:#e4e7e5; border-top-color:#e4e7e5; border-bottom-color:#e4e7e5;}
#nav LI.act A { color:#1b5e96;}

/* 2. Level */
#nav LI UL { position:absolute; width:20em; left:-999em; margin:7px 0 0 -21px;}
HTML>BODY #nav LI UL { margin-left:0px;}
#nav LI UL LI { width:15em; background:#FFF; border:1px solid #E0E1DB; border-width:0 1px 1px 1px; padding:0 0 0 7px;}
#nav LI:hover UL LI A, #nav LI.sfhover UL LI A { text-transform:none; letter-spacing:normal; font-weight:normal; color:#1b5e96; padding:4px 2px 4px 2px;}
#nav LI UL LI:hover, #nav LI UL LI.sfhover  { background:#f1f3f2 url('bg_nav_arrt.gif') no-repeat right 8px; border-bottom-color:#E0E1DB;}
#nav LI UL LI.act2 { background-color:#f1f3f2;}

#nav LI:hover UL, #nav LI.sfhover UL { left:auto;}
#nav A { text-decoration:none;}
#nav A:hover { text-decoration:none;}



« Newer Snippets
Older Snippets »
Showing 1-10 of 17 total  RSS