Archive for the ‘Programming’ Category
Drupal Custom Breadcrumb visibility PHP code
I needed to show a custom breadcrumb on specific pages by URL.
The nodes in question were of “page” content type.
The URLs of these nodes were like:
/green
/green/page1
/green/page2
/green/page3 and so on.
I only wanted the custom breadcrumb to show up on:
/green/page1
/green/page2
/green/page3
and not on /green
I created a breadcrumb with title “Green” and path “green” and used this PHP code for visibility:
$p= explode('/', $_REQUEST['q']); return ($p[0] == 'green' && $node->nid != 79);
where 79 is the Node ID of the /green page.
I was able to get the desired result!
I’m going to learn PHP, any good tips on doing so?
A few weeks ago, I posted about the fact that I had been laid off.
I live in Hong Kong and Domino/Lotus jobs don’t seem to be prevalent here at the moment.
In the meantime, I’ve taken time to “re-charge” my batteries and spend time with family and catch up on some todos around the house that had been procrastinated on for some time.
Now that I’ve got some time to focus, I have decided to learn PHP. I have thought about it for a very long time, but have never made the time to do it.
I figure that I’m excellent with server and infrastructure management and the tools to manage the infrastructure, excellent with Domino management and support, but lacking in any programming areas.
I do tend to do freelance work on the side, away from the corporate environment that are usually LAMP (Linux, Apache, MySQL, and PHP) type projects. This entails usually setting up a Drupal site, or similar open source PHP web application and hacking the CSS and theme to get it looking right.
I am familiar with working “around” PHP, but not a master at writing or even editing it.
I’ve starting looking into the online resources that are available and it looks like there are some really good free resources, both tutorials and video tutorials.
I’m just wondering if there is anyone out there that can give any good starting advice for someone that is more of an all around IT management person and is used to mostly keeping servers, up, configured, and running that does not really have any programming concepts experience.
Also, I’ve started looking at the Zend Framework for PHP. I’m wondering if that really is a standard for developing PHP applications.
One thing I’m wondering is why you would not use the Zend Framework? It seems like a no brainer to use it especially if you were developing something from scratch.