Jump to content

Recommended Posts

Posted

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!

Posted

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. 

  • Like 1
Posted

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

  • 7 years later...
Posted
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...

Posted
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?

Posted
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

  • Like 1
Posted
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:

image.thumb.png.48d92042c203c702535af9f610d07ea1.png

On the module page, if I hit "Look for an update" the backend outputs: "That module is not currently tracked by the modules directory":

image.thumb.png.fc4234a23ecc9480c5d389251557c1d5.png

Posted

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 ?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...