MODx (Evo): Setting up a subnavigation – if there are subpages (children)

| development (web) | One Comment

Wayfinder is a great tool for MODx to automatically display menus and submenus on your website. By default though, it doesn’t handle not displaying the submenu on a subpage if there are no children, so you end up with the title of the page appearing where the menu should be.

So that you can just have one template for subpages, you can use a snippet to check if there are children for that page, and if so display the sub menu.

Here is the code I use.

1. Create a chunk called ‘subnav’

2. Create a snippet called ‘displaySubnav’
documentObject;
if($current['isfolder']=='1'){
$chunkArr = array(); // if you want to parse stuff to the chunk, put it in an array here.
echo $modx->parseChunk('subnav', $chunkArr, '[+', '+]');
}
?>

3. Call the snippet in your template – must be a non-cached call.
[[displaySubnav]]

Now if there are children you’ll see a sub menu, and if there isn’t it will just appear blank.

101 things to do in 1001 days

| goals | 3 Comments

Sick of sitting at home every weekend daydreaming of the things I want to do it, but waiting for someone to do them with me, I have decided to make an effort to do some of the many things I would like to do in my lifetime. Based on the 101 things in 1001 days project, here is my list. (I haven’t been able to come up with 101 things yet, but here are the first 71).

My completion date will be: 19 December 2011
(which still gives me time to make another list to complete before i’m 30)

Activities
1. Go scuba diving
2. Go kayaking
3. Go white water rafting
4. Try indoor rock climbing 11 May 2010
5. Do archery again
6. Go hiking (overnight trek) 4 July 2010
7. Go to a concert
8. Go bowling and get a score over 120
9. Sail a boat/yacht
10. Complete an Ice trek completed August 2009
11. Go Surfing
12. Go Rock climbing
13. Play tennis
14. Go kite surfing
Travel
15. Go to New Zealand (trip planned for Aug 2009)
16. Spend 3 days on an island
17. Go camping
18. Plan overseas trip for 2010
19. Take a 3 day nature/live off the land trip
20. See a professional ice hockey game
21. Go on a roadtrip
22. Go to one of the Whitsunday islands
23. Go fishing
24. Go visit Tim and Hunter
25. Travel to at least 3 countries
Experience
26. Buy shares
27. Buy a house completed 23rd Dec 2009
Fitness
28. Run 5km
29. Complete 100 pushups challenge
30. Do 3 workouts a week, for a month.
31. Hit 56kg.
32. Tone up arms
33. Tone stomach
Education
34. Read 100 books [10/100] 35. Write an e-book
36. Do a first aid course
37. Learn meditation
38. Learn a martial art / defence
39. Hold a seminar / teach a course completed 13/10/2009
40. Write 100 blog posts [22/100] 41. Find a mentor
Charity
42. Student work experience / charity project
43. Donate blood completed 5/8/2009
44. Donate old clothes to charity
Personal
45. Setup vegie garden
46. Plant fruit trees
47. Cook dinner 7 nights in a row
48. Paint a picture
49. Write my will
50. Drink a cocktail on a beach
51. Host a dinner party
52. Host a poker night
53. Get my boating licence
54. Bake a loaf of bread
55. Kiss in the rain
56. Eat vegetarian for a week
57. Watch a sun rise
58. Watch a sun set
59. Spend a day getting pampered
60. Spend a day pampering someone else
61. Stargaze
62. Cook marshmallows on a fire
63. Go 2 weeks without eating take-away
64. Find a new hobby
65. Write a letter to favourite author
66. Attend a gala ball (with a date in a suit)
67. Take someone out to dinner
68. Finish writing 101 list.
Business
69. Get business revenue over $100,000
70. Setup new office
71. Hire another employee

Added after initial list

72. Make it to the top of Castle Hill without passing out / stopping completed 2/8/2009
73.
Build a deck on my new house
74. Build a fence
75. Read from a hammock
76. Do a fun run. (maybe, decide after reaching 5km run goal)
77. Buy a BBQ
78. Make pasta from scratch
79. Hinchinbrook hike
80. Get a dog

 

Update 06/12/2011 – completed 28/80

Have any suggestions to add, or want to join me? Post a comment below.

2008: Year in Review

| goals, life and general ramblings | No Comments

Well another year is over, and I can’t even remember exactly where it went. Here is my review of 2008, the year that was.

Za and Moko

One of the best decisions I have ever made was to adopt these two beautiful kittens. They come from different litters, but act like brother and sister.

Moko (aka Sparrow) - Day one

Moko (aka Sparrow) - Day one

