Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Quick Cheat Sheet (See related posts)

<!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>
</tr>
{exp:query sql="SELECT group_id, field_name, field_label, field_type FROM exp_weblog_fields ORDER BY field_name"}
<tr>
<td>{field_label}</td>
<td>{field_name}</td>
<td>{field_type}</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>


This EE code 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. :)
Also posted at the EEWiki:
http://www.eewiki.com/wiki/Cheat_Sheet.

Comments on this post

jtnt posts on Aug 09, 2006 at 20:31
I've edited this at the Wiki to include the field_id for each custom field. Just a heads up. You might want to update your code here as well.

You need to create an account or log in to post comments to this site.


Related Posts