Jump to content
joshuag

Drupal vs Processwire

Recommended Posts

gotta love wordprass

sometimes known as wordprat

Share this post


Link to post
Share on other sites

Greetings,

WillyC: I disagree. The potential clients who say this are not developers. True, they start off asking to do this or that, but then they poke around and Google about websites. When they do that, WordPress makes a dominant appearance.

Developers would know better once I showed them ProcessWire!

Thanks,

Matthew

Share this post


Link to post
Share on other sites
Developers would know better once I showed them ProcessWire!

yeah, no doubt. PW isn't a hard sell to a dev.

I've had both types of clients. Ones who are more concerned about the results and not the platform and ones that specifically want to use a platform like Drupal or WP.

I've never had one flip though. I'm not "selling" them PW. I don't even mention PW to a low tech client, I just tell them I'm building them a custom website with the features they are requesting and give them a price as Willy C mentioned. 

I will mention PW to a client who's more tech savvy. In that case I usually give them a 2-3 choices with a quick pro/con list and ballpark prices along with my personal recommendation. Then I let them choose. If price is a concern and it usually is, they will choose the cheapest platform that meets their needs, which is PW in most cases. 

Matthew, I'm sure you've tried these approaches and found your current approach to be the most beneficial to you. It just seems like such a struggle to me. I can tell you are a smart person though, and in this case, I think you would know best. I'm not trying to hassle you and i'll shut up now.  ;)  

  • Like 1

Share this post


Link to post
Share on other sites
WillyC has a great point.

I think you mean fantastic beard. Ha! Of course he could use a fantastic pair of oversized sunglasses to complement that beard.

Share this post


Link to post
Share on other sites

[quitamos]WillyC has a great point. [/quotamos]

this what.all ladies say

aboute me

when they.got close

  • Like 2

Share this post


Link to post
Share on other sites

Greetings,

Well, one of the ideas of using ProcessWire (in my mind) is to try and talk to people about the benefits of this system over "the big three."  I actually think that's important, because ProcessWire is a terrific system and deserves to be used in place of the big three as much as possible.

As we all know, there are many different categories of clients.

There are clients who essentially ask us to develop their plan and use whatever system we want.  They don't even care or know anything about different systems. They just know results.  In those cases, ProcessWire is the easy path.

There are clients who are already tied into another system (like Drupal or WordPress) but they let us know up front they are open to moving to a new and more flexible platform.  These are also easy ProcessWire projects.

Then there are those clients who are sort of "fishing around" and don't quite know what they want.  They talk to us, and get pretty far in the discussion, then make decisions about a system.  This is the category I was referring to earlier.  To summarize: these are clients who are sort of learning in the process of discussing things with you.  My problem is, I get excited about a project too early.  Now, I totally agree with one of sshaw's comments above that I should streamline my early discussions so I don't invest too much time with these sorts of clients.

Thanks,

Matthew

  • Like 1

Share this post


Link to post
Share on other sites
Well, one of the ideas of using ProcessWire (in my mind) is to try and talk to people about the benefits of this system over "the big three."  I actually think that's important, because ProcessWire is a terrific system and deserves to be used in place of the big three as much as possible.

Well said, this resonates with me and I suspect if you told me why these things are important to you I may share some of your values. I think this statement could be further developed into a very effective personal branding statement. Your branding statement will help connect to the types of clients you are looking for.

http://www.entrepreneur.com/article/228631#ixzz2hNV6MBNo

My problem is, I get excited about a project too early.

Haha, yep, I've done that.

  • Like 1

Share this post


Link to post
Share on other sites

Well said, this resonates with me and I suspect if you told me why these things are important to you I may share some of your values. I think this statement could be further developed into a very effective personal branding statement. Your branding statement will help connect to the types of clients you are looking for.

I learned to appreciate PHP via frameworks (mostly CodeIgniter, but also some time with Yii, Laravel, and Symfony).  More recently, I've come to appreciate CakePHP.  All of those frameworks provide great power for making complex apps.  But the syntax can sometimes be a bit opaque.  At the same time, I was also using Joomla (with a thing called Seblod, which promises to turn Joomla into an app builder).  I could not wait to drop Joomla.

Then I discovered ProcessWire last fall, and right away it seemed to me that it offered the same power as the PHP frameworks, but with crystal-clear syntax.  At first, I thought for sure there had to be a lack of depth for ProcessWire to be that clear, but at every turn I've found that ProcessWire provides depth very close to what's needed for most apps, while maintaining clear syntax (or to borrow a word thrown around in Laravel circles, "expressive" syntax).

To me, ProcessWire immediately felt like a framework, because it makes no assumptions about how "themes" need to be constructed, and because it has nicely defined API methods for doing everything in code.  Having also come from the Joomla world, and having also spent a bit of time with Drupal and WordPress, I was curious about ProcessWire positioning itself as a "CMS."  As I said, it seemed to be more comparable to frameworks.

Back to your point: people who just want drag-and-drop site building won't use ProcessWire very much.  ProcessWire is not equivalent to that kind of system.  But ProcessWire can pull in people from Drupal, WordPress, and Joomla who want to customize those "big three" CMSs and are frustrated by assumptions those systems make.  I know there are a good number of people in this position in all three big CMSs.  They can use ProcessWire like a framework, and get the CMS capabilities they look for.  I don't know exactly what segment of the big three is represented by this description, but I know from experience they are there.

Thanks,

Matthew

  • Like 6

Share this post


Link to post
Share on other sites
people who just want drag-and-drop site building won't use ProcessWire very much.  ProcessWire is not equivalent to that kind of system.

ParsimonySiteCake and ImpressPages are good for drag & drop, however PW could be a drag and drop system. Sign up for a squarespace demo. You can build something as robust as that using PW. They have three edit modes... admin w/ a page tree like PW, style editor, and layout editor. PW only needs the layout editor. The style editor could be built with existing fields. There's a great realtime css editor that works like the squarespace css editor, and it's free, if only I could remember what it was called. The squarespace layout editor is pretty nice and it would be awesome to have something like it for PW. Eventually I'll build one, but that's such a low priority it may never get done. 

I agree with your post, but I think what I was after was something more personal, basically I want to get to know you, as a person, "what makes Matthew tick?". That's what helps build trust and an emotional bond. Through our dialog I'm getting to know you better, but when you are interacting with new clients, you don't have as much time to create a bond with them. If you don't make the connection what's to stop them from finding someone else they bond with to do the work? PW is freely available to everyone, so you have no competitive advantage there... and PW is only as great as the developer using it. You smell what i'm steppin' in? The value to the client is YOU, your skills, your intelligence, your appreciation for quality and your concern for the needs of your clients. Any schmuck can build a website, whether it's built in PW, WP, Drupal, etc. What makes YOU different? I think if you addressed this, you'd be more successful with the type of clients that recently chose other platforms. Maybe even ask the other two if they chose the developer or if they chose the platform. Probably a little of both, but the feedback would be invaluable to you. Better than any feedback a long winded blowhard like myself could give you.

  • Like 3

Share this post


Link to post
Share on other sites

@joshuag:

Just happened to read this thread. Thanks for HTML KickStart ! Very nice! That might be helpful in the future - bookmarked it. (...lazy man always happy to have tools that save work ;))

  • Like 1

Share this post


Link to post
Share on other sites

I like Drupal as out of the box working cms solution with great modules, but it uses a lot of generated source code and styles (works fine, but isn't always nice...). Some changes are difficult without a deep look at the generated html and css.

Processwire is a clean and powerful framework with really great api, but you have to take care of the features and the output (html, css). That isn't a disadvantage! It's more work to do, but final you get what you want...

Processwire and maybe also a lot of the modules are designed for programmers which build own applications an top of it.

Maybe some ready to use modules (with configuration page, useable/ nice templates,...) could make PW even more interesting for Drupal, Joomla and Wordpress users. 

For example...

  • login/ register/ reset password (frontend members)
  • image resize filter with colorbox integration (show image as thumbnail / custom size image with link to original image inside a colorbox)
  • tags, archive (parts for a "simple" blog module)
  • native forum or a strong integration (for community building)

I know all examples are possible and most can be found as snippets here in the forums! But beginners would be happy to get such modules ready to use from the pw module repo ;)

  • Like 1

Share this post


Link to post
Share on other sites

it is true that the more sites you build with PW the better you get at using it and thinking in terms of a collaboration between yourself and the api, and the more you read the forum, view the source code of the profiles, modules etc, you are constantly improving and becoming less of a 'beginner', but that term also implies that PW is comparable to the big 3 (and that eventually when you are no longer a beginner you'll be able to achieve those things in the same time as you would in W/J/D), and as Ryan recently pointed out, it's really not, and probably will never be something that can be compared 1-to-1 with those fully interfaced options. The more you know about and work with PW, the more you come to realize that there really couldn't be a generic frontend user management 'module' since the needs of any such system would be unique to the business/application logic of that project.

The productivity and simplicity that the clients get through having their site be 100% custom in terms of both the front and backend is really priceless, and that extra time it might take to build something custom as opposed to using a pre-built component/module/plugin pays off over and over again for years to come.

I have built a lot of sites with Joomla and a few sites with Wordpress. In 90% of those sites (that are stuck on those CMS) the clients still regularly contact me to perform content management work, because as simple as they might seem to techies, they are incredibly confusing and complex for the average user especially those people who update their site only once in a long while. When i compare that to the processwire sites built for clients, the result is that none of them ever contact me for content management, they can do it themselves, none of them break their sites, or destroy the formatting or look of the pages through gross violations of the wysiwyg...

so my response to your post would be of course, it would be great if someone could write those modules, but I think they would need to be subsidized... maybe start a kickstarter campaign for whichever one you think is most helpful?

  • Like 7

Share this post


Link to post
Share on other sites

Hi Macrura,

thanks for your answer. Liked to read it. 

I have build few sites with Drupal. Works fine for me with modules like views, views accordion, field slideshow, colorbox (...), but it isn't 100% what I want.

So I have take a look at modx and later PW, because I'd like more flexibility and access to the output (html, css). 

Because of the create API and documentation (API, Forums,...) I tried to build a slideshow (cycle2, colorbox), accordion (based on pages, tags as cagegories/ accordion headers and jquery plugin). I get it work with a few lines of code and that's really awesome!

That's why I choose PW to go deeper into programming (own applications and pw modules).

Some more default modules (with simple basic templates) could be a nice starting point.

Because default modules missing I try to build my own modules and get some knowledge how to work with PW and programming modules ;)

Share this post


Link to post
Share on other sites

but you have to take care of the features and the output (html, css). That isn't a disadvantage! It's more work to do, but final you get what you want...

Processwire gives you all the freedom where others don't. That's why we all are here. The only work that needs to be done is to invest time to learn how to setup templates and replace html tags with api/php calls. Processwire is the only cms that I know where you can build websites so close to the core. It is almost a low level coding cms. That's why you can also use it as a cmf and application builder. Processwire has no cms walls. The more you get experienced the more processwire let you do with it.

But beginners would be happy to get such modules ready to use from the pw module repo

Do you mean beginners who want to grow into experienced website builders or beginners who need more typical modules available ?

Yes I think processwire would become more popular in the market if there are more typical modules available to setup an out of the box website that would meet with todays popular possibilities - forums - chats - picture galleries - rotating banners - forms - front end users - registers - password reset - etc. etc.

Maybe an idea to build such a website with processwire and make it public available as a profile ?

Share this post


Link to post
Share on other sites

One interesting thing about working with ProcessWire is that since you have to program in your own bells and whistles, rather than just installing some extension, it makes you pause and think whether you actually need them or not.

The trouble with Drumlapress is that it is easy to just hit buttons and add things - so you do**

Web design, like any sort of creative discipline, should be about the minimal. Even Van Gogh with his layers of oil was minimal - we don't know what he MIGHT have added to his pictures, but we do know that what he did put in he meant to put in.

Oil painting is slower than sketching (especially for a lazy bugger like Van Gogh) and there was no way he was going to shove in anything that didn't work for its living.

And so it is with ProcessWire. 

PW is not hard, but it requires you to actually do some work rather than hit buttons like most CMSs, and that makes the lazy ones of us take our time, keep it simple, and make sure we only put in things that actually need to be there.

---------------------------------

EDIT

I added two asterisks above and forgot to put why! So ....

** The situation has been slightly alleviated since, in Joomla at least, so many of the extension updates are now commercial (even some of the ones that really shouldn't be!)

  • Like 5

Share this post


Link to post
Share on other sites

Hi pwired,

Do you mean beginners who want to grow into experienced website builders

Yes. Use some popular modules (login, forum, contact form,...) to do the usual sites and than build the application with own code.

Maybe an idea to build such a website with processwire and make it public available as a profile ?

A profile works out of the box, but I prefer small modules (necessary functions/ features with basic templates) which should be simpler to integrate into the application / own code.

PW is not hard, but it requires you to actually do some work rather than hit buttons like most CMSs, and that makes the lazy ones of us take our time, keep it simple, and make sure we only put in things that actually need to be there.

Ok, but why should everybody write an own login, user profile, ... script?  A simple module as common and as stable tested starting point (customize templates, plugin additional features,...) should save some time for everybody (notably beginners). 

Yes it's easier to lern PW instead of "Drumlapress"  :biggrin: but why should everybody reinvent the wheel? If I write a login module I'll reuse it - maybe with modifications - but don't write it again from scratch ;)

Share this post


Link to post
Share on other sites

the reason why i think it would be better to have site profile instead of modules is because i think it's better to learn by example rather than rely on some magic module..

Share this post


Link to post
Share on other sites

Modules ain't magic. They are actually very simple (Ie. I haven't build single module/plugin for any other software ever).

Share this post


Link to post
Share on other sites

I love modules, cause they're simple to use & your template will look so much cleaner. Next, it's more portable.

Share this post


Link to post
Share on other sites

Modules ain't magic. They are actually very simple (Ie. I haven't build single module/plugin for any other software ever).

Yes, I read some information about PW module development and it sounds really simple and easy! In comparison with PW the Drupal module development seems to be difficult and a lot of work. The great PW API simplify it. To create a PW module the API documentation, a little bit php and html & css (design) is needed. 

I love modules, cause they're simple to use & your template will look so much cleaner. Next, it's more portable.

 
Yes! Really easy module structure and a powerful cmf. That's why I decided to start with PW, because I haven't build a module before and would like to learn it. 

Share this post


Link to post
Share on other sites
Modules ain't magic. They are actually very simple (Ie. I haven't build single module/plugin for any other software ever).

yes of course, but it could seem that way to the 'beginners' who won't then be able to adapt the module to their site's logic;

so i'm suggesting to have a site profile (that may include modules) where the full logic of the relations of fields-templates-modules can be studied and then reworked to the developer's needs;

  • Like 2

Share this post


Link to post
Share on other sites

Macrura - you could create one and put it up for everyone :)

Share this post


Link to post
Share on other sites

It's unlikely a single module will provide everything everyone will need for a login/registration system, because everyone's interpretation of its requirements will be different every time.

  • Will users use email or usernames?
  • What other details do you need to capture about the user?
  • What validation needs to happen on these extra fields?
  • Do people need to validate their email addresses, or do accounts have to be approved manually?
  • What security roles and settings need to be applied?
  • Where do people log in? Is there going to be a "remember me" option?
  • What happens if they forget their password?
  • What if there's a third-party backend system that the authentication needs to tie in to?

Those are just some of the considerations I can think of based on my experience of building similar bits of functionality in the past. With the frameworks and CMSs I've used, I can't remember very many of them them that have been flexible enough "out of the box" to do what I needed without having to hack where I shouldn't, or ended up with me writing my own methods to replace theirs.

To pick an example. I mainly use CodeIgniter, and have done for a long time. One of the "ready-made" libraries for users is called Ion_Auth (or something like that). In every application I've written with CI, it has never been a good fit because the application demanded either much more or a lot less; or I didn't like the way it handled a certain part.

The API is already there in ProcessWire, you just have to utilise it in your template files to suit the website being developed. There really isn't much to it, and because of that, any module that did try to cater for it would either only cater for a particular type of site; or it would be overly complex and force developers into its own way of working - rather than the other way round.

In lots of other systems, you have to get modules and plugins for just about everything that isn't in a WYSIWYG box, because the core system is too inflexible to let you do "stuff" any other way. With ProcessWire, the API is completely open to use how you want to use it.

One of the reasons I dislike Drumlapress is for the plugin-for-everything mentality. Need to split out some images in a carousel? Install plugin X. Want to put some images in a gallery page? Install another plugin Y; and never the two shall meet (because when they do, their javascripts conflict, and the back-ends are totally separate...). Several months later you might want to put some of those on a map. Oh, that will be a separate plugin Z that doesn't really work with X or Y.

And then you update Drumlapress to the next version because of a major security flaw (again). Plugin X is fine, but plugin Y breaks because it's not compatible with the latest version. And then your website is broken. :)

  • Like 7

Share this post


Link to post
Share on other sites

and never the two shall meet (because when they do, their javascripts conflict,

Yes this is a big problem when you find javascript snippets and bring them in your website. Many times I had buttons disappear, banner rotators seen stopping, or layouts seen change and lost many hours to find the specific line in the javascript code with the colliding code. This also happens if the javascript calls for it's own css that can conflict with another css that is called on the same current webpage. Debugging again and give some html tag another id name to avoid code collision. Makes me wonder how do you guys avoid this from the beginning ? Give everything unique id's or don't use snippets found with google ? I guess there must be a safe way of doing this.

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By pwuser1
      First I am a PW student I think it's the best PHP Framework.  So please don't get me wrong when I asked when other Frameworks like the big 3 (Wordpress, Joomla, Drupal) are too complicated to use or maintain (I tried them all) why are people still using them? PW is just too elegant in comparison even for a newbie like me.
    • By kreativmonkey
      Hi,
      i want to import stuff from Drupal to Processwire and have create an importscript but some things doesn't work.
      I import a list of questions from users and i will manipulate the page created date (thats work fine) and change the User to the right one. If the User dosn't exist, i will creat a new one. But this is the first problem i have, no user will be change or create...
      The second problem is to find out if the page does alrady exist or not. If the Page exist i will only modify some fields, otherwise i will create a new page.....
      To find out if the Page exist and whats the Page ID do i also need to import the Comments.....
      readCSV.php:
      // Read the CSV file and get an array of rows function readCSV($file){ $lines = array(); foreach(file($file, FILE_IGNORE_NEW_LINES) as $line){ $lines[] = str_getcsv($line); } return $lines; } import.php:
      while($i < $countArray){ // Initzalisierung der Variablen $title = $data[$i][0]; $date = $data[$i][6]; #$summary = ''; $body = $data[$i][1]; $categorys = $data[$i][4]; $tags = $data[$i][3]; #$images = ''; $authorName = $data[$i][5]; $sanitizTitle = $sanitizer->pageName($title); $post = $pages->get("template=$template, name=$sanitizTitle"); if(empty($post)){ $p = new Page(); // create new page object $p->template= $template; //set template post $p->parent = wire('pages')->get('/$parent/'); //set the parent $p->name = $sanitizTitle; // SANITIZE!!!! $p->title = $title; // added by Ryan: save page in preparation for adding files (#1) $p->save(); $p->created = $date; // Timestamp!!! $p->save(array('quiet' => true)); // To save the created Date $p->body = $body; // $p->summary = $summary; // Looking for the inizialisation $p->tags = $tags; $p->categories = $categorys; $p->save(); echo 'Created Page: '. $title .'<br>'; $authorNameSanitiz = $sanitizer->name($authorName); if($users->get($authorNameSanitiz)){ $authorID = $users->get($authorNameSanitiz); $p->createdUser->name = $authorID; } else { $u = new User(); $u->name = $authorNameSanitiz; $u->addRole("author"); $u->addRole("guest"); $u->save(); echo 'creat User: '. $authorName .'<br>'; $authorID = $users->get($authorNameSanitiz); $p->createdUser = $authorID; } $p->save(); #} // populate fields //$p->images->add('path/to/image1.jpg'); // add multiple to images field $i++; } The CSV:
      "Titel","Inhalt","E-Mail","Schlagworte","Thema","Benutzername","Beitragsdatum" "digitale Filme in der Strahlentherapie","Hi,<br>zur Zeit suchen wir in unserer Abteilung für Strahlentherapie in Regensburg eine digitales Filmsystem.<br>Welche Firmen bieten den solche Systeme für die Strahlentherapie an?<br>MfG<br>Jan<br>","janmee@web.de","","Strahlentherapie","pete","1437587189" "Gehalt MTA R","Hallo,<br>ich interessiere mich für den Beruf. Wo kann ich erfahren, was ich ausgelernt verdiene? Gibt es einen Tarifvertrag? In welchem ist man da wie eingruppiert? Vielen Dank<br> <br> <br> <br> <br> <br>","sweetmic@web.de","Gehalt","Radiologie","guest","1437303471" what am i doing wrong?
    • By kreativmonkey
      Hi,
      I read an article about Processwire in a Magazin and it sounds good. So i tested processwire and read a lot about it. Now I am sure that it is exactly what I was looking for my project. Currently, I use Drupal for my project, and before that I used WordPress. My Site has over 700 article and a lot of comments, other posttypes and (700) Users.
      Now my Problem is to migrate my Data from Drupal to Processwire.
      The articles were written by different users. The Comments were written by users and guasts.
      How can i Migrate my Porjekt without loosing to much information?
      I found this thread https://processwire.com/talk/topic/1015-switching-from-drupal-to-processwire/ but what is with the users and comments?  A lot more thinks are not transfered (post date and auhtor).
      Thanks a lot for your help!
    • By freestone
      I am starting a new project and ran across PW on the Bitnami list.  I spent the time to install PW on my WAMP stack and take a look. I went through the Planet Tutorial and implemented HTML Jump start and the grids are working.  I am amazed at how quickly I have ramped up to this point.   I have a lot of Drupal module experience and can tweak Drupal modules.  I have a lot of programming experience but little php. I am not worried about learning the needed PHP skill.   
      Below is a list of the things I need to do for this site.
      My question is …..Can I learn the needed skills to produce this site faster in PW or Drupal.  Drupal will get me 70% there will modules.  PW I think more like 50% but after only working with PW a short period of time it seems I might be the other 50% done in PW faster than the 30% in Drupal ?
      I don’t know either API set (drupal hooks) but I started down the Drupal path and was discouraged quickly as it is learning a new language
      that is applicable only to Drupal and most likely makes sense after you are ramped up but right now look ill thought out.  Drupal is great if you can get 95% there with modules.  This project is more like 60% there with Drupal modules but I sure dislike the BLOAT and the resulting lack of speed.
      For this site I need.
      1.  Has to be tablet and phone responsive.
      2.  Easy two level nav bar (menu)
      3.  Has to manage orders as it is a service oriented e-commerce site.  Shop for PW looks like 60% of what I need.
      4.  Need to easily be able to ask the users a series of questions and build an “order” based on the answers.  Some of the questions will result in form changes that would ask yet different questions.  So I need to look at some good code for DB interaction.  Perhaps looking closer at Shop will ramp me up there since the DB interaction I need is all order related.
      5.  I need to interact with a tool that will calculate mileage from address A to Address B.
      6.  I need authorize.net payment gateway.
      7. Standard social media like/follow
      8.  Contact Form with email to multiple email addresses.
      9.  I need to expose the Orders and other order related info to admin users that should only see the order management (none of
      the standard PW admin).  This is pretty easily done in permissions in Drupal and it looks to be the case in PW also but I have not looked close enough yet.
      That is it…version 1 does not need sliders or anything flashy….maybe later.
      So if anyone out there knows the Drupal bloat and also knows PW and can venture an opinion which tool I can use to create this site faster I am all ears.  Also any specific tutorials or other ramp up articles to read to understand working with MySQL would be
      great.
      Thanks Much
      JW  
    • By woop
      Hi! I'm no php expert but I thought I should share my way of redirecting URLs from my old site setup. I'm going to use Drupal urls in this example, but should work for any url. I can't guarantee this is the best way of doing it, so please feel free to correct me if you have feedback regarding security, speed or similar.
      Step 1:
      Make sure that each page in PW has some kind of connection to its previous URL so it can recognize when a redirect needs to be done. I'm going to use the node id:s and taxonomy id:s that my pages had when they were located in Drupal. I've made sure to save them all into each processwire page in a field called "drupal_id". Maybe you could just save the old URL in a field when migrating and use that, as an alternative.
      Step 2:
      Open head.inc and add this to the very top:
      $thisurl = $sanitizer->url("http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"); // Check if the URL reminds you of the old url scheme if (preg_match("/com\/\?q=/", $thisurl)){ // if it looks like a node url if (preg_match("/\?q=node\/[0-9]*/", $thisurl, $nodeslug)){ $oldnid = preg_replace("/\?q=node\//", "", $nodeslug[0]); if ($match = $pages->get("drupal_id={$oldnid}")){ $session->redirect($match->httpUrl); } else { $session->redirect($config->urls->root); } // If it's a taxonomy url } elseif (preg_match("/\?q=taxonomy\/term\/[0-9]*/", $thisurl, $taxonomyslug)) { $oldtid = preg_replace("/\?q=taxonomy\/term\//", "", $taxonomyslug[0]); if ($match = $pages->get("drupal_id={$oldtid}")){ $session->redirect($match->httpUrl); } else { $session->redirect($config->urls->root); } } else { $session->redirect($config->urls->root); } } Regex is used to find URL schemes and extract drupal nids and tids from the url. These are then looked up using the api, only to return the new url. Each time the url redirect fails, it might be suitable presenting a warning to the user. I've added something like $session->message("This URL seems to have changed. Please use the search if you didn't find what you were looking for") on the line before redirect (not part of the code example above, for simplicity's sake).
      Hope this can be useful for someone else, too. And again, feel free to leave feedback! I'm here to learn, too
×
×
  • Create New...