Poll
Do you think a Cheat Sheet like the one described below would be a useful addition to the Admin Panel?
Yes, I would love this! 21
No, I don’t think it would be useful! 2
Not for me personally, but I can see how it’d be useful for others! 1
Total Votes: 24
You must be a logged-in member to vote
Cheat Sheet for Custom Fields, Short Names, IDs, etc
Posted: 25 August 2005 09:31 AM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  216
Joined  11-04-2002

This is just a random idea I had today, and possibly something that can be done in a template without needing it built into the backend, but I figured I’d mention it here anyway in case someone else finds it a good idea too. smile

I find that when I am editing/creating templates, I have to look up a lot of stuff. Most notable the short names for all my custom fields, the short names for all my weblogs, and sometimes also the weblog IDs and category IDs.

Right now, I have to open a new tab in Firefox for this every time, and go into Admin and then into the page that lists the bit of information I am looking for. It would be really handy for me to have a link to a popup or a new page at the top of the screen (like, next to User Guide, maybe) that points to a page that automatically lists all of those things on one page.

I am envisioning something with the show/hide script that is used all throughout the admin panel, that will allow you to show/hide a list of all Custom Fields with their short name, a list of all Weblogs with their short names and ID, and a list of all Categories with their ID numbers. It would certainly make the template-modification process a bit easier for me if there was an easier way to quickly look up these bits of data! smile

 Signature 

stillburning.com | fever of fate

Profile
 
 
Posted: 25 August 2005 09:39 AM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32921
Joined  05-14-2004

I’m so used to this it never occurred to me that there might be a way to output all this in a simple fashion.  A template could be the wayto do it though, I don’t see any reason to have it core (heck, I’d use it in firefox’s sidebar, I think - an ff extension would totally rock for this;) ).  Plus, if you did it in a template you could lay it out in a way that makes sense to you.

 Signature 
Profile
MSG
 
 
Posted: 25 August 2005 10:41 AM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  216
Joined  11-04-2002

OK, while I was at it, I figured out how to do this in a template. It doesn’t use the fancy show/hide from the EE control panel (although I guess that’d be easy enough to build in if you’d want it), but it does basically what I outlined above. smile

For easy copy&pasting I formatted the data to be laid out into three small tables. You can find it at the wiki here:
http://www.eewiki.com/wiki/Cheat_Sheet

Here is the code I am using in my own cheat sheet template at the moment:

<!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>

All you need to do is create a new blank template, and copy&paste the code from the wiki into it. That’s all. smile Feel free to improve on my code if you can think of anything else useful to add!

And here is the basic query code I used for it (in case you want to build your own without having to strip my formatting first):

