wumbo

Module: FieldtypeAssistedURL

Recommended Posts

Thank you for testing it, Adrian!

I will try to find out why it isn't working for me. It's just a local page to play and to get deeper into PW.

Share this post


Link to post
Share on other sites
2 minutes ago, sms said:

Thank you for testing it, Adrian!

I will try to find out why it isn't working for me. It's just a local page to play and to get deeper into PW.

Perhaps you have checked one of these two options in the settings for this module:

Prepend site's root path to local/relative URLs?
Allow relative/local URLs without "http://" at the beginning?

Either of those will break the lookup of the page for getting the title.

But again, Page Reference is much better for local links - one of the key reasons is that is stores the page ID which never changes, rather than the URL which may possibly break down the road.

  • Like 1

Share this post


Link to post
Share on other sites

Thank you very much again. I have checked and unchecked these options but it doesn't work for me. But the Page Reference works perfectly:

<a href="<?php echo $page->link->url; ?>"><?php echo $page->link->title; ?></a>

:-)

  • Like 1

Share this post


Link to post
Share on other sites
On 8.3.2017 at 0:34 PM, pmichaelis said:

Hey,

thanks for that module. 

Maybe I missed something, but how to get the propoerties, like target, title, or rel in a page template?
Are these values stored anywhere?

Thanks for help.

Sorry, that I need to post my question again. Is there a chance for storing these values to the db?

Share this post


Link to post
Share on other sites
9 hours ago, pmichaelis said:

Is there a chance for storing these values to the db?

Not in this fieldtype as it stands because it only has a single inputfield. But you can create other fields for the purpose and add them to your template, maybe grouped inside a fieldset together with the Assisted URL field. Text fields for title and rel, and maybe a Select Options field would be good for target.

Share this post


Link to post
Share on other sites
11 hours ago, Robin S said:

Not in this fieldtype as it stands because it only has a single inputfield. But you can create other fields for the purpose and add them to your template, maybe grouped inside a fieldset together with the Assisted URL field. Text fields for title and rel, and maybe a Select Options field would be good for target.

Ok, thanks for the reply. I was just wondering, because the modal dialog keeps all these options. An altnernative would be to store the data (url, title, rel, target) as json in order to have them.

Share this post


Link to post
Share on other sites

Hello,

When I install this module I get this error:

 

Parse error: syntax error, unexpected '[' in ....../html/site/assets/cache/FileCompiler/site/modules/FieldtypeAssistedURL/FieldtypeAssistedURL.module on line 26

What could be the reason for this. Please help!

Share this post


Link to post
Share on other sites

Someone has already asked but... no way for multi-language?
I think that multi-language support should be the first thing to take care when developing a new module :)

Share this post


Link to post
Share on other sites

Hi,

I'm using the module "AssistedURL Field" inside a repeater. It works fine when I'm logged in as superuser. When I'm logged in with restricted rights (user account), I get this error when I click the button to select a URL:

Modules: Error initializing module: ProcessPageEditLink - You don't have access to this page

The error appears within the appearing modal window of "AssistedURL Field" in which the URL or page can be selected.

What am I missing?

Edited by kongondo
Moderator Note: Moved question to the module's support forum.

Share this post


Link to post
Share on other sites

Strange thing: If I give the user the same rights as the superuser, the error will still persist!

There is also a second error:

ProcessWire: The requested process does not exist

 

Bildschirmfoto 2018-01-16 um 10.10.27.png

Share this post


Link to post
Share on other sites

I have completely uninstalled and reinstalled the module, now. I also emptied the module cache. The error still exists. I'm greatly appreciated for any hint.

Share this post


Link to post
Share on other sites

@nabo For multilingual url fields maybe you could try this module with https://github.com/ryancramerdesign/FieldtypeURLLanguage?

Sorry @anyway, I'm not sure.  Maybe you can list the permission of the user's roles?  Does the user's role have the page-edit permission?  Did you enable access control for the field?  Edit the field and click on the "Access" tab to check.

Share this post


Link to post
Share on other sites
On 15/01/2018 at 10:35 PM, anyway said:

I get this error when I click the button to select a URL:


Modules: Error initializing module: ProcessPageEditLink - You don't have access to this page

I can confirm the problem. When the inputfield is inside a repeater item the module tries to open the link modal for the repeater page, but non-superusers do not have direct access to repeater pages. The core link modal (opened from CKEditor) does not have this problem because in the case of being inside a repeater item it opens the link modal for the container page instead.

You can apply the same logic to this module by editing InputfieldAssistedURL.module, changing line 62...

$btn->attr('data-page-id', $this->page->id);

...to (edit: there could be multiple nested repeaters, so best to borrow the code from ProcessPageEditLink)...

$page = $this->page;
$n = 0;
while(wireInstanceOf($page, 'RepeaterPage') && ++$n < 10) {
    $page = $page->getForPage();
}
$btn->attr('data-page-id', $page->id);

 

Share this post


Link to post
Share on other sites

@gmclelland Thanks for your reply! Yes, the user's role has the page-edit permission. In the meantime, I've been able to "solve" the problem by giving page-view access to the system template "admin" to the user role Page-View, which is probably not optimal.

@Robin S Unfortunately, your code doesn't work for me. The repeater elements can no longer be opened. There is only a short twitch when you click on the elements. Any idea?

ProcessWire 3.0.62

 

 

Share this post


Link to post
Share on other sites
9 minutes ago, anyway said:

Unfortunately, your code doesn't work for me. The repeater elements can no longer be opened. There is only a short twitch when you click on the elements. Any idea?

Not sure. It works for me in PW 3.0.88. Seems like it could be a Javascript error - check your browser console to see if that reveals any issues.

assisted.gif.e821c5c765ae2a34b87058ad7a176340.gif

Share this post


Link to post
Share on other sites

You're right, it looks like a javascript error, but the console does not show any errors. After the click, the elements appear to open (the three dots disappear), but the accordions doesn't drop down.

Share this post


Link to post
Share on other sites
On 7/29/2015 at 2:07 PM, adrian said:

When selecting a page from the site, I would rather the field stores the ID of the page, just in case the path (and therefore the URL) is changed down the road.

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.

  • Like 3

Share this post


Link to post
Share on other sites

A few more enhancements:

It now handles local links with query string parameters - the stored link is still converted to a page ID with the query string appended. 

You can now also paste full http(s) links and if these are local links, they will be converted to a page ID and a local link will be returned when the value is requested.

  • Like 3

Share this post


Link to post
Share on other sites

One more small, but pretty important tweak - it now properly removes the tabs at the top in the UiKit theme. Important so that users aren't confused by the useless "Attributes" tab option.

I think I am pretty happy with it now that it is storing page IDs for local links, but I am  curious if anyone else is still using this module? Is there something else out there that I might have missed that provides a nice interface for choose links to local pages and also has the option to paste in an external link?

 

Share this post


Link to post
Share on other sites

Thanks for the feedback @gmclelland - I don't have the need (and therefore the time) to look into the multilanguage side of things right now, but if others want to contribute, I am happy to maintain this fork going forward. Perhaps if we could get @wumbo to chime in to confirm he's no longer to going to support this, I could point the entry in the modules directory to my fork?

PS - I just emailed him via the address listed on his Github profile and it bounced and it's the same address he has used in his PW modules directory account. I don't have access to check the email for his forum account, but I am guessing these notifications are probably bouncing too. I don't really feel right switching things out without his permission, but also not sure how to move forward - anyone have any thoughts on this? I think maybe PW needs a policy on this, because it's bound to happen again with other modules.

PPS - I found another email address for him, so hopefully I will hear something soon.

  • Like 2

Share this post


