OllieMackJames Posted December 5, 2014 Share Posted December 5, 2014 I have added a field that will contain a URL that will then be used to link to a page. How can I access the insert link module from the input for this field. TinyMCE uses this inert link, that allows to chose from the internal pags or insert an external link. Thanks! Link to comment Share on other sites More sharing options...
adrian Posted December 5, 2014 Share Posted December 5, 2014 I would say you need two fields, one for internal PW pages - use a Page field with Deref in API set to: Single page (Page) or empty page (NullPage) when none selected and Inputfieldtype set to PageListSelect+ You can set the Parent of Selectable Pages to Home or any subbranch. For the external URL option, use the URL fieldtype so your editors can manually enter a URL. Then in your template code, check which one has a value and use that for the link. You may want to add a showif dependency so that as soon as one field has been populated, the other one is hidden. 1 Link to comment Share on other sites More sharing options...
OllieMackJames Posted December 5, 2014 Author Share Posted December 5, 2014 Thanks adrian, I just found out that what I want already is part of profields... ...one problem though, it links to the number of the page, in stead of the regular url, any ideas how to correct this. BTW, when clicked I get a 404, strange Link to comment Share on other sites More sharing options...
2hoch11 Posted February 16, 2022 Share Posted February 16, 2022 On 12/5/2014 at 5:09 PM, OllieMackJames said: Thanks adrian, I just found out that what I want already is part of profields... I am using ProFields but none of them opens an "Insert Link" modal box… I can remember I saw a module that does exactly that (url for internal or external pages, page select, target) but I can't find it anymore... Link to comment Share on other sites More sharing options...
adrian Posted February 16, 2022 Share Posted February 16, 2022 @2hoch11 - is this what you're looking for? https://github.com/adrianbj/processwire-fieldtype-assisted-url Link to comment Share on other sites More sharing options...
2hoch11 Posted February 16, 2022 Share Posted February 16, 2022 53 minutes ago, adrian said: @2hoch11 - is this what you're looking for? https://github.com/adrianbj/processwire-fieldtype-assisted-url …in theory yes, but it does not behave like shown here: Meaning: the chain-button does not open the modal box. I am wondering why istn't this included in processwire as a default "URL" field? Thanks, anyway. Link to comment Share on other sites More sharing options...
adrian Posted February 16, 2022 Share Posted February 16, 2022 12 minutes ago, 2hoch11 said: Meaning: the chain-button does not open the modal box. I just tested and it's working fine here. Can you take a look at the browser dev console to see if there are any JS errors? Link to comment Share on other sites More sharing options...
2hoch11 Posted February 16, 2022 Share Posted February 16, 2022 3 minutes ago, adrian said: I just tested and it's working fine here. Can you take a look at the browser dev console to see if there are any JS errors? As Kholja mentioned: it works only if there is a Texarea Field that uses CKEditor. And ideed, it works… but this dependency is strange… but not technically 1 Link to comment Share on other sites More sharing options...
adrian Posted February 16, 2022 Share Posted February 16, 2022 @2hoch11 - please try the latest commit - it should work now even if there is no CkEditor field on the template. 1 Link to comment Share on other sites More sharing options...
2hoch11 Posted February 21, 2022 Share Posted February 21, 2022 On 2/16/2022 at 6:53 PM, adrian said: @2hoch11 - please try the latest commit - it should work now even if there is no CkEditor field on the template. I installed what you posted: https://github.com/adrianbj/processwire-fieldtype-assisted-url The pw backend says it's the version 2.0.0 Link to comment Share on other sites More sharing options...
adrian Posted February 21, 2022 Share Posted February 21, 2022 1 hour ago, 2hoch11 said: The pw backend says it's the version 2.0.0 Does a modules > refresh help? Link to comment Share on other sites More sharing options...
2hoch11 Posted February 21, 2022 Share Posted February 21, 2022 5 minutes ago, adrian said: Does a modules > refresh help? If I'm opening the Module Update Page (/processwire/module/?reset=2) there ist nothing to update: On the module page, if I hit "Look for an update" the backend outputs: "That module is not currently tracked by the modules directory": Link to comment Share on other sites More sharing options...
adrian Posted February 21, 2022 Share Posted February 21, 2022 That's because my repo is a fork of the original and not in the modules directory - you need to install from Github. Does that help? Actually, I see that is what you installed. Not sure why it's reporting 2.0.0 still. I guess the key thing is it now working without a separate CkEditor field? Also, can you see the updated file (with those changes I committed) in the folder under site/modules ? Link to comment Share on other sites More sharing options...
2hoch11 Posted February 28, 2022 Share Posted February 28, 2022 @adrian now I replaced InputfieldAssistedURL.js and it seem to work… 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now