Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fields lost in link generation #50

Open
webian opened this issue Apr 4, 2017 · 5 comments
Open

Fields lost in link generation #50

webian opened this issue Apr 4, 2017 · 5 comments

Comments

@webian
Copy link
Contributor

webian commented Apr 4, 2017

Hi @cobwebch,
I use this in Fluid

<f:cObject typoscriptObjectPath="lib.link"
           data="{
                text: ' ',
                link: '{tile.link}',
                class: 'expandAndCenter tile-link tile-image lazyload {tileImageClass}',
                style: 'background-image: url(\'/{imgPlaceholderUri}\')',
                data-src: '{imgUri}'
                }" />

and this is the lib.link Typoscript

lib.link = COA
lib.link {
    10 = TEXT
    10 {
        field = text
        typolink {
            mergeWithLinkhandlerConfiguration = 1
            parameter = {field:link}
            parameter.insertData = 1
            ATagParams = class="{field:class}" style="{field:style}" data-src="{field:data-src}"
            ATagParams.insertData = 1
        }
    }
}

The problem is that all the fields, like {field:class}, are lost in the generation of the url by linkhandler that returns only url.

I'm still trying to make a patch but actually I'm stuck.

@fsuter
Copy link
Contributor

fsuter commented Apr 4, 2017

The linkhandler feature has been integrated into upcoming TYPO3 v8. As such I don't plan any more work on this extension. Sorry. I hope you can find a solution to your issue.

@webian
Copy link
Contributor Author

webian commented Apr 4, 2017

Understood, np :)

Anyway, I found that the problem is that when linkhandler calls typolink to generate the link, the stdWrap's insertData function has $this->data set to the record data and no more set to the fluid data.

Do you know if this issue could be present in v8 too?

@fsuter
Copy link
Contributor

fsuter commented Apr 4, 2017

It may well be. I understand your need, but having the data from the record loaded into $this->data is critical so that you can assemble links, for example using the "uid" of the record.

@webian
Copy link
Contributor Author

webian commented Apr 4, 2017

I see and I created a WIP patch whose concept maybe useful in v8 (I don't know if it's you that worked on linkandler feature in v8).
The problem of this patch is that parent data could overwrite record data. A solution of this could be to append a string like 'linkhandler-' to parent data keys and to the respective usages in the config. Or simply warn the user of the extension/feature.

@fsuter
Copy link
Contributor

fsuter commented Apr 4, 2017

Thanks for the proposal. Some kind of namespacing would indeed be useful IMO.

I guess the next is to test the issue with TYPO3 v8 and open a bug report for the Core if the problem is verified there too. You could point to this discussion and your suggested patch for reference.

Haco added a commit to Haco/linkhandler that referenced this issue Jul 26, 2018
[BUGFIX] Merge parent data with record data, fixes cobwebch#50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants