0

In Neos default NodeTypes.I tried to add link. It works only for external links and If i need to add link to internal page or other image in popup.I dont see any option in NodeTypes.image.

How should i add link to page or other image ?

Any Suggestions ?

Punith
  • 21
  • 6

1 Answers1

0

I know it's old question, but I had same problem and this is how it can be solved:

  1. Create your own image node type in your site/plugin and add TYPO3.Neos.NodeTypes:Image under SuperTypes to have properties already defined there.

    'My.Awsome.Plugin:LinkedImage':
      superTypes: ['TYPO3.Neos.NodeTypes:Image']
    
  2. To link internal documents (pages) you can add property of type reference to your My.Awsome.Plugin:LinkedImage (take a look at TYPO3.Neos:Shortcut definition)

        linkToDocument:
          type: reference
          ui:
            label: 'Select document to link'
    
  3. If you want also link to assets this way, take a look at insert link in aloha editor - it combines assets and documents - so there are two calls (/neos/service/nodes and /neos/service/asset with proper search term). To have link to asset or to combine both of them you need to create new editor for inspector. Take a look at TYPO3.Neos/Resources/Public/JavaScript/Content/Inspector/Editors/ReferenceEditor.js - for assets it will be copy paste with nodesEndpoint action changed to assetAction. Last thing is, that to have editor defined from your own package working, you need to add to main Settings yaml this:

        userInterface:
          requireJsPathMapping:
            'My.Awsome.Plugin/Inspector/Editors': 'resource://My.Awsome.Plugin/Public/JavaScript/Content/Inspector/Editors'
    

and for property linkToAsset in NodeTypes.yaml, set editor under inspector like that

    editor: 'My.Awsome.Plugin/Inspector/Editors/AssetReferenceEditor'
  1. To handle showing it in popup, just adjust html for your node type template and use javascript.
k.tarkin
  • 726
  • 3
  • 9