DIY Joomla! 3 One-Page site

I have always been fascinated by the fluidity one can find with one-page web themes. While common in Wordpress, one-page web templates were not the usual in Joomla!. I put the task of understanding them, and replicating such in Joomla, on my bucketlist last year, but I did not have cause to actually do either until recently when a client asked for it.
I turned to my good friend, Google, for help, and I found an answer on Joomla Stack Exchange channel that helped a lot (Thanks Sir Rene Korss!).

BREAKING DOWN THE WONDER OF THE ONE-PAGE SITE

The concept is to
  • place several modules on the home page, with different displays,
  • then create hyperlinks that, when enhanced with a sprinkling of java script, scroll to those modules smoothly.
Joomla! already has functionality for modules, and each template has varied types and position names. The twist here is to be able to call the module IDs within the designated hyperlink.
By carrying out the following steps, we can make any Joomla template, behave like a one-page theme:

1. Create a module chrome

A module chrome is the shell (usually with div, span or paragraph tags), surrounding each module. While there are default module chromes within the system folder inside templates, your new template probably has its own, that make the modules display how the template creator wants them to. It's quite easy to make your own custom module chrome, but the point here is to use a referable value in the initial tag's id, that you can call up later.

See an example below:
  1. Create a file called modules.php in the folder
    yoursitedirectory/templates/yourchosentemplate/html
  2. Add the following code to the file:
     1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    <?php
    /**
    Additional template module chrome(s)
    **/
    defined('_JEXEC') or die;

    /*
    * one page layout (output module content in one page layout)
    */
    function modChrome_onepager($module, &$params, &$attribs)
    { ?>
    <div id="slot-<?php echo $module->id; ?>">
    <!-- Module content here -->
    <?php echo $module->content; ?>
    <span style="margin-bottom: 5px;">&nbsp;</span>
    </div>
    <?php } ?>
As illustrated above, the chrome is named modChrome_onepager, the div tag is the first tag within it, and its id uses a referable value, in this case, it calls the current module's id (module->id). I added the word, 'slot-' to the name, but you can use any value or format. Add any other optional frills to the module chrome.

2. Create your modules

Set up all the modules that will act as sections for the one-page theme. For example, let's assume that your proposed links are Home, About us, Our Services, and Contact us. Home section is the part of that the site visitor sees upon opening the site for the first time, so that's taken care of. You need to create modules for the other links, namely, About us, Our Services, and Contact us. Set them to show on the Home page, under your menu assignments.
Very important: Ensure that in each module, the module chrome you created in step 1 is selected. You can select a module chrome type under 'Advanced' tab, from the list tagged, Module Style.

3. Create the hyperlink menus

Go to Menus, and create external links, with the URL specified as the module names e.g. slot-22. 

Add the Javascript magic

 The script to use is from Paulund.co.uk and it allows a smooth scroll between the hyperlinks.

 ADDING A LITTLE EXTRA

  •  its preferable that you create your module chrome inside the systems folder, instead of inside the particular template folder. This is for occasions in which you have to change the template - the code should still work regardless of the change.
  • If its not in the template already, consider adding an arrow that leads back to the top of the page, at the right hand side corner of the screen. 

Want to check already-made one page Joomla! templates? Check out this collection at Evohosting.co.uk

In the End….

Another song that aptly describes where am at now, by Linkin park.
Another tribute to Chester Bennington.
Another opportunity to wonder why...

One thing, I don't know why
It doesn't even matter how hard you try
Keep that in mind, I designed this rhyme
To remind myself how
I tried so hard
In spite of the way you were mocking me
Acting like I was part of your property
Remembering all the times you fought with me
I'm surprised it got so (far)
Things aren't the way they were before
You wouldn't even recognize me anymore
Not that you knew me back then
But it all comes back to me
In the end

You kept everything inside and even though I tried, it all fell apart
What it meant to me will eventually be a memory of a time when...

I tried so hard
And got so far
But in the end
It doesn't even matter
I had to fall
To lose it all
But in the end
It doesn't even matter

Rest in Peace Chester

Numb



