Recommended Posts

I'm not sure how to set it up.

When specify a destination, it could only select a page from page tree or something like page:1017

1017 is the page id

but how to specify page id 1017 of other language ?

Due to the way the tree module works, I am not able to show the pages in all languages within Jumplinks. You may need to switch languages in the admin panel to see the pages in that language. You can also manually specify the destination without using the page tree or auto complete fields.

Share this post


Link to post
Share on other sites

Hi Peter,

I'm not sure why that is happening...

What version of Jumplinks do you have?

Hi Mike

I have Jumplinks V 1.5.2 installed.

Same thing happened when I upgraded from PW 2.6.1 to 2.7.3. Possibly the same site.

Share this post


Link to post
Share on other sites

The jumplink: 

[...]

works for the default language, the problem is when I try to redirect to the non-default language, Portuguese:

[...]

 BUT only redirects to the default language.

[...]

Or is there other workaround?

After playing around a bit I found the following workaround to force language specific redirects:

If you set the destination path to your language specific page the system will detect the related page and store the page as the target.

If you add a questionmark (introducing a querystring) at the end of the destination path jumplinks will leave the path as is and redirect will happen as expected.

This is not needed for redirects to the homepage.

Better solution would be to implement language specific targeting to the module. +1 to the wishlist from my side.

Share this post


Link to post
Share on other sites

After playing around a bit I found the following workaround to force language specific redirects:

If you set the destination path to your language specific page the system will detect the related page and store the page as the target.

If you add a questionmark (introducing a querystring) at the end of the destination path jumplinks will leave the path as is and redirect will happen as expected.

This is not needed for redirects to the homepage.

Better solution would be to implement language specific targeting to the module. +1 to the wishlist from my side.

Hi kixe - are you saying that if the module isn't storing the paths ID (page:id) in the database, but rather redirecting to its hardcoded URI, then it automatically redirects again to that same page in the correct language? (Forgive me if I've misunderstood... Also, not able to test right now - can only do so later today.)

Hi Mike

I have Jumplinks V 1.5.2 installed.

Same thing happened when I upgraded from PW 2.6.1 to 2.7.3. Possibly the same site.

I see - muct be an oversight on my side. Will try sort out a fix this afternoon (SAST)

Share this post


Link to post
Share on other sites

Hi kixe - are you saying that if the module isn't storing the paths ID (page:id) in the database, but rather redirecting to its hardcoded URI, then it automatically redirects again to that same page in the correct language? (Forgive me if I've misunderstood... Also, not able to test right now - can only do so later today.)

Example:

The website example.org is a multilanguage site with english as default language and german as second available language. The Name of the root page is 'en' for default language and 'de' for german.

If I want to redirect a not existing url to the new page with ID: 1234 and url '/en/archive/' I create a jumplink and type in '/en/archive/' as the target the system detects the page and stores: 'page:1234'

Redirect will target as expected to '/en/archive/'.

If I want to redirect to the page with ID: 1234 in the german version with url '/de/archiv/' I create a jumplink and type in '/de/archiv/' as the target the system detects the page and stores: 'page:1234' too.

Redirect will target  to '/en/archive/' and NOT to '/de/archiv/'.

To force a redirect to the german version I found a workaround by adding the questionmark (querystring) to the url. In this case the system doesn't detect the page and will store the path instead of the ID. Redirect will happen once and as expected.

Share this post


Link to post
Share on other sites

Example:

The website example.org is a multilanguage site with english as default language and german as second available language. The Name of the root page is 'en' for default language and 'de' for german.

If I want to redirect a not existing url to the new page with ID: 1234 and url '/en/archive/' I create a jumplink and type in '/en/archive/' as the target the system detects the page and stores: 'page:1234'

Redirect will target as expected to '/en/archive/'.

If I want to redirect to the page with ID: 1234 in the german version with url '/de/archiv/' I create a jumplink and type in '/de/archiv/' as the target the system detects the page and stores: 'page:1234' too.

Redirect will target  to '/en/archive/' and NOT to '/de/archiv/'.