Za (aka Tinkerbell) - Day One

Za (aka Tinkerbell) - Day One

They have brought me a lot of ups, as well as some downs – when I brought them home after being desexed, Moko ripped her stiches out within 5 minutes and blood (and what I thought may have been guts) were coming out everywhere. After an emergency trip back to the vet we got her stitched up again. Despite the wound being restiched, she was still dripping blood all over the floor and wouldn’t stay still. It was an extremely stressful time for me, and made me realise how important they are to me.

It was also on this day that we found out that Zahra (previously known as Tinkerbell) was actually a boy. Due to her fluffyness the vets hadn’t picked up on it earlier, and it was only when they went to cut him open that they noticed. We now refer to Zahra as just Za – but we lived with him for 3 months thinking he was a she, so we still often get it mixed up.

Mojito

2008 was also the year that I switched to working fulltime on my business “Mojito Solutions”.  Overall it has been a good first year – we haven’t quite made as much profit as I would like, but this is mainly due to spending more on expenses then I expected. 2009 is looking very promising – we are booked out for January and February, and have a bunch of new potential projects lined up as well. To help cope with all the work, I put on a staff member at the end of November part-time, and have now offered her a full-time position starting January.

Townsville Business Women’s Committee

TBWN Presidents Cocktail Party Jan 2008

TBWN Presidents Cocktail Party Jan 2008

I was also lucky enough to secure a position on the Townsville Business Women’s Network (TBWN) Committee as Web Developer to code and launch their new website, which went live in May 2008. The network consists of about 400 local business women who get together once a month for a luncheon, or cocktail party. I have met some absolutely amazing people through this group and highly recommend any other business women to get involved.

Vegie Garden

Sick of spending all day inside in front of the computer, in May I decided to start up a vegie garden. I was currently looking after my parents house while they were on vacation so anything that I set up had to be portable so I can take it with me when I get my own house next year.

Here are the pictures from the initial setup, and then again 21 days later. I have since switched to growing most things straight from the seeds, but the hot temperatures and large rainfalls have affected the garden in the last month, and currently there’s not much left.

Vegie Garden - Day one

Vegie Garden - Day one

Vegie Garden - Day 22

Vegie Garden - Day 22

Trip to Sydney

Me and my sister munching out on fairy floss at Luna Park (Sept 08)

Me and my sister munching out on fairy floss at Luna Park (Sept 08)

In September I travelled down to Sydney for my annual trip. It was a busy 10 days consisting of catching up with my little sister, and attending the OZ-IA and Flying Solo conferences. Oh and lots of shopping. Was a great trip as usual, but not sure if I will be able to do it again next year due to finances and workload.

Fishing with Dad

One of the many benefits of being self-employed is that you can be flexible with the hours you work. I have been able to spend some quality time out on the boat fishing with my Dad.

Personal growth

Probably attributed to the looking after the kittens, but I feel somewhat more responsible and capable of looking after things now. I have changed my attitude to see the positive side of everything, instead of all the bad things and this made more of a difference then I could have imagined. I recommend reading The Art of Happiness, by the Dalai Lama for people looking to opening their mind up to looking at the world more positively.

I would also like to thank all the positive people that surround me. I have been quite lucky to be surrounded by supportive, positive people who have helped me grow and continue to support me every day and I am very thankful for everything they have done.

Goals of 2008

  1. Travel Overseas
    Achieved: NO
    We ended up postponing this. While it is still something I would very much like to do, there are other things I want to do more and I don’t have the money (yet). For now I am postponing this goal to 2010 when I am (hopefully) more financially stable.
  2. Finish GTD application
    Achieved: NO
    To be honest – I don’t think I worked on this at all this year. It kept getting put off as the importance became less and less relevant. Still not sure if it will ever get finished, and im ok with that.
  3. Start saving money for a house
    Achieved: Kinda
    Well there’s some money in the bank – but only about $2K which I think is what I may have had at the beginning of the year. Switching to being self-employed has meant that income hasn’t been steady, which has made it super hard to make regular contributions. Think I got it to about 5K at one point, but then had to withdraw money to pay credit card (which I ALWAYS payoff monthly).

So based on this, I didn’t really achieve any of my goals, but I still feel that I had a really good year. I got to spend it with my beautiful boyfriend and gorgeous kittens, doing what I love (making websites and helping people) and there wasn’t too many downs.

Goals for 2009

This year I am keeping it simple. One major goal…

  1. Buy my first home
    This is what I want more than anything right now.  I am keen to get active and get my hands dirty and do some renovating, but need to save up a deposit first. Ideally I would like to achieve this before June 30 so that I can get the first home buyers grant, but if I end up doing this by myself, and am not eligible for a normal home loan (due to being self employed) then I’m looking at minimum deposit of $60,000 for a $300,000 loan.

