Jump to content

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 bernhard
      --- Please use RockFinder3 ---
    • By MoritzLost
      Cacheable Placeholders
      This module allows you to have pieces of dynamic content inside cached output. This aims to solve the common problem of having a mostly cacheable site, but with pieces of dynamic output here and there.  Consider this simple example, where you want to output a custom greeting to the current user:
      <h1>Good morning, <?= ucfirst($user->name) ?></h1> This snippet means you can't use the template cache (at least for logged-in users), because each user has a different name. Even if 99% of your output is static, you can only cache the pieces that you know won't include this personal greeting. A more common example would be CSRF tokens for HTML forms - those need to be unique by definition, so you can't cache the form wholesale.
      This module solves this problem by introducing cacheable placeholders - small placeholder tokens that get replaced during every request. The replacement is done inside a Page::render hook so it runs during every request, even if the response is served from the template cache. So you can use something like this:
      <h1>Good morning, {{{greeting}}}</h1> Replacement tokens are defined with a callback function that produces the appropriate output and added to the module through a simple hook:
      // site/ready.php wire()->addHookAfter('CachePlaceholders::getTokens', function (HookEvent $e) { $tokens = $e->return; $tokens['greeting'] = [ 'callback' => function (array $tokenData) { return ucfirst(wire('user')->name); } ]; $e->return = $tokens; }); Tokens can also include parameters that are parsed and passed to the callback function. There are more fully annotated examples and step-by-step instructions in the README on Github!
      Features
      A simple and fast token parser that calls the appropriate callback and runs automatically. Tokens may include multiple named or positional parameters, as well as multi-value parameters. A manual mode that allows you to replace tokens in custom pieces of cached content (useful if you're using the $cache API). Some built-in tokens for common use-cases: CSRF-Tokens, replacing values from superglobals and producing random hexadecimal strings. The token format is completely customizable, all delimiters can be changed to avoid collisions with existing tag parsers or template languages. Links
      Github Repository & documentation Module directory (pending approval) If you are interested in learning more, the README is very extensive, with more usage examples, code samples and usage instructions!
    • By Craig
      I've been using Fathom Analytics for a while now and on a growing number of sites, so thought it was about time there was a PW module for it.
      WayFathomAnalytics
      WayFathomAnalytics is a group of modules which will allow you to view your Fathom Analytics dashboard in the PW admin panel and (optionally) automatically add and configure the tracking code on front-end pages.
      Links
      GitHub Readme & documentation Download Zip Modules directory Module settings screenshot What is Fathom Analytics?
      Fathom Analytics is a simple, privacy-focused website analytics tool for bloggers and businesses.

      Stop scrolling through pages of reports and collecting gobs of personal data about your visitors, both of which you probably don't need. Fathom is a simple and private website analytics platform that lets you focus on what's important: your business.
      Privacy focused Fast-loading dashboards, all data is on a single screen Easy to get what you need, no training required Unlimited email reports Private or public dashboard sharing Cookie notices not required (it doesn't use cookies or collect personal data) Displays: top content, top referrers, top goals and more
    • By daniels
      This is a lightweight alternative to other newsletter & newsletter-subscription modules.
      You can find the Module in the Modules directory and on Github
      It can subscribe, update, unsubscribe & delete a user in a list in Mailchimp with MailChimp API 3.0. It does not provide any forms or validation, so you can feel free to use your own. To protect your users, it does not save any user data in logs or sends them to an admin.
      This module fits your needs if you...
      ...use Mailchimp as your newsletter / email-automation tool ...want to let users subscribe to your newsletter on your website ...want to use your own form, validation and messages (with or without the wire forms) ...don't want any personal user data saved in any way in your ProcessWire environment (cf. EU data regulation terms) ...like to subscribe, update, unsubscribe or delete users to/from different lists ...like the Mailchimp UI for creating / sending / reviewing email campaigns *I have only tested it with PHP 7.x so far, so use on owners risk
      EDIT:
      Since 0.0.4, instructions and changelog can be found in the README only. You can find it here  🙂
      If you have questions or like to contribute, just post a reply or create an issue or pr on github, thanks!
    • By MoritzLost
      Sorry for the convoluted title. I have a problem with Process modules that define a custom page using the page key through getModuleInfo (as demonstrated in this excellent tutorial by @bernhard). Those pages are created automatically when the module is installed. The problem is that the title of the page only gets set in the current language. That's not a problem if the current language (language of the superuser who is installing the module) is the default language; if it isn't, the Process page is missing a title in the default language. This has the very awkward effect that a user using the backend in the default language (or any other language) will see an empty entry in the setup menu:

      This screenshot comes from my Cache Control module which includes a Process page. Now I realize the description sounds obscure, but for us it's a common setup: We a multiple bilingual sites where the default language is German and the second language is English. While the clients use the CMS in German, as a developer I prefer the English interface, so whenever I install a Process module I get this problem.
      As a module author, is there a way to handle this situation? I guess it would be possible to use post-installation hooks or create the pages manually, but I very much prefer the declarative approach. The page title is already translatable (through the __ function), but of course at the time of installation there is no translation, and as far as I'm aware it's not possible to ship translations with a module so they are used automatically. Could this situation be handled better in the core? I would prefer if the module installation process would always set the title of the Process page in the default language, instead of the language of the current user.
×
×
  • Create New...