ExpressionEngine Weblog > The Tricky Bits
Wednesday, July 28, 2004
This Is Our First Entry Created Using FCKeditor
» Posted by Robert Crow on Jul 28, 2004 at 3:27 pm
» (4) Comments    » (0) Trackbacks    » Permalink    » Send to a friend

Now that we've figured out how to install FCKeditor, we figured we would start using it and see if it really is the holy grail of HTML editors for use with ExpressionEngine.

After tinkering around with the installation instructions for a couple of days we finally figured out how to install FCKeditor and now that we know how it is quite straight forward.

FCKeditor has the following obvious advantages over entering HTML directly into the EE Control Panel:
  • You don't have to know HTML. This is a major plus for consultants selling customers on using EE for their Weblog or content management projects.
  • You dont' need to train each user at every customer you have, as their initial reaction to using HTML is always the same - yuck.
  • Users get the impression that EE is a more sophisticated product and that they can actually use it themselves. They realize that they really don't need a Webmaster - really. This is facilitated by the fact that once installed, FCKeditor works seamlessly with EE.
  • You don't have to remember anything as the editing icons are all self-expanatory, with text descriptions that display when you hold the mouse over a button.
  • Users have an easy time getting right to business as they are already familiar with the editing interface from having used Microsoft Word, OpenOffice, etc.

There are othe benefits of course, but hey, the purpose of this entry is just to get the word out - yes, that pun was intended.

Try out FCKeditor and let us know what you think. Heck, you could even make a comment on this entry and share your experiences using FCKeditor with other EE users.

Let the hassle-free editing begin!


Our First Tip:

Set "Formatting" to "None" (use formatting buttons at bottom-right of the text box) if you want your entry to appear as it did when you created it using FCKeditor.

Our First Trip:

As FCKeditor doesn't work with Safari (yes, I'm a Mac user, that is to say I like to avoid pain) I used FireFox to create this entry. FCKeditor seems to work fine so far, but I miss Safari's "Check Spelling as You Type" editing option. It's a Safari feature that I've really gotten used to and have come to rely on - in fact, it saves me a lot of editing iterations, like for example, the one I'm doing right now.

The Next Trip:

FCKeditor is not XHTML friendly yet (there is an outstanding bug) and until the next release it creates a lot of errors if you validate your page as XHTML. Well... nothing to be done here but wait for the next release, which hopefully won't be too long. Don't you like that kind of wording? How long is too long? I'll guess it's any amount of time that extends beyond right now.

» Categories • Entries - Creating/Editing
Thursday, July 22, 2004
Set Caching Preferences For All Templates
» Posted by Robert Crow on Jul 22, 2004 at 7:01 pm
» (3) Comments    » (0) Trackbacks    » Permalink    » Send to a friend

These SQL statements will set caching preferences for all templates in an EE database.

This SQL statement will set "Enable Template Caching?" to "Yes" and "Time interval between cache refresh" to 30 minutes for all templates in an EE database (i.e. template caching will be turned on for all templates). You can replace 30 with however many minutes you want to elapse between cache refreshes.

UPDATE ee_database_name.exp_templates
    SET cache='y', refresh=30

This SQL statement will set "Enable Template Caching?" to "No" and "Time interval between cache refresh" to 0 minutes for all templates in an EE database (i.e. template caching will be turned off for all templates).

UPDATE ee_database_name.exp_templates
    SET cache='n', refresh=0

Note: ee_database_name is your ExpressionEngine database name

Hey, isn't this a lot better than setting caching preferences one template at a time?

» Categories • SQL» SQL Utilities/Maintenance
Sunday, July 18, 2004
Clear Referrers Table
» Posted by Robert Crow on Jul 18, 2004 at 1:49 pm
» (0) Comments    » (0) Trackbacks    » Permalink    » Send to a friend

This SQL statement will delete all records in the referrers table.

This SQL statement is useful if you want to clear your referrers table to get rid of the referrer history. You might want to do this to save disk space or simply to get a fresh start.

DELETE FROM ee_database_name.exp_referrers

Note: ee_database_name is your ExpressionEngine database name

