Jump to content

Module: FieldtypeAssistedURL


wumbo

Recommended Posts

  • 1 month later...

Hi all,

I see that @wumbo mentioned that the 'Link Attributes' where specifically removed from the modal which pops up.

However is it possible to enable the 'Link Attributes' tab for this field type, seems like it would be very useful for my current project.

 

Link to comment
Share on other sites

  • 5 months later...

@adrian

Hi Adrian, 

I know you have done the latest version of this module. I'm having a few issues using your folk on 3.0, not entirely sure if it's me. 

1. You mentioned that it sets a sleep value of the page ID, so if the URL is to ever change it will be update. This doesn't seem to be working at all. I can set it to a local url but it does not update if I change the url.
2. It doesn't seem to store ID's at all on a local install. 

I think both of the above is because it's installed on a folder: I mean the domain is http://dev.agency.com/client - so the url is /client/link/to/page and exactly why I need 1 or 2 for when it goes live. 

I'm going to do a folk and fix that. Let me know if you want to merge. 

  • Like 1
Link to comment
Share on other sites

  • 10 months later...

Hi,

Wondering if anyone can advise on the following 2 use cases for site running at https://example.com (so $config->httpHosts array in config.php contains example.com)

  1. Want to create link to https://subdomain.example.com however cannot do this as example.com is present and so looks for an internal link
  2. Want to create a mailto link such as mailto:user@example.com however cannot do this.

Changing the site to run at www.example.com solves (1) but does not solve (2).

Thanks in advance for any advice.

 

Link to comment
Share on other sites

  • 5 months later...
On 2/19/2018 at 9:33 PM, adrian said:

Well, I am using this field for the first time and really wanted this functionality, so decided to fork the module here: 
https://github.com/adrianbj/processwire-fieldtype-assisted-url

It doesn't look any different from the users perspective, but on save/sleep it stores the page ID instead of the url and then on wakeup it converts to ID back to the URL.

This means that you can now move a page to a different parent, rename it, etc and the link URL will be automatically updated. 

It doesn't look like @wumbo is still active around here, so not sure if this will make it into the main version of the module, but it's there if others want it.

Hi @adrian I've downloaded the most up to date files from your branch and have overwritten the original module files in a site I am working on.  I've refreshed the modules in the admin too, but I just can't get the urls to update if a page is moved or its url is changed. Do you know if I am missing something really simple? I thought it may have been because I am trying to do this retrospectively to existing assisted url field but I tried creating a new field and the problem still persists. Any help of advice would be greatly appreciated.

Thanks
Dave

Link to comment
Share on other sites

@999design - Hi Dave,

I just tested to make sure everything was still good, and it is here.

Can you please take a look in the DB to confirm it's storing the page ID, eg:

image.png.d0696d137de1331c38737cceb420db50.png

Just to clarify, this won't work on old stored data - it's only for links added since this version has been running.

 

Link to comment
Share on other sites

Any chance your running procache or there is some other caching going on?

Are you looking at the link that is being output on the frontend, or in the admin within the field where it displays the relative URL?

Perhaps you can debug at what point things are not working within the logic in the module?

Link to comment
Share on other sites

I've been checking on the front end and in the admin. Have also tried on an incognito window but no joy. I don't have caching set on the pages either.

I'll try to have a look through the module and see what I can find.

Thanks for the quick replies, much appreciated.

Link to comment
Share on other sites

  • 4 weeks later...

Apologies for the delayed reply. Was working on a deadline when I raised this issue and completely forgot to leave an update.

It suddenly began to work and I'm not quite sure why but I suspect that it was a caching thing, or maybe as you suggested regarding only updating new entries. It's filtered through all the links using this now that were previously not updating so I'm happy either way ?

Thanks for all your help here @adrian.

  • Like 1
Link to comment
Share on other sites

Converting relative URLs to page IDs doesn't seem to work if there is more than 1 URL segment (/page1/subpage/) AND the application is NOT running in a subdirectory.

I had to replace line 86 from FieldtypeAssistedURL.module

$urlPage = "/" . str_replace($this->wire('config')->urls->root, "", $urlParts[0]);

with

if($this->wire('config')->urls->root !== '/') {
	$urlPage = "/" . str_replace($this->wire('config')->urls->root, "", $urlParts[0]);
} else {
	$urlPage = $urlParts[0];
}

to make it work.

Am I missing something? 

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

I know this was asked before but I still don't fully understand, why does this module open a popup with a tab where you can select the target, if it doesn't do anything? I handed over a CMS using this field to a third party and they tried to use target="_blank" from the attributes tab of this field all over the site and were surprised when it did nothing. Wouldn't it be better if this module stored an object with these bits in, returning the link by default? Either that or at least drop the attributes tab from the popup if it doesn't do anything.

Link to comment
Share on other sites

In case anyone stumbles upon this JavaScript error when clicking the Link-Button:

ProcessWire.config.InputfieldCKEditor is undefined

Workaround is to provide another field which uses the CKEditor (i.e. body field) in your template.

Link to comment
Share on other sites

  • 4 months later...

Hi,

The module works well so far but I have just found that it is not working when it is place in the home template. I get the following error message in the browser console.

Uncaught TypeError: ProcessWire.config.InputfieldCKEditor is undefined

I tried to place the field to other template and it works normally.

Any hints??

Gideon

Link to comment
Share on other sites

  • 4 months later...
  • 1 year later...
  • 1 month later...

Hi @adrian,

i use your fork quite a lot (always wondering why this isn't a core feature). Latest version installed.

Now i stumble across a strange behaviour which left me a bit confused: When i insert a mail link in the modal window URL field one particular E-Mail address is truncated after saving (s.below) constantly.

While this addresses are get saved flawlessly :

- info@olafgleba.de
- info@olaf-gleba.de
- info@olaf-gleba-nature.de
- info@olaf-for-nature.de
- info@gourmetsfor-nature.de
- info@gourmets-fornature.de
- info@nature-for-gourmets.de
- and many other tested addresses...

This E-Mail address (and only this one) will not:

- info@gourmets-for-nature.de

It gets truncated to info@

I have not much hope you can help me with that (especially because simular address patterns (s. above) has no problem at all). But, mabye you or someone sees something i don't ?

Thx and regards, Olaf

 

 

 

 

Link to comment
Share on other sites

  • 5 weeks later...

Hi @adrian,

while multilingual internal links works quite well, if i add an anchor to the url, the url remains on the default language. I tried to adapt the module in my local playground (hoping to be able to give some input), but til now no luck.

Internal page link (when on DE site):
/kontakt/

Internal page link (when on EN site):
/en/contact/

Internal page link (when on DE site):
/kontakt/#anchor

Internal page link (when on EN site):
/kontakt/#anchor

Should be: /en/contact/#anchor

 

Link to comment
Share on other sites

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
×
×
  • Create New...