Skip to content

Instantly share code, notes, and snippets.

@sonicdoe
Created July 18, 2012 17:06
Show Gist options
  • Select an option

  • Save sonicdoe/3137493 to your computer and use it in GitHub Desktop.

Select an option

Save sonicdoe/3137493 to your computer and use it in GitHub Desktop.

Revisions

  1. SonicHedgehog created this gist Jul 18, 2012.
    62 changes: 62 additions & 0 deletions setup.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,62 @@
    config.tx_typogento {
    routes {
    10 {
    # Set the dispatch section
    section = dispatch

    # The default priority is 0
    priority = 1

    # The route will taken if the filter matches and the route has the
    # highest priority (see http://wiki.typo3.org/TSref/if)
    filter {
    # Match for a TYPO3 page with the id {$pid}
    value.data = TSFE:id
    equals = 3
    }

    # The resulting URL of this external typolink will be dispatched
    # to Magento (see http://wiki.typo3.org/TSref/typolink)
    target {
    # The dispatch section requires always external links
    parameter.cObject = TEXT
    parameter.cObject {
    # Targets the Magento product view
    wrap = mage:/catalog/product/view/id/|/
    data = GP:id // register:tx_typogento.content.id
    if.isTrue.data = GP:id // register:tx_typogento.content.id
    }
    # Also available for external links
    addQueryString = 1
    addQueryString.exclude = route,controller,action
    }
    }

    20 {
    # Set the render section
    section = render

    # The default priority is 0
    priority = 1

    # The route will taken if the filter match and the route has the
    # highest priority (see http://wiki.typo3.org/TSref/if)
    filter {
    # Match for all Magento URLs starting with '/catalog/product/'
    value.dataWrap = /{GP:route}/{GP:controller}/
    equals = /catalog/product/
    }

    # The resulting URL of this internal typolink will be rendered
    # on the TYPO3 frontend (see http://wiki.typo3.org/TSref/typolink)
    target {
    # Targets a TYPO3 page with the id {$pid}
    parameter = 3
    # Remove route path from the URL
    addQueryString = 1
    addQueryString.exclude = tx_typogento[route],tx_typogento[controller],tx_typogento[action]
    useCacheHash = 1
    }
    }
    }
    }