Note: I just realized that this can be done in the EE Control Panel. Click on the "Modules" tab, then click on the "Referrers" link in the left-hand column. I won't remove this entry as it might still be useful for those of you who want to create an SQL maintenance script that you run from time to time to do a little EE housekeeping.

» Categories • SQL» SQL Utilities/Maintenance
Saturday, July 17, 2004
exp:query Tag - List Entries Based On The Value Of A User-Defined Field
» Posted by Robert Crow on Jul 17, 2004 at 5:17 pm
» (0) Comments    » (0) Trackbacks    » Permalink    » Send to a friend

This MySQL query executed using the exp:query tag in EE is used in the sidebar on the DIVERSe Book Store books page to display a list of all books that are currently on sale.

I defined a field with the name "scItemOnSale" and the field label "Book On Sale (use sale price)" (in "Custom Weblog Fields" found in the Admin section of the Control Panel). The field is a drop-down list and one of the options that can be selected when adding/editing a book is "yes". I placed the code below into the template used for the home page in EE. As the data in the EE MySQL database is abstracted to a great extent the field name "scItemOnSale" doesn't actually exist in the database. I used a MySQL utility to look at the "exp_weblog_data" table and determined that the actual field name for "scItemOnSale" is "field_id_14". Knowing this piece of information I was able to construct a query to list the entries from the Weblog that I'm using to store the book listings, where the entry status was "Open" and the book was on sale.

I'm not suggesting that this code is generic, but rather that you can modify/build on it to achieve a similar objective relative to your situation. Please note that you would have to modify the name of the field "field_id_14" and the "weblog_id = '12'" weblog ID in the WHERE clause of the SQL statement (and of course the path tag in the href).

Usage Example:

<p>
<ul>
{exp:query sql="SELECT exp_weblog_titles.title, exp_weblog_titles.url_title
FROM exp_weblog_titles LEFT JOIN exp_weblog_data
ON exp_weblog_titles.weblog_id = exp_weblog_data.weblog_id and exp_weblog_titles.entry_id = exp_weblog_data.entry_id
WHERE exp_weblog_titles.weblog_id = '12' and exp_weblog_titles.status = 'open' and exp_weblog_data.field_id_14 = 'yes'
ORDER BY exp_weblog_titles.title asc"}

<li><a href="{path=page/xrv}{url_title}/">{title}</a></li>

{/exp:query}
</ul>
</p>

» Categories • SQL
Thursday, July 15, 2004
Clear Template Revision Table - CAREFUL!
» Posted by Robert Crow on Jul 15, 2004 at 8:42 pm
» (0) Comments    » (0) Trackbacks    » Permalink    » Send to a friend

This SQL statement will delete all records in the template revision table.

In other words, all of your template revisions (template backups) will be deleted. This makes backup of your EE database much smaller and therefore quicker, obviously. I always back up my database first before running this statement and you should too.

DELETE FROM ee_database_name.exp_revision_tracker

Note: ee_database_name is your ExpressionEngine database name

» Categories • SQL» SQL Utilities/Maintenance
Clear CP Log Table
» Posted by Robert Crow on Jul 15, 2004 at 8:30 pm
» (0) Comments    » (0) Trackbacks    » Permalink    » Send to a friend

This SQL statement will delete all records in the Control Panel log table.

DELETE FROM ee_database_name.exp_cp_log

Note: ee_database_name is your ExpressionEngine database name

» Categories • SQL» SQL Utilities/Maintenance
Reset Hit Count For All Templates To Zero
» Posted by Robert Crow on Jul 15, 2004 at 3:24 pm
» (0) Comments    » (0) Trackbacks    » Permalink    » Send to a friend

This SQL statement will reset the "hit" counter to 0 for all of your templates. This alleviates the need to reset your template counters to 0 one template at a time using the Control Panel. 

UPDATE ee_database_name.exp_templates
    SET hits=0

Note: ee_database_name is your ExpressionEngine database name

» Categories • SQL» SQL Utilities/Maintenance
Page 1 of 1 pages

Copyright © 2004-2008 Knomad - All rights reserved. -- designed and developed by Knomad