And a couple of minor goals

  1. Blog more often
    I really enjoy blogging, but never seem to find the time to do it. This will hopefully change in the new year by restructuring other parts of my life to be more balanced. Ideally I am going to aim for once a week. Let’s see how we go.
  2. Cook more often
    I enjoy cooking, but once again can never seem to find the time or sometimes energy to do it. Because of my current living situation, it’s very easy to get away with not cooking. This year I have allocated two nights where I will cook (Mondays and Wednesdays) and I am also going to try and make one of those nights a “new recipe” night, where we try something new. 52 new meals – how hard can it be.
  3. Read 25 books
    I loved reading as a kid and would often read about 5 books a week (a little extreme I know). The last couple of years I have been reading more often, but it comes and goes. This year I am aiming to read 25 books (includes fiction and non-fiction).
  4. Get to 56kgs
    No new years goal list would be complete without some mention of health/weight/fitness.  This year my health goal is to get back to 56kgs which is what I was about 3 years ago.  I was at about 61 before Christmas so hopefully it shouldn’t be too hard to achieve. While I wouldn’t call myself overweight I would like to be a bit healthier, stronger and more toned which hopefully this will help achieve.
  5. Spend less time working and more time enjoying life with family and friends
    I am setting myself a maximum of 10 hours to work a day, as well as scheduling in 3 day mini-breaks every 3 months to help cut down on the amount of hours I find myself working. While I love what I do, sometimes it does feel like it is all I do and I don’t want to start not enjoying it.

Three Key Things To Look For In A Web Developer

| business, development (web) | 2 Comments

Web standards, CSS, Upgradable System With thousands of businesses promoting web design and development services, it can be hard to know what to look for. Other than the obvious method of looking at their previous work and deciding if you like their design style, there are many other important factors you should consider. Here is a short list of three key things that you should ensure your web developer has no matter how big or small your project is.

Follows web standards

This is important for a number of reasons. First of all it helps to ensure that your site is accessible to the largest number of users possible. This includes users with disabilities as well as search engines. Secondly, it helps to ensure that your site loads quickly and isn’t padded out with unnecessary code. And thirdly, it helps to ensure that your site is future proof and compatible in a variety of browser and different platforms. With new browsers and internet capable devices (such as the iPhone) coming out every couple of months, you don’t want to have to keep redoing your website every time a new technology comes out.

Uses CSS and not inline styles or table based layouts

CSS allows a developer to separate the design component of a page (for example colours and styles) from the actual content (i.e. the text). By doing this not only is the code cleaner, but it also means that changes to the visual appearance of your site can be done in minutes and are effective throughout every page in your site, instead of having to update each and every file to match. In regards to using tables for layout, not only does this breach web standards, but they also pad out the code of your website making it slower and harder for screen readers and search engines such as Google to read.

System can easily be upgraded as your business needs grow

There’s no point in getting a website developed that you have to redo from scratch 6 months later as your business needs change. Make sure that the system is flexible enough that new features and content can be added as required. This can save you thousands of dollars in the long run.

Forcing a restart/shutdown using VMware

| Uncategorized | One Comment

VMware allows you to run additional operating systems, and virtual machines on your computer. I use it so that I can run Windows XP on my Macbook, which usually works a treat.

However when booting it up recently it got stuck on the loading screen and trying to force a shutdown or restart via the menu did nothing. As I had it set to automatically save the session, reopening the virtual machine just resulted in it opening up the frozen window.

Thanks to the kind folks at the local mac shop we managed to find a solution -

  1. Open up the virtual machine
  2. Select preferences from the VMware top menu
  3. Set it to turn off the machine on shutdown (instead of suspend)
  4. Shutdown VMware and open it up again

Hope this is helpful for anyone else who comes across the problem.

P.S. I think the reason that the machine froze in the first place was due to having an external hard drive or wireless modem plugged in when I booted up, to prevent it happening again I now unplug devices before booting up.

Using Xampp on Mac for Ruby on Rails

| development (web) | 5 Comments

I recently installed Xampp on my mac to help with some other development work, only to find that my previous install of MySQL which I was using for Ruby on Rails development no longer worked. I was receiving errors:

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’

and

No such file or directory – /tmp/mysql.sock

To fix the problem, I added the following line to config/database.yml

socket: /Applications/xampp/xamppfiles/var/mysql/mysql.sock

