x
 
Create New Page
 View Previous Changes    ( Last updated by Sue Crocker )

Cheat Sheet

The EE code below will create a quick Cheat Sheet that will list all your Weblogs with their short names and IDs, all your Custom Fields with their short names, and all your Categories with their IDs. This one page will save you having to look this up in the Admin panel constantly when editing/creating templates for your site. :)

Feel free to change/edit/improve upon my coding, this is free for everyone to use. Any questions, give Sasha a shout.

How To Use

# Go into Templates
# Create a new blank template
# Copy and paste the fully formatted code below into it, and save it
# Optionally restrict access to the template using the “Access” link under Template Management
# For extra convenience and easy access, go into My Account > Extras > Quick Links to add a link to this page at the top of all pages in the Admin Panel.
# That’s all! :)

A Fully Formatted version of this page

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<
html>
<
head>
<
title>Quick Cheat Sheet</title>

<
style type="text/css">
<!--
body{
    background
:#eee;
    
color:#333;
    
font: 11px Arial, sans-serif;
}
table {
    float
:left;
    
margin:5px;
    
border:1px solid #ccc;
}
.heading{
    background
:#ddd;
}
-->
</
style>
</
head>
<
body>

<
table summary="Weblog IDs" cellpadding="5">
<
tr class="heading">
<
td><b>Full Weblog Name</b></td>
<
td><b>Short Name</b></td>
<
td><b>Weblog ID</b></td>
</
tr>
{exp:query sql="SELECT weblog_id, blog_name, blog_title, blog_url FROM exp_weblogs ORDER BY blog_title"}
<tr>
<
td>{blog_title}</td>
<
td>{blog_name}</td>
<
td>{weblog_id}</td>
</
tr>
{/exp:query}
</table>

<
table summary="Custom Field IDs" cellpadding="5">
<
tr class="heading">
<
td><b>Full Field Name</b></td>
<
td><b>Short Name</b></td>
<
td><b>Field Type</b></td>
<
td><b>Field ID</b></td>
</
tr>
{exp:query sql="SELECT group_id, field_name, field_label, field_type, field_id FROM exp_weblog_fields ORDER BY field_name"}
<tr>
<
td>{field_label}</td>
<
td>{field_name}</td>
<
td>{field_type}</td>
<
td>{field_id}</td>
</
tr>
{/exp:query}</table>

<
table summary="Category IDs" cellpadding="5">
<
tr class="heading">
<
td><b>Full Category Name</b></td>
<
td><b>Category ID</b></td>
</
tr>
{exp:query sql="SELECT cat_name, cat_id, group_id FROM exp_categories ORDER BY group_id"}
<tr>
<
td>{cat_name}</td>
<
td>{cat_id}</td>
</
tr>
{/exp:query}</table>

</
body>
</
html>

The basic queries I used for this

In case you want to make your own cheat sheet - saves you having to strip out my formatting:

{exp:query sql="SELECT weblog_id, blog_name, blog_title, blog_url FROM exp_weblogs ORDER BY blog_title"}
{blog_title}
{blog_name}
{weblog_id}
{
/exp:query}

{exp
:query sql="SELECT group_id, field_name, field_label, field_type, field_id FROM exp_weblog_fields ORDER BY field_name"}
{field_label}
{field_name}
{field_type}
{field_id}
{
/exp:query}

{exp
:query sql="SELECT cat_name, cat_id, group_id FROM exp_categories ORDER BY group_id"}
{cat_name}
{cat_id}
{
/exp:query}

Category:EE Coding Category:Templates Category:Tips Category:Tricks