Recommended Posts

That does sound like a great idea indeed. Ever think we'd have any validation issues? (May not even be a valid question - just popped into my head as I was thinking "raw import".)

Also, surely this would only apply to WP sites that are not URL-friendly? Or does Google also happen to index those horrid ?p={id} things anyway?

Share this post


Link to post
Share on other sites

I just looked a a single example Wordpress site, which happend to have the pretty url in the canonical tag. So google shouldn't know about the ugly ones as long as you're using only pretty urls.

Share this post


Link to post
Share on other sites

Well it's just that WP URL's often have the date in the URL and there are a few different format options. Of course this could be replicated in PW, but typically it isn't, so I was mostly wanting to redirect from the pretty WP format to the PW format.

Share this post


Link to post
Share on other sites

So, we'd be looking to redirect /2015/01/hello-world to /blog/hello-world, for example?

Would a simple call like this suffice:

$jumplinks = $modules->get('ProcessJumplinks');
$jumplinks->add('{year}/{month}/{path}','blog/{path}');

--

Side note: would you mind renaming this topic to "Module: Jumplinks" and moving it up to "Modules/Plugins"? (also, I think the tags should go...)

I just don't want to open up a new topic when I release the final.

  • Like 1

Share this post


Link to post
Share on other sites

So, we'd be looking to redirect /2015/01/hello-world to /blog/hello-world, for example?

Would a simple call like this suffice:

$jumplinks = $modules->get('ProcessJumplinks');
$jumplinks->add('{year}/{month}/{path}','blog/{path}');

--

Side note: would you mind renaming this topic to "Module: Jumplinks" and moving it up to "Modules/Plugins"? (also, I think the tags should go...)

I just don't want to open up a new topic when I release the final.

Actually, I think you are right. Although there might need to be a slight variation on that, depending on the WP source format.

I hadn't ever looked at the canonical link info, so knowing that is set up correctly, I guess we don't need to worry about those ID based links - guess there really isn't much to do afterall :)

PS the "k" man beat me to moving this thread! 

Share this post


Link to post
Share on other sites

Actually, I think you are right. Although there might need to be a slight variation on that, depending on the WP source format.

I hadn't ever looked at the canonical link info, so knowing that is set up correctly, I guess we don't need to worry about those ID based links - guess there really isn't much to do afterall :)

PS the "k" man beat me to moving this thread! 

There would indeed - you'd have to parse that out for each segment, and then send it off to Jumplinks.

Does the migrator automatically handle URI changes? (I may just be having a blonde moment here...)

Share this post


Link to post
Share on other sites
Does the migrator automatically handle URI changes? 

Sorry - not sure what you mean here - changes from when till when? Sorry, now I think I am the one having the blonde moment :)

Share this post


Link to post
Share on other sites

Sorry - not sure what you mean here - changes from when till when? Sorry, now I think I am the one having the blonde moment :)

Got confused because you asked for a feature, and with good reason, and then you said it's not needed any more. For some reason, or the other, I assumed that the migrator handles old/new URIs and redirects accordingly... (I haven't used the module, so I don't know it's feature-set.)

Or I'm missing something  :huh:

Share this post


Link to post
Share on other sites

First post cleaned up as documentation is [mostly] ready.

Module is now stable, from what I can tell, though v1 can only be released when PW 2.6 is released. (I'm assuming this is still a little while away... yes?)

  • Like 2

Share this post


Link to post
Share on other sites

Yeah, I did see that - just thought maybe someone could throw in a few hints. ;-)

Because the module is pretty much done, and ready for release (I've even just made a few screencasts which I'll upload in the morning), I'm now wondering (again) if I should make this compatible with 2.5. I guess I jumped over to the 2.6-requirement because I just love the new ModuleConfig. But, I'm sure there are quite a few people who won't be moving over to 2.6 immediately, and that would like to use Jumplinks. So I think I'll just do it.

  • Like 1

Share this post


Link to post
Share on other sites

I would probably keep this 2.6 only. Most use is when releasing new site, so probably most usage will be with latest and greatest ;)

Share this post


Link to post
Share on other sites

I would probably keep this 2.6 only. Most use is when releasing new site, so probably most usage will be with latest and greatest ;)

Indeed, though it's a bit late. Done already. Hehe! And it works with 2.6

_________

Last round of bug-hunting (help would be awesome) before I release v1 tomorrow morning.

  • Like 1

Share this post


Link to post
Share on other sites

@adrian - I have added an API method, I'm sure it will come in handy.

$this->modules->ProcessJumplinks->add(string $source, string $destination, string $start = '', string $end = '')

I think that the WP migrator module should check the permalink format being used (%year%/%monthnum%/%postname%/, for example) and convert it to the Jumplinks-equivalent ({year}/{month}/{name}/, in this case).

  • Like 3

Share this post


Link to post
Share on other sites

Some issues have popped up (regarding timestamps, paths in Windows, execute hyphens, etc) and, thanks to Dave's help in finding them, they have been fixed. Also rolled back to Beta (bumped to 1.0.2 - leaving the version in v1 state) in case any more anomalies pop up.

  • Like 1

Share this post


Link to post
Share on other sites

I'll need to look into this... not sure what's making it require PHP 5.5...