To force a redirect to the german version I found a workaround by adding the questionmark (querystring) to the url. In this case the system doesn't detect the page and will store the path instead of the ID. Redirect will happen once and as expected.

Right, I see. Haven't worked on/with the module for a while, so forgot that it stores the Page ID when the hard-coded URI exists as a Page. The issue here is that I'm not experienced with regards to multi-lang sites. Do multi-lang pages share the same ID? So 1234 would represent both the English and German pages... No?

Share this post


Link to post
Share on other sites

I am experiencing this module to be a bit slow after a while. Note that I have not read the entire thread from 1 to 13 for solutions or limitation, just quick read a few pages. Or found anything on the webpage.

A few details on my installation:

  • About 330 jumplinks
  • It takes about 17 second to load the Jumplinks page/list
  • Registering new jumplinks also takes a good while (I am not sure if is because of saving or loading the Jumplinks page/list).
  • My webpage has about 120 000 pages.
  • Running 3.0.17

I can live with it being slow. Just thought I should mention it. And also hoping a little that there's a solution.

Share this post


Link to post
Share on other sites

I am experiencing this module to be a bit slow after a while. Note that I have not read the entire thread from 1 to 13 for solutions or limitation, just quick read a few pages. Or found anything on the webpage.

A few details on my installation:

  • About 330 jumplinks
  • It takes about 17 second to load the Jumplinks page/list
  • Registering new jumplinks also takes a good while (I am not sure if is because of saving or loading the Jumplinks page/list).
  • My webpage has about 120 000 pages.
  • Running 3.0.17

I can live with it being slow. Just thought I should mention it. And also hoping a little that there's a solution.

Hi laban,

Thanks for the insight on this - this is the first I'm hearing of Jumplinks running on a large site.

Jumplinks wasn't built for large sites - in fact, it wasn't something that crossed my mind when building it. That said, it does seem a little strange that this is happening. The only thing I think could slow it down is the multiple regex routines that the module makes use of - there are quite a lot, if you have a look at the code.

Without saying much more, I would be very interested to see a Blackfire/XDebug dump of this - perhaps I may be able to look into the details and speed up the new module. If you could do that for me, I'd be most grateful.

Unfortunately, I haven't been pyaing attention to the module of late - many other things on the plate at the moment. That said, I'm sure I'll be getting back into it soon with some new sites in the pipeline.

Thanks,

Mike

  • Like 1

Share this post


Link to post
Share on other sites

I have unfortunately no experience with debugging / BlackFire / XDebug. I have MAMP where I do my local development, and have activated Xdebug there, and downloaded MacGDBp. But that's all I have managed to do.

With some guidance there would of course be no problem for me to contribute! Is what I am saying. When you're ready.

Share this post


Link to post
Share on other sites

I have unfortunately no experience with debugging / BlackFire / XDebug. I have MAMP where I do my local development, and have activated Xdebug there, and downloaded MacGDBp. But that's all I have managed to do.

With some guidance there would of course be no problem for me to contribute! Is what I am saying. When you're ready.

I see - though, I admit: I'm pretty new to debug/profiling tools myself. It's quite simple, and I quite like XDebug, which is essentially a PHP extension that can profile your code as and when it is executed. It simply output the data to a file, which can then be opened using a client app.

I'll continue work on Jumplinks 2 as soon as I can. There are already performance boosts in terms of PW3 and the new module structure. Also, I think I'd like for the module to make use of SQL statements that limit what is returned - that way, it doesn't have to loop through large sets of data.

Lots of work ahead of me...

  • Like 1

Share this post


Link to post
Share on other sites

I am on pw 2.7.3 and have jumplinks 1.5.2

I can not delete any jumplink, when I click on the source I just get taken to the add new jumplink page.

Would be nice if this could be fixed.

Thanks

Share this post


Link to post
Share on other sites
2 hours ago, OllieMackJames said:

I am on pw 2.7.3 and have jumplinks 1.5.2

I can not delete any jumplink, when I click on the source I just get taken to the add new jumplink page.

Would be nice if this could be fixed.

Thanks

Hi Ollie,

I'm not able to test right now due to a server upgrade. That said, please can you check what link shows up in the status bar when you hover over a source? Also, what happens when you navigate to <admin>/setup/jumplinks/entity/?id=1 manually?

Share this post


Link to post
Share on other sites

@OllieMackJames - Sorry, I had a typo there. Meant to ask what happens when you manually go to the URL with id=19, the same URL that appears when you hover over a link. Nonetheless, I think there is a problem, as going to id=1 should edit the first jumplink you created. if id=0, then the module should create a new jupmlink.

To be clear, if you navigate to /pwire/setup/jumplinks/entity/?id=19, do you get to the Register New Jumplink page, and does the URL change? And lastly, what version of PHP are you running?

Is anyone else experiencing this problem?

Share this post


Link to post
Share on other sites

Hi Mike, took a while to log in here again.

I work with php 7.0.8

When I you navigate to /pwire/setup/jumplinks/entity/?id=19, I see the Register New Jumplink page, and this URL: /pwire/setup/jumplinks/entity/?id=19

Thanks for looking into it!

 

Share this post


Link to post
Share on other sites

Just voted this module up, great work! I used this for the first time, a client needed simple redirects and the cPanel solution didn't work well. The module worked like a charm, thanks! Having a built-in role was also nice to see.

At first sight I feel that two simple additions would make the module smarter from the UI side:

  1. Enable/disable checkbox for individual jumplinks: this would make easier disable items without having to delete them
  2. Preview link for jumplinks - perhaps to open them in a modal window, or panel in PW3?

Share this post


Link to post
Share on other sites

@tpr - Thanks, glad you like it.

I have started building Jumplinks 2 from the ground up, but haven't had the time to continue work on it of late.

With regards to the state-toggle: I can implement this feature, but it would be turned off by default. That said, if the feature gets enabled, the jumplinks would all be created to redirect with status code 302/307 (actuallly not 100% sure which one is better). That said, is isn't necessary to do so, but not doing so would mean going against the intention of the different HTTP codes.

As for previews: these can be somewhat difficult, giving consideration to parameters - I think I may have brought this up before here. It would be easy to preview jumplinks that don't have parameters, but those that do have them would need user input in order to test.

This is all on my to-do list for the new module, which will be compatible with both PW 2.8 and 3.0.

  • Like 3

Share this post


Link to post
Share on other sites

Thanks, these make sense. Another feature request (from the client) is to be able to reset multiple or all jumplinks' hit counters. Currently there are only a few but this sounds handy, eg when going live and would like to start with a clean slate.

Looking forward to v2!

  • Like 1

Share this post


Link to post
Share on other sites

Hi everyone, very sorry for the delays - as you may know, I've been too busy of late to attend to Jumplinks 2. I'm making time as a go along, and would like to briefly discuss the current work taking place.

I may or may not have mentioned that I'd like the new Jumplinks to be powered by FastRoute. This improves processing time by quite a bit (haven't measured, but there is far less preg_* going on) and makes development somewhat easier. By using it, however, the syntax for each jumplink would change; but I believe this to be a good thing.

As you well know, Jumplinks currently uses the {name:type} base syntax, where type is optional (this invokes smart wildcards). By moving to FastRoute, the base syntax would change to {name} only, which catches [^/]+ by default. That regex is typically used in an MVC framework context, and so may not be completely suitable for the purposes of this module - as such, I am sure this can be changed by overriding the RouteParser (we can default to what is currently used for the segment any type: [\w_-]+[\w.-_%\=\]+).

Then, the concept of smart wildcards would disappear, and you would be able to specify your own expressions instead - this is done in the format {name:<exp>}, where <exp> is the expression you would normally use inside of a regex capture group, such as [a-z0-9]+. However, we could add support for aliasing expressions so that the module behaves the same way as it currently does, by silently converting the aliases to their respective expressions, but also allowing more complex expressions to be used. (Note that I chose FastRoute as its syntax closely matches the current Jumplinks syntax, and allows for greater flexibility.)

Before Jumplinks 2 is launched, the current dev branch (which will then be moved to master) will be updated to include a JSON/CSV exporter to the Jumplinks 2 format. As an example, the exporter will automatically convert {page:segment} to {page:[\w_-]+}. However, if we choose to use the wildcard type aliasing (discussed above), then this exporter need only export the data on an as-is basis.

Note: Due to Jumplinks 2 development, all new features requested by the community will not be added to v1, but will be implemented in v2 instead. It will, however, be easy to migrate from v1 to v2 in order to use those features.

I also plan on making v2 compatible with only ProcessWire 2.8 and 3.0, and Mapping Collections will still be supported.

I'm writing about this now so that we can discuss it - I'd appreciate your thoughts on the change, which I think is beneficial to the module going forward.

(I hope everyone is doing well - haven't been around often enough to see new modules and some of the new progress on PW3; but getting there slowly.)

Update: I forgot to mention that FastRoute also allows for optional segments which allows us to jump from, say, /page.php?parent={parent}[&child={child}] to either, say, /{parent}/{child}/ or /{parent}/, depending on the input. Sure, I don't see a wide variety of use-cases for this feature, but I'm sure it'll come in handy to some.

Edited by Mike Rockett
Changed default parameter type
  • Like 6

Share this post


Link to post
Share on other sites

Small update from my side: I'm busy testing all of this out in a simple PHP script that imports FastRoute - so far, so good!

For the purposes of better understanding and correct approach, I'd like to also change the mapping collection syntax from:

{variable_name|collection_name}

to:

{collection_name(variable_name)}

I did want to use square parenthises, but I'd like to try and not conflict with FastRoute's optional params.
(Edit: Sorry, my mistake - FastRoute has nothing to do with destinations. I might switch back to pipes anyway... Not sure I like this format.)

Thoughts?

 

Update: Here's some testing output at the current stage:

Request URI: string(25) "/page.php?id=2&category=1"

Matched Jumplink Object: object(stdClass)#2 (2) {
  ["from"]=>
  string(47) "/page.php?id={page:\d+}&category={category:\d+}"
  ["to"]=>
  string(41) "/{categories(category)}/{page_ids(page)}/"
}

Captured Parameters: array(2) {
  ["page"]=>
  string(1) "2"
  ["category"]=>
  string(1) "1"
}

Identified Collection Item from page_ids: array(1) {
  [2]=>
  string(8) "about-us"
}

Identified Collection Item from categories: array(1) {
  [1]=>
  string(7) "company"
}

