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

URL in Link Element cannot be manipulated #227

Closed
Arcesilas opened this issue Jan 22, 2016 · 2 comments
Closed

URL in Link Element cannot be manipulated #227

Arcesilas opened this issue Jan 22, 2016 · 2 comments
Labels
bug Something isn't working right enhancement New functionality or behavior
Milestone

Comments

@Arcesilas
Copy link

Hi,

I figured out it is not possible to easily manipulate the URL in a Link Element.

All AbstractInline have a $data property which allows us to manipulate all the possible attributes we can imagine (I guess also any data-xxxxx attribute which is great) but URL is not stored in this property. Even when storing it in the $data array with a custom Document Processor, it will not be used. We need to define a custom Renderer, which will override the default LinkRenderer (which I don't want).

A solution could be to have the possibility to use multiple renderers for a given element as suggested in #35 (which seems to be solved with #222). Another solution could be to simply store the url in $data rather than in $url property so that it can simply be manipulated with a simple custom processor (seems best solution to me).

Maybe I missed something, then please let me know.

@Arcesilas
Copy link
Author

I've realized that Link and Image are both WebResources. First one's url is src whereas second's is href. I understand that it makes it easier to manipulate a single $url property, however I think it should be manipulated by storing it in $data. Or let AbstractWebResource have a public setUrl() method ?

@colinodell
Copy link
Member

I agree, this isn't very intuitive and makes customizing links difficult.

I think it should be manipulated by storing it in $data. Or let AbstractWebResource have a public setUrl() method ?

Both solutions seem equally valid. I'll review the codebase sometime to see which makes more sense and get that implemented for the next release :)

Thank you for bringing this up!

@colinodell colinodell added this to the 0.14.0 milestone Jan 22, 2016
@colinodell colinodell added bug Something isn't working right enhancement New functionality or behavior labels Jan 22, 2016
colinodell added a commit that referenced this issue May 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right enhancement New functionality or behavior
Projects
None yet
Development

No branches or pull requests

2 participants