(Going to quickly test on an 5.4, and 5,3 to see what the problem could be.)

Share this post


Link to post
Share on other sites

Ah, it seems that empty() is the culprit here, requiring write access to its argument.

Have pushed the fix to the repo. Works on 5.4 now. (As for 5.3, I don't know yet, but it could well just be fine.)

  • 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 Anssi
      A simple module to enable easy navigation between the public and the admin side of the site. After installation a green bar will appear to the upper side of the screen, containing a few navigation elements and displaying the PW version number.
      Heavily inspired by @apeisa's great AdminBar (Thanks!). I needed a bit simpler tool for my projects and as a result, this was made. Available on GitHub .

    • By Sebi
      I've created a small module which lets you define a timestamp after which a page should be accessible. In addition you can define a timestamp when the release should end and the page should not be accessable any more.
      Github: https://github.com/Sebiworld/PageAccessReleasetime
      Usage
      PageAccessReleasetime can be installed like every other module in ProcessWire. Check the following guide for detailed information: How-To Install or Uninstall Modules
      After that, you will find checkboxes for activating the releasetime-fields at the settings-tab of each page. You don't need to add the fields to your templates manually.
      Check e.g. the checkbox "Activate Releasetime from?" and fill in a date in the future. The page will not be accessable for your users until the given date is reached.
      If you have $config->pagefileSecure = true, the module will protect files of unreleased pages as well.
      How it works
      This module hooks into Page::viewable to prevent users to access unreleased pages:
      public function hookPageViewable($event) { $page = $event->object; $viewable = $event->return; if($viewable){ // If the page would be viewable, additionally check Releasetime and User-Permission $viewable = $this->canUserSee($page); } $event->return = $viewable; } To prevent access to the files of unreleased pages, we hook into Page::isPublic and ProcessPageView::sendFile.
      public function hookPageIsPublic($e) { $page = $e->object; if($e->return && $this->isReleaseTimeSet($page)) { $e->return = false; } } The site/assets/files/ directory of pages, which isPublic() returns false, will get a '-' as prefix. This indicates ProcessWire (with activated $config->pagefileSecure) to check the file's permissions via PHP before delivering it to the client.
      The check wether a not-public file should be accessable happens in ProcessPageView::sendFile. We throw an 404 Exception if the current user must not see the file.
      public function hookProcessPageViewSendFile($e) { $page = $e->arguments[0]; if(!$this->canUserSee($page)) { throw new Wire404Exception('File not found'); } } Additionally we hook into ProcessPageEdit::buildForm to add the PageAccessReleasetime fields to each page and move them to the settings tab.
      Limitations
      In the current version, releasetime-protected pages will appear in wire('pages')->find() queries. If you want to display a list of pages, where pages could be releasetime-protected, you should double-check with $page->viewable() wether the page can be accessed. $page->viewable() returns false, if the page is not released yet.
      If you have an idea how unreleased pages can be filtered out of ProcessWire selector queries, feel free to write an issue, comment or make a pull request!
    • By David Karich
      Thanks to the great Pro module "RepeaterMatrix" I have the possibility to create complex repeater items. With it I have created a quite powerful page builder. Many different content modules, with many more possible design options. The RepeaterMatrix module supports the cloning of items, but only within the same page. Now I often have the case that very design-intensive pages and items are created. If you want to use this module on a different page (e.g. in the same design), you have to rebuild each item manually every time.
      With this proof of concept I have created a module which adds the feature to copy a repeater item to the clipboard so that you can paste this item to another page with the same repeater field. The module has been developed very rudimentarily so far. It is currently not possible to copy nested items. There is also no check of Min/Max. You can also only copy items that have the same field on different pages. And surely you can solve all this more elegantly with AJAX. But personally I lack the deeper understanding of the repeaters. Also missing on the Javascript side are event triggers for the repeaters, which would make it easier. Like e.g. RepeaterItemInitReady or similar.
      it would be great if @ryan would implement this functionality in the core of RepeaterMatrix. I think he has better ways to implement this. Or what do you think, Ryan?
      Everybody is welcome to work on this module and improve it, if it should not be integrated into the matrix core. Therefore I put it for testing and as download on GitHub: https://github.com/FlipZoomMedia/InputfieldRepeaterMatrixDublicate
      You can best see the functionality in the screencast: 
       
    • By anderson
      Hi,
      Please take a look at this:
      https://templatemag.com/demo/Good/
      The upper nav bar, including dropdowns like "pages" and "portfolios", what do you call this whole thing? At first I guess it's called "dropdown nav bar", but seems not.
      AND of course, what's the simplest way/module to achieve this in PW?
      Thanks in advance.
    • By Sebi2020
      Hey, I'm new and I created a simple module for tagging pages because I didn't found a module for it (sadly this is not a core feature). This module is licensed under the GPL3 and cames with absolutly no warranty at all. You should test the module before using it in production environments. Currently it's an alpha release. if you like the module or have ideas for improvements feel free to post a comment. Currently this fieldtype is only compatible with the Inputfield I've created to because I haven't found  an Inputfield yet, that returns arrays from a single html input.
      Greetings Sebi2020
      FieldtypeTags.zip.asc
      InputfieldTagify.zip
      InputfieldTagify.zip.asc
      FieldtypeTags.zip