Compiled Destination: string(18) "/company/about-us/"

 

  • Like 1

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 Robin S
      Another little admin helper module...
      Template Field Widths
      Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template.

      Why?
      When setting up a new template or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process.
      Installation
      Install the Template Field Widths module.
      Config options
      You can set the default presentation of the "Field widths" field to collapsed or open. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width.  
      https://github.com/Toutouwai/TemplateFieldWidths
      https://modules.processwire.com/modules/template-field-widths/
    • By horst
      Croppable Image 3
      for PW 3.0.20+
      Module Version 1.1.16
      Sponsored by http://dreikon.de/, many thanks Timo & Niko!
      You can get it in the modules directory!
      Please refer to the readme on github for instructions.
       
      -------------------------------------------------------------------------
       
      Updating from prior versions:
       
      Updating from Croppable Image 3 with versions prior to 1.1.7, please do this as a one time step:
      In the PW Admin, go to side -> modules -> new, use "install via ClassName" and use CroppableImage3 for the Module Class Name. This will update your existing CroppableImage3 module sub directory, even if it is called a new install. After that, the module will be recogniced by the PW updater module, what makes it a lot easier on further updates.
      -------------------------------------------------------------------------
       
      For updating from the legacy Thumbnail / CropImage to CroppableImage3 read on here.
       
      -------------------------------------------------------------------------
       
    • By MoritzLost
      UPDATE: I have published a stable version of this module!
      Discussion thread:
      Github: https://github.com/MoritzLost/TextformatterPageTitleLinks
      ---
      Hello there,
      I'm working on a tiny textformatter module that searches the text for titles of other pages on your site and creates hyperlinks to them. I'm not sure if something like this exists already, but I haven't found anything in the module directory, so I wrote my own solution 🙂
      It's not properly tested yet and is still missing some functionality I would like to implement, so at the moment it should be considered in BETA. Features include limiting the pages that will get searched by template, and adding a custom CSS class to the generated hyperlinks. As I'm writing this I noticed that it will probably include unpublished and hidden pages at the moment, so yeah ... it's still in development alright 😅
      You can download the module from Github:
      https://github.com/MoritzLost/TextformatterPageTitleLinks
      There's some more information in the readme as well.
      Anyway, let me know what you think! I'm happy about any feedback, possible improvements or ideas on how to improve the module. Cheers.
    • By blad
      Hi guys!
      I just uploaded a module to explore files based on elFinder. By default it will show the "Files" folder.
      Screenshots:

      Video:
       
      To do:
       More options To fix:
       The function of rotating or scaling an image fails  Image editors V 1.01 (view issue)
      Fixed the bug working with the Multi-Language support ( translation of folders ). Fixed the name of elfinder.en  Github:
      https://github.com/LuisSantiago/ProcessElFinder/
      I hope you like it.
    • By BitPoet
      I'm really in love with FormBuilder, but the one thing missing to match all my end users' expectations were repeatable field groups. Think repeaters, in ProcessWire terms. Our primary application of PW is our corporate intranet, so "lines" of fields are quite common in the forms I build. We have all kinds of request forms where the information for a varying number of colleagues needs to be entered (from meal order to flight booking request) and where it is simply impractical to send a form for each, and I don't want to clutter my forms with multiple instances of fields that may only get used ten percent of the time.
      That's why I started to build FormBuilderMultiplier (link to GitHub).
      What it does:
      Adds an option to make a regular Fieldgroup repeatable Lets you limit the number of instances of a Fieldgroup on the form Adds an "Add row" button the form that adds another instance of the Fieldgroup's fields Adds a counter suffix at the end of every affected field's label Stores the entered values just like regular fields Makes the entered values available in preview and email notifications Supports most text based fields, textareas and selects (really, I haven't had enough time to test all the available choices yet) What it doesn't do (yet):
      Support saving to ProcessWire pages (i.e. real Repeaters) I haven't tested all the validation stuff, Date/Time inputs etc. yet, but since I'm utterly swamped with other stuff at work, I didn't want to wait until I have it polished. Any feedback is welcome. There might also be some issues with different output frameworks that I haven't encountered yet. The forms I work with mostly use UIKit.
      Status:
      Still alpha, so test well before using it in the field.
      Known issues:
      When rows are added, the form's iframe needs to be resized, which isn't completely clean yet.
      How it works:
      The Fieldgroup settings are added through regular hooks, as is the logic that adds the necessary field copies for processing the form and displaying previews.
      "Multiplied" field instances are suffixed with _NUM, where NUM is an incremental integer starting from 1. So if you have add two fields named "surname" and "givenname" to a fieldgroup and check the "multiply" checkbox, the form will initially have "surname_1" and "givenname_1" field (I'm still considering changing that to make the risk to shoot oneself into the foot by having a regular "surname_1" field somewhere else in the form less likely).
      When a "row" is added, the first row is cloned through JS and the counter in the fields' IDs, names and "for" attributes as well as the counter in the label are incremented before appending the copies to the Fieldset container in the form.
      To keep backend and frontend in sync, a hidden field named [name of the fieldset]__multiplier_rows is added to the form. Both the backend and the frontend script use this to store and retrieve the number of "rows".
      ToDo:
      Naturally, add the option to store the data in real repeaters when saving to pages. Do a lot of testing (and likely fixing). Make a few things (like the "Add row" button label etc.) configurable in field(set) context. Add a smooth API to retrieve the multiplied values as WireArrays. The mandatory moving screenshot: