Jump to content

Recommended Posts

Mike, thanks for the module, I just migrated a modx site to pw and am using this full on - running into trouble though.

When I input a jumplink it does a 302 and that is NOT good for google, I need them to be 301.

So the question is how can I make sure all the redirects are 301 and there are no 302

302 means google gets confused and that means my traffic hurts.

Thanks for the help!

Baie dankie

Thanks for identifying that, which is indeed a bug - not sure when it broke. Will check it out now.

Edit: Fixed - please update to 1.3.2.

  • Like 2

Share this post


Link to post
Share on other sites

How would I setup a jumplink that does something like this:

articles.html?tags=*.* to one page

with *.* I mean everything possible behind that

sorry about this noob question but I just can't figure it out.

Share this post


Link to post
Share on other sites

You can just use articles.html?tags={tags:all} and then use {tags} in the destination.

Had a look at the docs for wildcards?

Thanks Mike,

I went for: articles.html?tags={tags:all} and then for destination I just picked one page, seems to do the trick

I did look at the wildcards documentation, but what I did not get was how to do 2 things, one is the example you gave and the second is I don't want {tags} in a destination I just wanted one particular page.

I am cleaning all those tag pages for panda reasons but some of them have incoming traffic and links, I now point that all to a sitemap type of page on my site.

Thanks for your help, much appreciated.

Share this post


Link to post
Share on other sites

I went for: articles.html?tags={tags:all} and then for destination I just picked one page, seems to do the trick

Indeed - it is fine to leave the tag out of the destination. It must be used in the source as Jumplinks checks the request from beginning to end.

Share this post


Link to post
Share on other sites

Minor note regarding the 404 monitor: currently all hits to sitemap.xml (generated by Pete's Markup Sitemap XML module) are recorded as 404s.

Haven't had a proper look under the hood yet, but so far I'm guessing that both modules hook into pageNotFound, in which case this sounds like a priority issue or the logger not checking if another module has modified the output (however that should be implemented). Anyway, just something you might want to consider for the new 404 logger module.

For the record, the 404 logger is very handy when migrating a lot of content from one site to another, and it's also cool that one can easily register a new Jumplink from the 404 list. Great work, just like the rest of this module! :)

  • Like 2

Share this post


Link to post
Share on other sites

@Teppo - Yeah, it appears that this is indeed a priority issue. I wonder if I shouldn't push it back a bit? It's currently set to 10, and uses addHookBefore.

I can't exactly remember why I used an early event here - but when the two modules are separated, things will be different. Out of curiosity, how would I check to see if that output has been modified?

Regarding a timeline on these - I don't have one as yet. Currently spending most of my time starting up a special project. As it stands right now, JL is working as expected, and so should be good enough for a while. On most of my sites, I'm leaving the 404 monitor off due the heavy amount of false-positives showing up.

Share this post


Link to post
Share on other sites

Great module, but having a minor issue.

story-of-the-month set to redirect to story-of-the-month/ is redirecting fine

story-of-the-month?story=9 set to redirect to story-of-the-month/$mystory is redirecting to story-of-the-month/

Could this be because of Processwires normal behaviour to add a trailing slash? Tried removing the first redirect but no joy.

Share this post


Link to post
Share on other sites

Great module, but having a minor issue.

story-of-the-month set to redirect to story-of-the-month/ is redirecting fine

story-of-the-month?story=9 set to redirect to story-of-the-month/$mystory is redirecting to story-of-the-month/

Could this be because of Processwires normal behaviour to add a trailing slash? Tried removing the first redirect but no joy.

Please share what you used for the Source and Destination fields in your jumplink? To me, this is unrelated due to your use of $myStory, which looks like a PHP variable, and not a Jumplinks wildcard.

Also, does story-of-the-month exist in the Page Tree? If so, Jumplinks won't do anything with it as only 404-hits are handled.

Share this post


Link to post
Share on other sites

Yes, story-of-the-month does exist in the page tree, which is why I was pretty sure anything after that wont work. No worries, I will just attacked those with .htaccess.

Share this post


Link to post
Share on other sites

Yes, story-of-the-month does exist in the page tree, which is why I was pretty sure anything after that wont work. No worries, I will just attacked those with .htaccess.

Because Jumplinks reacts to the 404 event, only requests to story-of-the-month and story-of-the-month/ would be excluded. However, a request to story-of-the-month/something-that-does-not-exist would be sent off to Jumplinks.

Share this post


Link to post
Share on other sites

story-of-the-month?article=9 is not actually sent off to jumplinks, my guess was because Processwire sent it off to story-of-the-month/ internally?

Share this post


Link to post
Share on other sites

story-of-the-month?article=9 is not actually sent off to jumplinks, my guess was because Processwire sent it off to story-of-the-month/ internally?

Specifically, I'm referring to sub-pages of story-of-the-month. By making a request to story-of-the-month?article=9, it's really a request to story-of-the-month, which exists.

As such, the only alternative is to use mod_rewrite (the following two lines should be placed directly under RewriteEngine On):

RewriteCond %{QUERY_STRING} ^article=(\d+)$ [NC]
RewriteRule ^(story-of-the-month)/?$ /$1/%1 [R=301,END]

Share this post


Link to post
Share on other sites

Continued from here...

@PeterKnight:

So I'm nearly done with this. One thing I need to know is this: how do I get AutoComplete to only allow one page selection? By default, it allows more than one, and there doesn't seem to be an option to prevent that...

Edit: Nevermind, got it - maxSelectedItems

Share this post


Link to post
Share on other sites

Now I need help with something...

When selecting a page via the tree, its ID is added to the text field so that Jumplinks may process it easily. Now, how do I accomplish the same thing with AutoComplete? Checking pageSelected doesn't seem to do it. The event doesn't get called (tested with an alert).

Additionally, how do I set the AutoComplete value when the tree is used?

Lastly, how do I set the tree value when AutoComplete is used?

Share this post


Link to post
Share on other sites

Hey Mike

Nice Module.

I've been using Redirects for a project and as mentioned I have 500 redirects to make. Actually, 400 left with 100 done.

I might port to JL as I like the wildcard integration.

Can I make a suggestion now that I've installed it?

1 The Destination column IMHO would be best displaying the new path and not the page title. Displaying the page title (to me) largely tells me nothing useful.

2 Minor point but the font sizes are different than the rest of the RenoTheme fonts. Not a biggie but when everything in Reno is so consistent it'd be nice to continue that. I appreciate you've 2 extra date columns and that could be reason for reducing font size.

Otherwise, nice job. The 404 Monitor is great :)

Edited by Peter Knight

Share this post


Link to post
Share on other sites

Hi Peter - Jumplinks is my own successor to Redirects. It was originally developed for Bolt CMS, but has now been fully adapted for ProcessWire. At present, yes it's stable. All the issues that have been encountered are closed, and don't have any complaints so far.

I think that Jumplinks is called earlier that Redirects in the event chain, so no clashing on that front. If the same redirect is defined in both, then Jumplinks will redirect first, and the Redirects module will not do anything. (I haven't actually tested this, but it should be the case.)

I do have plans to upgrade Jumplinks - it's really more of a coding issue than a practical one. Essentially, the module will remain mostly the same, and the upgrade will be seamless. Unfortunately, I don't get much time to look at it - as such, I remind myself that the current version is stable, and ready for production use, and so it isn't really an issue when I start writing Jumplinks 2.

However, the major part of Jumplinks 2 will be that the 404 monitor currently included with the module will be removed, and made available separately.

Give it a spin - if you like it, you can switch over. When I'm done with v2 (which won't be any time soon), you can upgrade with no hassles.

In the meantime, I do want to add the feature you suggested for Redirects, I think it's definitely quite useful for large sites.

  • Like 1

Share this post


Link to post
Share on other sites

Hey Mike

Nice Module.

I've been using Redirects for a project and as mentioned I have 500 redirects to make. Actually, 400 left with 100 done.

I might port to JL as I like the wildcard integration.

Can I make a suggestion now that I've installed it?

1 The Destination column IMHO would be best displaying the new path and not the page title. Displaying the page title (to me) largely tells me nothing useful.

2 Minor point but the font sizes are different than the rest of the RenoTheme fonts. Not a biggie but when everything in Reno is so consistent it'd be nice to continue that. I appreciate you've 2 extra date columns and that could be reason for reducing font size.

Otherwise, nice job. The 404 Monitor is great :)

Above response was for your original post.

Using the title is handy for smaller sites, but I do actually agree with you. Much of the module is really me testing things out. For consistency reasons, I'm going to make it dispay the path instead.

Regarding font sizes, those were deemed best for the common 1366x768 resolution. Anything larger than that, and it just doesn't fit nicely for me. Sure, on a large screen (if I remember correctly, you're using a Mac), it would appear differently. For the time being, I'm going to leave that as it is.

404 Monitor is in dire need of an upgrade, which is one of the aspects that prompted me to do a rewrite. It's usable in its current form, but can easily get overcrowded. Also, it's limited to 100 404s (it stores all of them, though), which is something I'd like to deal with when it becomes a separate module.

Glad you like it :)

  • Like 1

Share this post


Link to post
Share on other sites

This is what the editor looks like now. Just trying to figure out the above regarding the assignment of the selectors before I push to the dev branch - if anyone could help me out with that, I'd appreciate it.

post-2289-0-19580700-1440693445_thumb.jp

Edited by Mike Rockett
  • Like 1

Share this post


Link to post
Share on other sites

Hey there, I'm new to this module but I was having some issues with * s for redirecting with the old redirect module and am having the same issue with this module as well. Has something changed in pw that is making this functionality no longer work? Not quite sure what to test.

Redirect path           New path
path/subpath/*         /newPath

this was working great a couple processwire versions ago, but now I just get 404s when I try to go to something like path/subpath/random_file.php

Share this post


Link to post
Share on other sites

Hey there, I'm new to this module but I was having some issues with * s for redirecting with the old redirect module and am having the same issue with this module as well. Has something changed in pw that is making this functionality no longer work? Not quite sure what to test.

Redirect path           New path
path/subpath/*         /newPath

this was working great a couple processwire versions ago, but now I just get 404s when I try to go to something like path/subpath/random_file.php

Hi MuchDev,

The asterisk wildcard was not part (and probably still is not part, haven't actually checked) of the original ProcessRedirects shipped via the modules directory. That was one of the reasons I did not include the functionality.

However, and more importantly, it's sometimes hard to tell what that wildcard implies. Sure, when used at the end of a path, it means "everything until the end", but, when used in the middle, does it represent 1 segment, or all segments? It could catch paths that were not meant to be caught.

I may look at implementing a proper solution for the importer to detect these, but that won't be soon.

As a recommendation, swap out the asterisk wildcards with {all} - this is a good base level. So, in your case:

    Source: path/subpath/{all}

    Destination: newPath

Have a look at the documentation on wildcards and smart wildcards - Jumplinks doesn't use regular expressions or asterisk wildcards.

There's also a new wiki page containing examples.

  • Like 1

Share this post


Link to post
Share on other sites

{all} is exactly what I was looking for. I must have hacked something in based on an example a while back and forgot about it. The paths are only ever one segment but they sometimes come in as /oldPath/subPath/oldFile.php or just /oldPath/subPath/ and I want both of those to just redirect to /newPath/.

Thanks for this great module and the help with this :).

  • Like 1

Share this post


Link to post
Share on other sites

Hi Guys, 

For some reason I cannot get JumpLinks 404 monitor to work, everything else is working and the CMS notifications show 404's but JumpLinks is not displaying the list of received 404's

Anyone have an idea why this could be? 

I am running PW 2.6.1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Robin S
      Repeater Images
      Adds options to modify Repeater fields to make them convenient for "page-per-image" usage. Using a page-per-image approach allows for additional fields to be associated with each image, to record things such as photographer, date, license, links, etc.
      When Repeater Images is enabled for a Repeater field the module changes the appearance of the Repeater inputfield to be similar (but not identical) to an Images field. The collapsed view shows a thumbnail for each Repeater item, and items can be expanded for field editing.
      Screencast

      Installation
      Install the Repeater Images module.
      Setup
      Create an image field to use in the Repeater field. Recommended settings for the image field are "Maximum files allowed" set to 1 and "Formatted value" set to "Single item (null if empty)". Create a Repeater field. Add the image field to the Repeater. If you want additional fields in the Repeater create and add these also. Repeater Images configuration
      Tick the "Activate Repeater Images for this Repeater field" checkbox. In the "Image field within Repeater" dropdown select the single image field. You must save the Repeater field settings to see any newly added Image fields in the dropdown. Adjust the image thumbnail height if you want (unlike the core Images field there is no slider to change thumbnail height within Page Edit). Note: the depth option for Repeater fields is not compatible with the Repeater Images module.
      Image uploads feature
      There is a checkbox to activate image uploads. This feature allows users to quickly and easily add images to the Repeater Images field by uploading them to an adjacent "upload" field.
      To use this feature you must add the image field selected in the Repeater Images config to the template of the page containing the Repeater Images field - immediately above or below the Repeater Images field would be a good position.
      It's recommended to set the label for this field in template context to "Upload images" or similar, and set the visibility of the field to "Closed" so that it takes up less room when it's not being used. Note that when you drag images to a closed Images field it will automatically open. You don't need to worry about the "Maximum files allowed" setting because the Repeater Images module overrides this for the upload field.
      New Repeater items will be created from the images uploaded to the upload field when the page is saved. The user can add descriptions and tags to the images while they are still in the upload field and these will be retained in the Repeater items. Images are automatically deleted from the upload field when the page is saved.
      Tips
      The "Use accordion mode?" option in the Repeater field settings is useful for keeping the inputfield compact, with only one image item open for editing at a time. The "Repeater item labels" setting determines what is shown in the thumbnail overlay on hover. Example for an image field named "image": {image.basename} ({image.width}x{image.height})  
      https://github.com/Toutouwai/RepeaterImages
      https://modules.processwire.com/modules/repeater-images/
    • By EyeDentify
      Hello There Guys.

      I am in the process of getting into making my first modules for PW and i had a question for you PHP and PW gurus in here.

      I was wondering how i could use an external library, lets say TwitterOAuth in my PW module.
      Link to library
      https://twitteroauth.com/

      Would the code below be correct or how would i go about this:
      <?PHP namespace ProcessWire; /* load the TwitterOAuth library from my Module folder */ require "twitteroauth/autoload.php"; use Abraham\TwitterOAuth\TwitterOAuth; class EyeTwitter extends WireData,TwitterOAuth implements Module { /* vars */ protected $twConnection; /* extend parent TwitterOAuth contructor $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token, $access_token_secret); */ public function myTwitterConnection ($consumer_key, $consumer_secret, $access_token, $access_token_secret) { /* save the connection for use later */ $this->twConnection = TwitterOAuth::__construct($consumer_key, $consumer_secret, $access_token, $access_token_secret); } } ?> Am i on the right trail here or i am barking up the wrong tree?
      I don´t need a complete solution, i just wonder if i am including the external library the right way.
      If not, then give me a few hint´s and i will figure it out.

      Thanks a bunch.

      /EyeDentify
    • By dimitrios
      Hello,
      this module can publish content of a Processwire page on a Facebook page, triggered by saving the Processwire page.
      To set it up, configure the module with a Facebook app ID, secret and a Page ID. Following is additional configuration on Facebook for developers:
      Minimum Required Facebook App configuration:
      on Settings -> Basics, provide the App Domains, provide the Site URL, on Settings -> Advanced, set the API version (has been tested up to v3.3), add Product: Facebook Login, on Facebook Login -> Settings, set Client OAuth Login: Yes, set Web OAuth Login: Yes, set Enforce HTTPS: Yes, add "http://www.example.com/processwire/page/" to field Valid OAuth Redirect URIs. This module is configurable as follows:
      Templates: posts can take place only for pages with the defined templates. On/Off switch: specify a checkbox field that will not allow the post if checked. Specify a message and/or an image for the post.
      Usage
      edit the desired PW page and save; it will post right after the initial Facebook log in and permission granting. After that, an access token is kept.
       
      Download
      PW module directory: http://modules.processwire.com/modules/auto-fb-post/ Github: https://github.com/kastrind/AutoFbPost   Note: Facebook SDK for PHP is utilized.


    • By kongondo
      FieldtypeRuntimeMarkup and InputfieldRuntimeMarkup
       
      Modules Directory: http://modules.processwire.com/modules/fieldtype-runtime-markup/
      GitHub: https://github.com/kongondo/FieldtypeRuntimeMarkup
      As of 11 May 2019 ProcessWire versions earlier than 3.x are not supported
      This module allows for custom markup to be dynamically (PHP) generated and output within a page's edit screen (in Admin).
       
      The value for the fieldtype is generated at runtime. No data is saved in the database. The accompanying InputfieldRuntimeMarkup is only used to render/display the markup in the page edit screen.
       
      The field's value is accessible from the ProcessWire API in the frontend like any other field, i.e. it has access to $page and $pages.
       
      The module was commissioned/sponsored by @Valan. Although there's certainly other ways to achieve what this module does, it offers a dynamic and flexible alternative to generating your own markup in a page's edit screen whilst also allowing access to that markup in the frontend. Thanks Valan!
       
      Warning/Consideration
      Although access to ProcessWire's Fields' admin pages is only available to Superusers, this Fieldtype will evaluate and run the custom PHP Code entered and saved in the field's settings (Details tab). Utmost care should therefore be taken in making sure your code does not perform any CRUD operations!! (unless of course that's intentional) The value for this fieldtype is generated at runtime and thus no data is stored in the database. This means that you cannot directly query a RuntimeMarkup field from $pages->find(). Usage and API
       
      Backend
      Enter your custom PHP snippet in the Details tab of your field (it is RECOMMENDED though that you use wireRenderFile() instead. See example below). Your code can be as simple or as complicated as you want as long as in the end you return a value that is not an array or an object or anything other than a string/integer.
       
      FieldtypeRuntimeMarkup has access to $page (the current page being edited/viewed) and $pages. 
       
      A very simple example.
      return 'Hello'; Simple example.
      return $page->title; Simple example with markup.
      return '<h2>' . $page->title . '</h2>'; Another simple example with markup.
      $out = '<h1>hello '; $out .= $page->title; $out .= '</h1>'; return $out; A more advanced example.
      $p = $pages->get('/about-us/')->child('sort=random'); return '<p>' . $p->title . '</p>'; An even more complex example.
      $str =''; if($page->name == 'about-us') { $p = $page->children->last(); $str = "<h2><a href='{$p->url}'>{$p->title}</a></h2>"; } else { $str = "<h2><a href='{$page->url}'>{$page->title}</a></h2>"; } return $str; Rather than type your code directly in the Details tab of the field, it is highly recommended that you placed all your code in an external file and call that file using the core wireRenderFile() method. Taking this approach means you will be able to edit your code in your favourite text editor. It also means you will be able to type more text without having to scroll. Editing the file is also easier than editing the field. To use this approach, simply do:
      return wireRenderFile('name-of-file');// file will be in /site/templates/ If using ProcessWire 3.x, you will need to use namespace as follows:
      return ProcessWire\wireRenderFile('name-of-file'); How to access the value of RuntimeMarkup in the frontend (our field is called 'runtime_markup')
       
      Access the field on the current page (just like any other field)
      echo $page->runtime_markup; Access the field on another page
      echo $pages->get('/about-us/')->runtime_markup; Screenshots
       
      Backend
       

       

       
      Frontend
       

×
×
  • Create New...