I'm tired of being what you want me to be
Feeling so faithless, lost under the surface
Don't know what you're expecting of me
Put under the pressure of walking in your shoes
Every step that I take is another mistake to you
And every second I waste is more than I can take!
I've become so numb, I can't feel you there
Become so tired, so much more aware
I'm becoming this, all I want to do
Is be more like me and be less like you
I've become so numb
These words aptly describe me so far this year....but to hear Chester committed suicide? That's a new low.
Why do these people that help us through the deep, feel terrible enough to kill themselves? Why?
Too many people to count.
Its heartbreaking.
I'm getting over my numbness gradually......gradually....
I have too much to live for, to allow someone else's pressures send me to another hell.

Good Deed: The Web that binds us part 2

Earlier in the year, I connected my dad to the angel who ensured he had an education, thanks to Facebook. Some weeks after posting an answer on Quora, something told me to go to Facebook and check out the daughters timelines. One of them had actually posted pictures of Pastor Moon, asking that we all call him to cheer him up, as he was battling cancer. I told my dad, who insisted I ask for permission from one of the daughters, before he would call. My dad would call, and chat with the pastor for a while. Pastor Moon's health got a boost, and he was extremely happy that Dad called him (Whoever said our health is not connected to our emotions lied). That was March. Continue reading "Good Deed: The Web that binds us part 2"

GOOD DEED: THE OKADA RIDER

Akara and Fried Yam, Courtesty Pinterest (Nigerian Foodies)
GOOD DEED: THE OKADA RIDER Some nights ago, I closed late and so I had to patronize an okada rider. For those outside the shores of Nigeria, we have what we call okada riders in almost every city in our country. Imagine someone with a motorcycle, carrying passengers for a fee. That's an okada rider. At first they were a new means of livelihood for many, then they became a nuisance, especially when they were being used for robberies and attacks. Various cities now have laws governing their working times and where they can operate, if at all. Okada riders are allowed to patronize the areas where my office is, and where I live, so its quite easy for me to use them from one location to the other. So, on that night, I hailed one of these 'transporters' to take me home. After negotiating the price, the man asked how much I was holding. It turns out he would need to break down the money he had to be able to give me change when we arrived my destination, so we agreed that he would stop along the way to buy bread. He did stop some minutes later, but not for bread. He stopped at a street food location, where fried yam, fried bean cakes (akara) and fried plantain (dodo) was being sold. The smell arrested me immediately. I seem to love yam with a passion these days, and that day was no exception. It did not even matter that all I had eaten all day was roasted yam and pepper sauce. I ordered some, then paid for both my order and the okada man's order. The man did not believe I was not going to collect the money back from him. I insisted, and when we arrived at my house, I proceeded to pay him the full charge agreed for the trip. He prayed for me fervently and I thanked him and walked away. I still do not understand why he did not believe me. I mean, I said I would pay and I did. I enjoyed my order. You should try it one day - african white yam, deep fried in vegetable oil, served with pepper sauce and chilled water...hmmm.... I better stop here before hunger knocks fully on my door.

Good Deed: After The Fire

Mr. Takiti returned hom after work, one hot day, to meet his two sons fighting and arguing.
He was extremly tired but he took the time to ask them what the problem was.

"Toni and Tosin," he asked, as he drank a glass of cool water, and wiped his brow. "What is the matter? Why are you fighting?"

"Toni hid my Ben Ten watch!" exclaimed the older Tosin.

"Toni why?" asked their father, as he placed the glass cup on the table. Then he changed his mind.
"I don't want to know why," he added. "Just give the watch back to your brother."

"Yes daddy" the six year old muttered.

One hour later, Toni was still looking for the watch, as he had forgotten where he hid it.
Tosin was getting more upset and shouting so much, that their father woke up and called them again.
Toni was again instructed to give the watch back, while Tosin was told not to make any more noise.
Two hours later, Mr. Takiti woke up in a smoke-filled room, coughing. It was the urge to cough that woke him up, and probably saved his life.

He staggered out of the house, to find that fire was burning in his apartment, and two other flats in the compound. The smoke had filled his lungs, so he just kept coughing and eventually sunk to the ground. Neighbors and helpers were busy trying to save as much property as possible from the fire that refused to reduce.

Everyone sighed collectively when the siren of the fire engine was heard coming closer.
By the time the fire finally died down, the three apartments were nothing but charred walls, with caved in roofs and burnt out interiors.

What happpened? 
The story unfolded gradually, after everyone sat down to rest and watch the firemen do their job. Toni had remembered where he put the watch, and scrambled under the bed, to get it. Unfortunately it had gone dark early, so he needed illumination to find it under the bed. Instead of getting the torchlight or his father's phone and using its flashlight app, Toni had gone to get a candle.

Of course the bed caught fire.

To try to stop the fire, the children grabbed the first big paper they could find: carbon paper. It got worse, fast, so they ran out of the house, shouting 'Fire! Fire!'.

They forgot that their father was sleeping in the other room, and left him in the house, as the fire rapidly spread.
I still find it hard to believe that they would have forgotten their own biological father, inside a burning building.

At least three families were devastated: almost nothing survived the fire, that had begun with a simple small candle. Only our family friend's house was left intact. All most of them had left, was the clothes on their backs. Even the family with a four month old baby had no clothes for the baby.

When I heard about the baby, I began gathering all Jaden's old clothes until I had a big bagful. Then I called the family friend to inquire if the gift of clean used clothes would be acceptable. She said yes, so I took the bag to church, and gave her after service, to help give the family.

I am still in shock at the rapid rate the fire must have progressed.
The boys were no more than six and eight years old. Was there something they could have done to prevent this? Didn't they know better than to play with fire?

I wonder how their father will repair the damage done now. I imagine that he would have to realise the money to repair the house for the landlord. I also imagine that there was no insurance, for him or the other affected tenants. Some may demand for replacements for every property lost.

Good Deed: After The Fire

Mr. Takiti returned hom after work, one hot day, to meet his two sons fighting and arguing.
He was extremly tired but he took the time to ask them what the problem was.

"Toni and Tosin," he asked, as he drank a glass of cool water, and wiped his brow. "What is the matter? Why are you fighting?"

"Toni hid my Ben Ten watch!" exclaimed the older Tosin.

"Toni why?" asked their father, as he placed the glass cup on the table. Then he changed his mind.
"I don't want to know why," he added. "Just give the watch back to your brother."

"Yes daddy" the six year old muttered.

One hour later, Toni was still looking for the watch, as he had forgotten where he hid it.
Tosin was getting more upset and shouting so much, that their father woke up and called them again.
Toni was again instructed to give the watch back, while Tosin was told not to make any more noise.
Two hours later, Mr. Takiti woke up in a smoke-filled room, coughing. It was the urge to cough that woke him up, and probably saved his life.

He staggered out of the house, to find that fire was burning in his apartment, and two other flats in the compound. The smoke had filled his lungs, so he just kept coughing and eventually sunk to the ground. Neighbors and helpers were busy trying to save as much property as possible from the fire that refused to reduce.

Everyone sighed collectively when the siren of the fire engine was heard coming closer.
By the time the fire finally died down, the three apartments were nothing but charred walls, with caved in roofs and burnt out interiors.

What happpened? 
The story unfolded gradually, after everyone sat down to rest and watch the firemen do their job. Toni had remembered where he put the watch, and scrambled under the bed, to get it. Unfortunately it had gone dark early, so he needed illumination to find it under the bed. Instead of getting the torchlight or his father's phone and using its flashlight app, Toni had gone to get a candle.

Of course the bed caught fire.

To try to stop the fire, the children grabbed the first big paper they could find: carbon paper. It got worse, fast, so they ran out of the house, shouting 'Fire! Fire!'.

They forgot that their father was sleeping in the other room, and left him in the house, as the fire rapidly spread.
I still find it hard to believe that they would have forgotten their own biological father, inside a burning building.

At least three families were devastated: almost nothing survived the fire, that had begun with a simple small candle. Only our family friend's house was left intact. All most of them had left, was the clothes on their backs. Even the family with a four month old baby had no clothes for the baby.

When I heard about the baby, I began gathering all Jaden's old clothes until I had a big bagful. Then I called the family friend to inquire if the gift of clean used clothes would be acceptable. She said yes, so I took the bag to church, and gave her after service, to help give the family.

I am still in shock at the rapid rate the fire must have progressed.
The boys were no more than six and eight years old. Was there something they could have done to prevent this? Didn't they know better than to play with fire?

I wonder how their father will repair the damage done now. I imagine that he would have to realise the money to repair the house for the landlord. I also imagine that there was no insurance, for him or the other affected tenants. Some may demand for replacements for every property lost.