Search code examples
typo3typoscriptmarkers

typoscript dynamic link parameter


i try to get a page title in a parameter for a link like:

index.php?id=1&mainsite=development

the "development" is the page title

i've try it with:

[EDIT]

50 = TEXT
    50.value = get involved
    50.typolink{
        parameter = 28
        parameter.data = #you need something else than the title here
        additionalParams.dataWrap = &mainsite={GP:type}
        additionalParams.if.isTrue.data = GP:type
        useCacheHash = 1
        ATagParams = class='btn btn-primary btn1'
    }

from Add parameter to link in typoscript

This call is in an COA and the link should become different GET params with name &type=get_involved or &type=realize. i thought, i take the title or subtitle for that.

How can i realize dynamic params in Typoscript ?

Thanks,

ShaoKhan


Solution

  • my solution if anyone need it:

    50 = TEXT
        50.value = get involved
        50.typolink{
          parameter = 28
          additionalParams.rawUrlEncode = 1
          additionalParams.data = field:header
          additionalParams.wrap = &type= |
          ATagParams = class='btn btn-primary btn1'
        }
    

    it creates a link to page 28 and puts the GET param &type= at the end the wrap contains the header of a part of the content

    The link looks like this:

    http://localhost/index.php?id=28&type=dread_disease
    

    hope it'll help. _problem solved_