{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 FROM exp_weblog_fields ORDER BY field_name"}
{field_label}
{field_name}
{field_type}
{
/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}

 Signature 

stillburning.com | fever of fate

Profile
 
 
Posted: 25 August 2005 04:15 PM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12433
Joined  04-29-2002

Ya need some <br />s in the code, otherwise everything runs together.

But other than that, it works well.

 Signature 

Quick Reference - EE Trial Options - EE Wiki - Docs for updating a build

Profile
MSG
 
 
Posted: 26 August 2005 03:20 AM   [ Ignore ]   [ # 4 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  216
Joined  11-04-2002

Well that’s what the formatted version of the code is for, see the Wiki. That’s fully formatted as an HTML page that you only need to copy&paste into a new template. The code I posted above is only the queries I used, in case people want to format their own page and don’t want to have to delete all my formatting first. smile

 Signature 

stillburning.com | fever of fate

Profile
 
 
Posted: 26 August 2005 12:35 PM   [ Ignore ]   [ # 5 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6092
Joined  08-04-2002

Wonderful…had been doing it the hard way and hadn’t thought about this…Thanks!

Profile
 
 
Posted: 13 September 2005 03:53 AM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  486
Joined  07-12-2005

I added this in case anyone needs custom member fields:

<table summary="Custom Member fields" cellpadding="5">
<
tr class="heading">
<
td><b>m_field_id</b></td>
<
td><b>m_field_name</b></td>
<
td><b>m_field_label</b></td>
<
td><b>m_field_type</b></td>
<
td><b>m_field_list_items</b></td>
</
tr>
{exp:query sql="SELECT m_field_id,m_field_name,m_field_label,m_field_type,m_field_list_items FROM exp_member_fields ORDER BY m_field_name"}
<tr>
<
td>{m_field_id}</td>
<
td>{m_field_name}</td>
<
td>{m_field_label}</td>
<
td>{m_field_type}</td>
<
td>{m_field_list_items}</td>
</
tr>
{/exp:query}</table>

 Signature 

Technology Consulting
Jobs, apartments, working and moving to Spain.

Profile
 
 
Posted: 13 September 2005 06:55 AM   [ Ignore ]   [ # 7 ]  
Lab Assistant
RankRank
Total Posts:  244
Joined  11-13-2002

Great idea, Sasha.  I don’t always remember which weblog the custom field IDs belong to, so I added the weblog short name to your second table.  I also restricted access to the template.

Profile
 
 
Posted: 15 October 2007 12:00 PM   [ Ignore ]   [ # 8 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  314
Joined  05-26-2004

Has anyone done an update for the Quick Cheat Sheet which shows the relationships of Sites to Weblogs, Categories and Fields?

 Signature 

...for there is no way to reduce a hunter to economic dependence and make him hunt for you - Albert Jay Nock ~ “Our Enemy the State”

Profile
 
 
Posted: 15 October 2007 12:07 PM   [ Ignore ]   [ # 9 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32921
Joined  05-14-2004

How about the Developer Plugin?

 Signature 
Profile
MSG
 
 
Posted: 15 October 2007 12:56 PM   [ Ignore ]   [ # 10 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  314
Joined  05-26-2004

How about the Developer Plugin?

1. It does not appear to deal with relationships between Sites, Blogs, Categories and Fields.
2. Even if it does, I don’t really like the idea of having to put the tags into all my old templates, just to deal with a temporary problem I have (see below.) I can see that it would be useful for new development though.
3. My initial skirmish with the plug-in was not very successful due to conflicts between my CSS and the pi’s CSS, and as a result I could not really make anything useful out of the info. Again, this can be solved, but I don’t have the time now.

I have run into an issue whereby one can have trouble with third party plug-ins/ modules which do not take account of the fact that you can have duplicate weblog names, duplicate field names, duplicate category names etc across different sites. Indeed the MSM system assumes this when “extracting” blogs. (Example: Form Helper Plug-in cannot handle this because it grabs the first name it comes across to get the field IDs without taking account of the site/blog relationship)
I have coded a workaround for Form Helper, but I need to find a quick way to check my other third party codes.

EE proper has no difficulty with this because it differentiates between duplicates by tracking the site ID, and when one clones a set of blogs using the MSM, new ids are assigned to the old names.

Since I have a need to clone some (but not all) weblogs with all their fields, categories, templates etc intact, it is important to me for site maintenance reasons across a number of sites, to not have to change the field names, category names etc.

The reason I am looking for a cheatsheet that does this is so I can quickly survey my pre-MSM code to look for the relationships between sites, blogs, fields etc so I will know where my third-party code may run into trouble and need corrective action. I suppose I will have to do my own ... hint hint.

I emphasize, this is strictly a problem with third party code, not with EE.

Any other suggestions welcome

 Signature 

...for there is no way to reduce a hunter to economic dependence and make him hunt for you - Albert Jay Nock ~ “Our Enemy the State”

Profile
 
 
Posted: 02 September 2008 09:06 AM   [ Ignore ]   [ # 11 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  111
Joined  07-02-2008

4 years later… This is awesome!

 Signature 

View Creative Agency | http://www.viewcreative.co.uk

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 65086 Total Logged-in Users: 36
Total Topics: 82224 Total Anonymous Users: 18
Total Replies: 441922 Total Guests: 191
Total Posts: 524146    
Members ( View Memberlist )