RSS

Tag Archives: how

Joomla tip: Post articles in the future

No one will disagree when I say that planning ahead is a good thing.  This applies to your Joomla site, as well.  Sometimes, you’ll want to ho ahead and prepare an article for future release.  There could be many different reasons, for this, e.g announcing when products go on sale for your company website, articles that need to fill a “future gap” for your blog site, … you name it. 

Since Joomla is a CMS – which means, it focuses on content – it’s only natural that it allows you to post an article today, but publish it on a later date.  This quick guide will point you into the right direction; although it’s painfully obvious. 

  1. Create your article; from either the back-end of front-end.
  2. Make sure that “Published” is set to “Yes”.   
  3. Take a look at the article parameters, to the right.  You’ll see “Start Publishing”.  Use the date picker to choose the date when you want the article to appear. 

And voila!  If the time settings for your website are correct, your article will be published right when you want it to! 

Article motivation:  I thought of this tip, because one of the Joomla sites we manage will be ridden of new articles for the next four days.  In our defense: It’s hard to post news ahead of the news actually taking place.

 
1 Comment

Posted by on May 13, 2010 in Joomla

 

Tags: , , ,

Update on “How to Add fields to the Joomla registration form

I’ve updated my post on how to add fields to the Joomla Registration form.  I saw an incoming link to the blog post; coming from the Joomla Forums.  On that forum, someone asked “If anyone knew how to add fields to the user profile in the front end as well.

Since that user used my tutorial, I thought it’d be only fair to search for the solution myself.  I did find the solution, after some searching.

You can read the updated post here

 
3 Comments

Posted by on February 20, 2010 in Joomla

 

Tags: , , , , ,

How to: Add fields to the Joomla registration form

For the most part of this week, I was working on the i-Sana website.  If you’re interested, it’s a Dutch website that offers a free digital magazine (or e-magazine) on Health.  Anyway, this was an important project for me and  I wanted to do everything just right.  So, when the bosses requested that we collected the ZIP codes of users, I tried to find a solution.

Since we’re going to be using AcyMailing to send our newsletters, we wanted to use the “core” Joomla registration form, which meant that we had to add a zip code field to it.  We pulled it off, of course.  I’m not being snobbish, but you know by now that I only discuss “problems” when I managed to solve them, right?

Anyway, below you can find the solution to add custom fields to the registration form yourself.

KNOWN PROBLEMS:  There are two known problems when using the method below.  Those problems are due to the limitations of HTML forms.

1.  You can’t set a minimum required length
2.  Users can enter spaces in your new field, instead of ‘real information’.

The steps

1. Edit your Joomla database: The first step is to edit your Joomla database; because you’ll need to store the input for your new field somewhere.  So,  open your  database using phpmyadmin (or another solution; I prefer phpmyadmin myself as it’s a tool that many ISP).  Then, make a back-up of the table (something)_users

Add a field to the table (something)_users.  The field has to be a text field.  Choose a field name that’s related to the extra field you want to create in your form; as you’ll be using this name in the next steps.

2. Editing the registration form: To add the new field to the registration form, you’ll need to edit the following file:

/components/com_user/views/register/tmpl/default.php

In the part of the code where the form is defined, add the following code:
<tr>

<td height=”40″>

<label id=”zip” for=”postcode”>

<?php echo JText::_( ‘postcode’);?>:

</label>

</td>

<td>

<input class=”inputbox required” type=”text” id=”postcode” name=”postcode” size=”40″>

</td>

In this example, a new text field is added for “Postcode”.  You’ll want to changet the references to post code to the field name you used in the previous step.

3. Changing the registration logic: To ensure that the input is written to the Joomla database, you need to edit the following file:

libraries/joomla/database/table/user.php

Under “class JTabeUser extends Jtable” you’ll see the declaration of variables.  Add the following code:

“var $postcode = null;”

SUPER IMPORTANT WARNING: the code above must be typed EXACTLY as shown.  I accidentaly forgot the space after the =, and I broke the ENTIRE registration process; wondering where I made a mistake.

Of course, you’ll want to change “postcode” to the value you gave your field in step one.

4. Editing the user profile in the back-end: The extra data are now being stored in the database, but you’ll also want them to show up in the Joomla back-end.  To achieve this, edit the following file:  

/administrator/components/com_users/views/user/tmpl/form.php

Under <form action=”index.php” method=”post” name=”adminForm” autocomplete=”off”>, add the following code :

<tr> <td class=”key”>

<label for=”postcode”> <?php echo JText::_( ‘Postcode’); ?></label>

</td>

<td> <input class=”textbox” type=”text” name=”postcode” id=”postcode” size=”40″ value=”<?php echo $this->user->get(‘postcode’);?>”/>

</td>

</tr>

As usual, replace ‘postcode’ with your own variable!

5.  Editing the user profile in the front-end: (added: 17/02/2010)  If you want to see the extra data in the user profiles in the front end of the site, you’ll need to make changes to the following file:

/components/com_user/views/user/tmpl/form.php

Under <table cellpadding=”5″ cellspacing=”0″ border=”0″ width=”100%”>; you’ll see that the form is being defined again.  Add the following code:

<tr>
<td>
<label for=”postcode”>
<?php echo JText::_(‘Postcode’);?></label>
</td>
<td> <input class=”inputbox required” type=”text” id=”postcode” name=”postcode” size=”40″ value=”<?php echo $this->escape($this->user->get(‘postcode’));?>” >
</td>
</tr>

Once again, you’ll want to change “postcode”.

And bam!  You’ve added your field to the registration procedure of Joomla.

(last edited on 17/02/2010.  Added “Editiing the user profile in the front-end after comment on the Joomla Forum)

 
55 Comments

Posted by on February 5, 2010 in Joomla

 

Tags: , , , , ,

Coming soon: How to Add fields to the registration form

The past few days, I’ve been trying to write a “How to” that explains how you can add custom fields to the Joomla registration Form.  I ran into that problem this week, when someone asked me to make a mandatory “zip code” field for all users, for a project I’ve been working on. 

Unfortunately, I’ve been too busy to get to writing the article.  I’m going to do my very best to write the article tomorrow; or at least to e-mail the document I need for the article to myself.  So, now you know what you’ve got to look forward to for tomorrow.  I’m sorry if this post isn’t exactly what you were looking for.

 
Leave a comment

Posted by on February 4, 2010 in Various Articles

 

Tags: , , , , ,

How to: Upgrade your Joomla site

Yesterday, someone asked me a simple question.  “How do I upgrade my Joomla website to the latest version?”  I answered him, of course.  And because updating Joomla to the latest version is a MUST, I’ll quickly explain you how to get the job done. 

Steps

  1. Determine what update you need.  This depends from website to website.  To find out what package you need, answer the following two questions:
    • What version are you using?
    • Are you using a “Special” version or the regular version of Joomla?

To determine what version you need, log in to the admin panel of your website.  You’ll find the version number at the top right corner, along with the version name if you’re using a special version. 

joomla_version

In the screenshot above, you can see that I’m using the “DutchJoomla” edition of Joomla 1.5.14 (Which is basically Joomla 1.5.14 with Dutch translations).  If, like most people, you’re using the “vanilla” version of Joomla (downloaded from Joomla.org; with language packs installed or not) you’ll just see a version number. 

2.  Go to the download site for your version of Joomla.  For most people, this’ll be joomla.org. (In my case, it’d be dutchjoomla.com).  Go to the download section, and find the update that matches your version.  In my case, I’d download “1.5.14 to 1.5.15 update” from DutchJoomla. 

3.  Once you’ve downloaded the package, unzip it to a folder. 

4.  Open your FTP client, and upload all the folders to your website root (you should see files like configuration.php, and folders like templates, administrator, modules, etc.).  When asked to overwrite files, say “Yes” as overwriting the old files is critical for your update. 

Pro tip:  If you’re not sure about updating, test the latest version of Joomla on your localhost.  And, just in case, make a back-up of your sites’ files before updating. 

5.  When all files are updated, your update is complete. 

Note: everyone who hasn’t upgraded to version 1.5.15 yet, should do so ASAP.  1.5.15 fixes some critical security issues.

 
1 Comment

Posted by on January 7, 2010 in Joomla

 

Tags: , , , , ,

 
Follow

Get every new post delivered to your Inbox.

Join 519 other followers