Jump to content

You got to love functions, URL Segments, Hanna Code and PW


Joss
 Share

Recommended Posts

I am having a lot of fun today (having worked out a game throttling kink with Soma last night - thanks mate)

I have about 900 plus pages all about car manufacturers, models, servicing, prices and the rest.

So what? 

Well, it is the way I have been able to put them together with PW and PHP

So, I have a function that lists all the services like gearbox rebuilds, or body work repairs. On its own, on a normal page, it just links to the pages about those things.

On a car manufacturer page it changes from Gearbox Rebuilds" to "Audi Gearbox Rebuilds" with an extra URL segment in the URL that adds /audi/

The function gets two extra arguments to work the magic:

rightMenu($page->title,$page->name);

Now on the gearbox rebuilds page it is suddenly all about Audi gearbox rebuilds with text changes all thanks to hanna code.

Also on the manufacturer page it lists all the models for audi and gives servicing prices for each model. Prices are set globally (since most cars cost the same) but can be overridden individually if the client wants.

Now I just need to add Ryans clever linking thingy for text and suddenly I will have everything cross linking all over the place.

The Really, Really, Really amazing thing about this is that I have been able to code all this from scratch with so little knowledge that it is frightening, but there I am, staring at a 900 line functions file, stuffed with php and PW API, and I did it all.

And it works!

The reason is the API - to code this fully would be so overwhelming that I would not even consider it, assuming I even knew where to start. But the API wraps up so many complications is such brief statements, that suddenly it is not only easy, but clean, clear and understandable - even for an old has-been, burnt out, media bloke like me.

The only down side is that the client is being so undercharged for this that it is criminal - but then, it is not his fault that I decided to get carried away and add 900 pages to his site. :)

  • Like 12
Link to comment
Share on other sites

The great thing about ProcessWire and all the great tools/modules associated with it is that I have been motivated to relearn PHP, HTML, CSS and Javascript.  I have never had so much fun as in the last year.

Hanna Code specifically with Ryan's original Foundation 4 profile made learning too easy.  I have now gone on to other CSS Frameworks with no fear.  I still got the API, functions, modules and many other things to learn in ProcessWire.  I can't say that I am bored with ProcessWire.

From my point of view, It's great to be an old geezer.  I embrace it because it doesn't keep me from learning new and exciting things.

  • Like 7
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...