Huge thanks to http://soledadpenades.com/ who had the solution.

Chmod MODx MaxiGallery fix

| development (web) | 8 Comments

MaxiGallery is a customizable image gallery for the PHP application framework/CMS MODx. I have been testing it out locally on a windows based PC running Apache, and came across an error when trying to upload files as per the Picture and Thumbnails walkthrough.

« MODx Parse Error »

MODx encountered the following error while attempting to parse the requested resource:

« PHP Parse Error »
PHP error debug
Error: chmod() [function.chmod]: No such file or directory
Error type/ Nr.: Warning – 2
File: assetssnippetsmaxigallerymaxigallery.php
Line:372
Line 372 source: chmod($mg->path_to_gal.$name,0666);

The fix thanks to doze on the modxcms forums:

Try changing lines 371 – 378 in maxigallery.php from:
Code:

move_uploaded_file( $_FILES['file'.$i]['tmp_name'] , $mg->path_to_gal.$name );
chmod($mg->path_to_gal.$name,0666);

$handleMessage = $mg->handleFile($name, $modx->db->getRecordCount($rsx));
if ($handleMessage != “”) {
$manageOuterTplData['messages'] .= $handleMessage;
$upload_error = true;
}

to:
Code:

if(move_uploaded_file( $_FILES['file'.$i]['tmp_name'] , $mg->path_to_gal.$name )) {
chmod($mg->path_to_gal.$name,0666);

$handleMessage = $mg->handleFile($name, $modx->db->getRecordCount($rsx));
if ($handleMessage != “”) {
$manageOuterTplData['messages'] .= $handleMessage;
$upload_error = true;
}
}

This worked for me without needing to do the other changes that he mentioned in the post, but if it doesn’t work for you, try checking out the rest of his comments.

Ruby: Displaying current date/time as default in text field

| development (web) | No Comments

This is pretty basic stuff, but I couldn’t easily find the details on how to do it, so here it is for anyone else who is looking for it.

Scenario: I wanted to put the current date and time as the default text for the date field in a form.

The code:

In the form I used:

<p> Date: <br /> <%= f.text_field :date, :value => @current_time %> </p>

And in the controller for the view put:

@current_time = Time.now.strftime(“%Y-%m-%d %H:%M”)

Formatting:

You can change the formatting of the date/time displayed, but I am using this for now as this way it puts it straight into MySQL without me having to rework it.

Additional info:

Refer to: http://au2.php.net/strftime for details on formatting dates using strftime

Mojito Solutions launch

| business | One Comment

Well it’s official. I am now a small business owner. Well technically I have owned the business name and been planning for the last 9 months, but I have just finished launching the website for my new business venture, Mojito Solutions, so now it seems official.

So how did it all start?

I have wanted to establish my own business for as long as I can remember. About 7 years ago, I was working in the retail industry and inspired by the thought of being able to obtain clothes at cost prices, thought it would be great to start my own fashion store. Three years later, I was halfway through studying business and information technology at Uni, when it occurred to me that the fashion industry wasn’t really for me, and that my real passion revolved around technology and computers. Towards the end of my degree, lured by the attractiveness and variety of websites and web applications, I decided to make the switch from desktop applications to the web industry.

After working for a year for a local web development company, I suddenly felt that I had the confidence and inspiration I needed to start my own business. It seemed like the perfect step forward, and I knew that until I did this, I would always be left wondering how it may have gone.

Who is Mojito Solutions, and what do I plan to do?

Mojito Solutions is a web design and development business which specialises in integrating technology, design and usability. Currently it is just me working about 4 days a week and some evenings, until things start to take off, which hopefully they will and then I am hoping to be able to employ a graphic designer (not my strongest point) and one day offer graduate programs and work experience and education to students.

Where to now?

Now I need to work on establishing a client base, so if you know anyone who is looking for a website, get them to send me an email at: info@mojitosolutions.com I am also working on establishing some business systems, and will also hopefully get some time to re-commence work on my GTD (Getting Things Done) application which had temporarily been placed on hold while I tried to manage running a business, studying everything I could, moving house and working fulltime.

Pink for October

| Uncategorized | One Comment

Anyone who is a regular visitor to this site will have noticed a sudden brightness to the links in particular. For anyone who knows me, pink is not my colour of choice so it should be obvious something is up.

October is Breast Cancer Awareness month, and in a small effort to help make a difference I am helping to promote Breast Cancer Awareness by going pink. Also all funds raised via my Google AdWords will be donated to the National Breast Cancer Foundation here in Australia who are raising money to try and find a cure for breast cancer.

To find out more check out: