Jump to content

Module: FieldtypeAssistedURL


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...


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...


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: 

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.


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:


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]);


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...


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


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
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Similar Content

    • By MarkE
      This fieldtype and inputfield bundle was built for storing measurement values within a field, rendering them in a variety of formats and converting them to other units or otherwise modifying them via the API.
      The API consists of a number of predefined functions, some of which include...
      render() for rendering the measurement object, valueAs() for converting the value to another unit value, convertTo() for converting the whole measurement object to different units, and add() and subtract() for for modifying the stored value by the value (converted as required) in another measurement. In the admin the inputfield includes a checkbox (which can be optionally disabled) for converting values on page save. For an example if a value was typed in as centimeters, the unit was changed to metres, and the page saved with this checkbox selected, said value would be automatically converted so that e.g. 170 cm becomes 1.7 m.

      A simple length field using Fieldtype Measurement and Inputfield Measurement.
      Combination units (e.g. feet and inches) are also supported.
      Please note that this module is 'proof of concept' at the moment - there are limited units available and quite a lot of code tidying to do. More units will be added shortly.
      See the GitHub at https://github.com/MetaTunes/FieldtypeMeasurement for full details and updates.
    • By tcnet
      File Manager for ProcessWire is a module to manager files and folders from the CMS backend. It supports creating, deleting, renaming, packing, unpacking, uploading, downloading and editing of files and folders. The integrated code editor ACE supports highlighting of all common programming languages.

      This module is probably the most powerful module. You might destroy your processwire installation if you don't exactly know what you doing. Be careful and use it at your own risk!
      ACE code editor
      This module uses ACE code editor available from: https://github.com/ajaxorg/ace

      This module uses the JavaScript dragscroll available from: http://github.com/asvd/dragscroll. Dragscroll adds the ability to drag the table horizontally with the mouse pointer.
      PHP File Manager
      This module uses a modified version of PHP File Manager available from: https://github.com/alexantr/filemanager
    • By tcnet
      This module implements the website live chat service from tawk.to. Actually the module doesn't have to do much. It just need to inserted a few lines of JavaScript just before the closing body tag </body> on each side. However, the module offers additional options to display the widget only on certain pages.
      Create an account
      Visit https://www.tawk.to and create an account. It's free! At some point you will reach a page where you can copy the required JavaScript-code.

      Open the module settings and paste the JavaScript-code into the field as shown below. Click "Submit" and that's all.

      Open the module settings
      The settings for this module are located int the menu Modules=>Configure=>LiveChatTawkTo.

    • By tcnet
      Session Viewer is a module for ProcessWire to list session files and display session data. This module is helpful to display the session data of a specific session or to kick out a logged in user by simply delete his session file. After installation the module is available in the Setup menu.

      The following conditions must be met for the module to work properly:
      Session files
      Session data must be stored in session files, which is the default way in ProcessWire. Sessions stored in the database are not supported by this module. The path to the directory where the session files are stored must be declared in the ProcessWire configuration which is by default: site/assets/sessions.
      Serialize handler
      In order to transform session data easier back to a PHP array, the session data is stored serialized. PHP offers a way to declare a custom serialize handler. This module supports only the default serialize handlers: php, php_binary and php_serialize. WDDX was dropped in PHP 7.4.0 and is therefore not supported by this module as well as any other custom serialize handler. Which serialize handler is actually used you can find out in the module configuration which is available under Modules=>Configure=>SessionViewer.

      Session data
      The session data can be displayed in two different ways. PHP's default output for arrays print_r() or by default for this module nice_r() offered on github: https://github.com/uuf6429/nice_r. There is a setting in the module configuration if someone prefers print_r(). Apart from the better handling and overview of the folded session data the output of nice_r() looks indeed nicer.

      ProcessWire module directory
    • By Robin S
      Repeater Easy Sort
      Adds a compact "easy-sort" mode to Repeater and Repeater Matrix, making those fields easier to sort when there are a large number of items.
      The module also enhances Repeater Matrix by allowing a colour to be set for each matrix type. This colour is used in the item headers and in the "add new" links, to help visually distinguish different matrix types in the inputfield.
      A Repeater field

      A Repeater Matrix field with custom header colours

      Easy-sort mode
      Each Repeater/Matrix item gets an double-arrow icon in the item header. Click this icon to enter easy-sort mode.
      While in easy-sort mode:
      The items will reduce in width so that more items can be shown on the screen at once. The minimum width is configurable in the field settings. Any items that were in an open state are collapsed, but when you exit easy-sort mode the previously open items will be reopened. You can drag an item left/right/up/down to sort it within the items. The item that you clicked the icon for is shown with a black background. This makes it easier to find the item you want to move in easy-sort mode. You can click an item header to open the item. An "Exit easy-sort mode" button appears at the bottom of the inputfield. Configuration
      In the field settings for Repeater and Repeater Matrix fields you can define a minimum width in pixels for items in easy-sort mode. While in easy-sort mode the items will be sized to neatly fill the available width on any screen size but will never be narrower than the width you set here.
      In the field settings for Repeater Matrix you can define a custom header colour for each matrix type using an HTML "color" type input. The default colour for this type of input is black, so when black is selected in the input it means that no custom colour will be applied to the header.
      The easy-sort mode is only possible on Repeater/Matrix fields that do not use the "item depth" option.
  • Create New...