Search

Results for: TypoScript

Klaus Weidenbach
8 years ago from Hubzilla
Configuring Suggest Wizard through TSconfig
Even after years working with #TYPO3 I am still impressed by the amazing and powerful configuration possibilities with #TypoScript. Just discovered a very elegant way how to configure the behaviour of the quick search fields in the backend when you want to link another content element.
On one page I want to change the behaviour of this quick search for a specific field in a content element and limit the results that can be searched.

To be concrete in calendar (extension: cal) event content elements (table: tx_cal_event) I want to limit the results that are available as locations for this event (field: location_id) which are queried from the table tt_address. I only want to get results that have set the field tx_cal_controller_islocation in the table tt_address. Of course you could edit the $TCA (Table Configuration Array) of tx_cal_event and change the definition of the suggest wizard globally, but there is a much more flexible and elegant way.

Just put this TSconfig in a PageTS or UserTS depending how you want this behaviour to be deployed, for example for a group of users only or a specific page only.
# Limit Location Suggest Wizard to cal-islocation addresses
TCEFORM.tx_cal_event.location_id.suggest.tt_address.searchCondition = tx_cal_controller_islocation=1



Wizards Configuration — Suggest wizard — TCA Reference 7.6 documentation


This renders an input field next to the selector of group-type fields (when internal_type is db) or of select-type fields (using foreign_table). After the user has typed at least 2 (minimumCharacters) characters in this field, a search will start and show a list of records matching the search word. The "suggest" wizard's properties can be configured directly in TCA or in page TSconfig (see TCEFORM properties).


TCEFORM ->TCEFORM_suggest — TSconfig Reference 8-dev documentation


Each level of the configuration overwrites the values of the level below it:
"suggest.default" is overwritten by "suggest.[queryTable]".
Both are overwritten by "[table name].[field].suggest.default" which itself is overwritten by "[table name].[field].suggest.[queryTable]"
suggest.default:
Configuration for all suggest wizards in all tables
suggest.[queryTable]:
Configuration for all suggest wizards from all tables listing records from table
[queryTable][table name].[field].suggest.default
Configuration for the suggest wizard for field [field]in table [table name]
[table name].[field].suggest.
[queryTable]Configuration for the suggest wizard for field [field]in table [table name] listing records from [queryTable]
Klaus Weidenbach
12 years ago
Naja, diese einfachen TypoScript-Snippets für Canonical-URLs haben alle so ihre Tücken und sind nicht wirklich ganz so zuverlässig. Interessant sind in diesem Blogeintrag auch die Kommentare.

@TYPO3

♲ Thomas Löffler
SEO: Canonical URLs für eindeutige Seitenmarkierung
Im TYPO3 gibt es verschiedene Wege, eine Seite mit Inhalten über die URL-Eingabe anzuzeigen.

Zum Beispiel gibt uns die Seite http://www.domain.tld/index.php?id=39 die selben Inhalte wie http://www.domain.tld/ich-liebe-canonical-urls.html oder auch http://www.domain.tld/ich-liebe-canonical-urls/.

Die Suchmaschine bekommt alle 3 Links und verwaltet diese als 3 verschiedene Seiten. Da die Seite aber die selben Inhalte haben, straft die Suchmaschine die Seite(n) wegen Duplicate Content ab.

Hilfe bekommt man durch einen kleine Zeile im Header der Seite, dem Canonical Tag.
Im TYPO3 gibt man an, welche URL nun die richtige ist und setzt sie in diesen Canonical Tag. Somit weiß die Suchmaschine auch beim Besuch der “anderen” zwei Seiten, dass die wirklich richtige Seite unter der URL im Canonical Tag erreichbar ist.

Schwierig wird dieses Unterfangen, wenn es weitere Parameter in der URL gibt, die z.B. tt_news und andere Extensions benötigen. Man braucht einige Parameter, aber beileibe nicht alle. Im Beispiel tt_news ist der Parameter backPid z.B. unnötig, da er die Inhalte nicht wesentlich beeinflußt.

Da die Extension “canonical” unter der 4.6.8 nicht mehr funktioniert, habe ich mir ein TypoScript-Schnipsel aufgebaut, welches die meisten meiner Fälle abdeckt. Natürlich muss dieses Schnipsel je nach Anforderung angepasst werden, doch das meiste dürfte überall passen:

page.headerData.778 = TEXT
# Aktuelle Seite
page.headerData.778.typolink.parameter.data = TSFE:id
# Gib nur die URL zurück
page.headerData.778.typolink.returnLast = url
# Erstelle eine absolute URL
page.headerData.778.typolink.forceAbsoluteUrl = 1
# Fügt alle GET-Parameter hinzu, wie z.B. tt_news, L und auch cHash
page.headerData.778.typolink.addQueryString = 1
page.headerData.778.typolink.addQueryString.method = GET
# Schliesst bestimmte Parameter aus, z.B. cHash oder auch backPid von tt_news
page.headerData.778.typolink.addQueryString.exclude = cHash,backPid
# Wrappen und mit dem richtigen Tag einbinden.
# Das Leerzeichen nach dem öffnenden Tag bitte entfernen
page.headerData.778.wrap = < link rel="canonical" href="|" />

Ich hoffe, einige können damit etwas anfangen.
Das TypoScript ist natürlich nicht die eierlegende Wollmilchsau für jede Seite, sondern fordert besonders beim Parameter exclude noch Nacharbeit.
Diese kann übrigens darunter einfach mit folgendem Snippet bearbeitet werden.

page.headerData.778.typolink.addQueryString.exclude := addToList(extParam1, extParam2)

------------------------------------------------------
Dies ist ein Post vom TYPO3 Blog typo3blogger.de!
Klaus Weidenbach
12 years ago
TYPO3 4.7 released
The new features sound really amazing. #HTML5, web accessibility, RTE improvements, some new ways how to do things with #TypoScript, indexed_search works now on MySQL full text index, ...


TYPO3 4.7 Release Notes - typo3.org


This release of TYPO3 is the last version in the TYPO3 version 4 branch, before continuing the development of TYPO3 6.0. This TYPO3 4.7 release is focused on a standards and cleaner, accessible and valid frontend rendering out of the box. You will...

Image/photo
There will also be Release Parties: http://wiki.typo3.org/Release_Party/TYPO3_4.7

#TYPO3FOUR7
Categories: Release [remove]
Klaus Weidenbach
11 years ago
cal and semantic events
Played around with #cal and some #html5 and #microformats today. By default cal seems to have basic support for #hCalendar. I tried to extend it a bit and also add http://schema.org/Event declarations.
I don't know what this will be actually good for or if it is useful at all. Right now just playing bit around. Still quite buggy, not finished yet and also much space for optimisations still.

How do you add semantic to your events?

Heres some #TypoScript:
# configure single event view
plugin.tx_cal_controller.view.event.event {
  # Event title is displayed as page title and outside of the event declaration, so add it as meta-tag
  title.dataWrap = <meta itemprop="name" content="|">
  # declare image itemprop
  image.stdWrap.dataWrap = |
  image.1.params = itemprop="image"
  # this declaration is done in template because always visible
  startdate.dataWrap = |
  # wrap in HTML5 time-tag
  enddate {
    dataWrap = |</time>
    prepend = TEXT
    prepend.dataWrap = <time datetime="|" itemprop="endDate" class="dtend">
    prepend.field = end
    prepend.strftime = %Y%m%dT%H%M00
  }
  # TODO this should be visible if enddate is not visible
  microformat_enddate = TEXT
  microformat_enddate {
    field = end
    strftime = %Y%m%dT%H%M00
    dataWrap = <meta itemprop="endDate" content="|">
  }
  starttime.dataWrap =  |
  endtime.dataWrap = -| Uhr
  # The location of the event, could be much more extended by tt_address data like geo coordinates, etc.
  location.dataWrap = <div class="cal_loc" itemprop="location" itemscope itemtype="http://schema.org/Place">%%%LOCATION%%%:&nbsp;<span itemprop="name" class="location">|</span></div>
  # only hCalendar
  category_link.dataWrap = <div class="cal_cat">%%%CATEGORY%%%:&nbsp;<span class="category">|</span></div>
  # should be class 'description', but need to assign 'summary' to the title because summary is required by hCalendar
  description.dataWrap = <div class="summary">|</div>
  # MICROFORMAT_START does exist, also add MICROFORMAT_END
  microformat_end = TEXT
  microformat_end {
    field = end
    strftime = %Y%m%dT%H%M00
  }
}

In the event_model.tmpl I add a little bit:
<!--###TEMPLATE PHPICALENDAR EVENT### begin -->
<!--phpicalendar_event.tmpl-->
<div class="vevent" itemscope itemtype="http://schema.org/Event">
###TITLE###
###IMAGE###
###CATEGORY LINK###
###MICROFORMAT ENDDATE###
<time datetime="###MICROFORMAT START###" itemprop="startDate" class="dtstart">###STARTDATE###&lt;/time>###ENDDATE######STARTTIME######ENDTIME###
###LOCATION###
###DESCRIPTION###
</div>
<!--/phpicalendar_event.tmpl-->
<!--###TEMPLATE PHPICALENDAR EVENT### end -->
newer older