Link to post
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 Lex Sanchez
      Video or Social Post Embed
      Based on the TextformatterVideoEmbed module developed by Ryan Cramer, we have added the possibility to embed publications of the main social networks Facebook, Twitter and Instagram.
      ProcessWire Textformatter module that enables translation of YouTube, Vimeo, Instagram, Facebook, Twitter or Issuu URLs to full embed codes, resulting in a viewable video or social post in textarea fields you apply it to.
      How to install
      Download or Clone from Github: https://github.com/lexsanchez/VideoOrSocialPostEmbed
      Copy the VideoOrSocialPostEmbed.module file to your /site/modules/ directory (or place it in /site/modules/VideoOrSocialPostEmbed/).
      Click check for new modules in ProcessWire Admin Modules screen. Click install for the module labeled: "Video or Social Post Embed".
      Now you will be on the module config screen. Please make note of the config options and set as you see fit.
      How to use
      Edit your body field in Setup > Fields (or whatever field(s) you will be placing videos in). On the details tab, find the Text Formatters field and select "Video or Social Post Embed". Save.
      Edit a page using the field you edited and paste in YouTube, Vimeo, Facebook, Twitter, Instagram and/or Issuu URLs each on their own paragraph.
      Example
      How it might look in your editor (like TinyMCE):
      How it works
      This module uses YouTube, Vimeo, Instagram, Facebook, Twitter and Issuu oEmbed services to generate the embed codes populated in your content. After these services are queried the first time, the embed code is cached so that it doesn't need to be pulled again.
      Configuration
      You may want to update the max width and max height settings on the module's configuration screen. You should make these consistent with what is supported by your site design.
      If you change these max width / max height settings you may also want to check the box to clear cache, so that YouTube/Vimeo/Facebook/Twitter/Instagram/Issuu oembed services will generate new embed codes for you.
      Using with Markdown, Textile or other LML
      This text formatter is looking for a YouTube, Vimeo, Instagram, Facebook, Twitter or Issuu video URL surrounded by paragraph tags. As a result, if you are using Markdown or Textile (or something else like it) you want that text formatter to run before this one. That ensures that the expected paragraph tags will be present when VideoOrSocialPostEmbed runs. You can control the order that text formatters are run in by drag/drop sorting in the field editor.
      Copyright 2018 by Ryan Cramer / Updated by Lex Sanchez
    • By kixe
      Email Verification
      This module provides functions to validate email adresses and hosts. The module generates a textfile for blacklisted mailhosts (trashmail), which will be always up to date.
      Download
      https://modules.processwire.com/modules/email-verification/
      API
      // get module $mailcheck = $modules->get('EmailVerification'); // return bool/ string - automatted update of blacklist file $mailcheck->blacklisted(email|domain) // return bool - validate a top level domain, checks against IANA list $mailcheck->validTLD(tld) // return array of punycoded TLDs - cyclic updated, data pulled from IANA $mailcheck->getTLDs(cycle=2592000) // return bool - checks syntax converts to punycode $mailcheck->validDomainName(domain); // return bool - checks punycode encoded syntax $mailcheck->validHostName(host); // return bool - checks syntax and accessibility $mailcheck->validHost(email|domain) // add a single value to blacklist $mailcheck->addToBlacklist(email|domain) USAGE
      $mailcheck = $modules->get('EmailCheck'); $email = 'susi@trashmail.com'; if($mailcheck->blacklisted($email)) echo 'Email Provider not allowed'; if(!$mailcheck->validHost($email)) echo 'Mailhost not available'; Example blacklist file:  blacklist.txt
       
    • By teppo
      Code Blocks Textformatter is a tiny Textformatter module I cooked up to add support for code blocks to text/textarea/RTE fields on some of the sites I work with. Unlike a full-blown Markdown Textformatter – which is something that we already have in the core – this module simply adds support for fenced and inline code blocks.
      The syntax is based on the GitHub code block documentation, so please refer to that for additional instructions. The README at GitHub also includes some basic examples. As with any Textformatter, in order to enable this one, install it and enable it via field settings. Note that there's no syntax highlighting built in (at least for the time being), so use a tool of your choice for that – personally I prefer Prism.js.
      Since this module doesn't use a Markdown tool behind the scenes, but rather some home baked regular expressions, there's always the possibility that I've missed something – but please let me know if you use this module and run into any issues. On the other hand this module should be relatively fast and unobtrusive, as there are no unnecessary bits of code to run 
      GitHub repository: https://github.com/teppokoivula/TextformatterCodeBlocks Modules directory: http://modules.processwire.com/modules/textformatter-code-blocks/
    • By theo
      Here is my first processwire module (beta).
      https://github.com/theo222/ImagePickerField
      A lot of "first times". First time Github, Markdown and of course PW Modules.
      So be gentle please.
      I hope it works.