Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-05-18 13:44:45

progre55
Member
Registered: 2006-05-02
Posts: 668

Write Tab: Reorganizing Information

In my current project, I need the ability to move some of the information around in the write tab. Specifically, I want to place the image field on the top of the left column.

I am using bot_show_image and because I am using the write tab to create a sort of bio page, I want the image to be the firt item.

FYI, I am using ied_hide_in_admin which is working great for “hiding” information to clear the clutter.

Finally, in speaking with Bloke he made this comment “a small plugin to hook into the new pluggable_ui() interface in
the SVN core should do the trick. You can then move stuff around at will.”

Please let me know if anyone has done this before or is willing to take this on.

Offline

#2 2009-05-18 20:00:00

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: Write Tab: Reorganizing Information

This is something I do very often, together with other modifications to the “write” and other tabs.
Usually I use a home made plugin which moves page elements around with jquery – a very raw plugin.
In your case though you can get what you want adding one or two lines to the “bot_show_image” plugin.
after this line:

		'		$("#bot_article_image").insertBefore($("#article-image"));'.n.

add this:

		'		$("#article-image").insertBefore($("#markup-excerpt"));'.n.

this is not tested but you should get it to work (maybe changing it a bit)

Offline

#3 2009-05-18 21:24:19

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: Write Tab: Reorganizing Information

redbot:

Thanks for the reply and I will look into this tonight and give an update.

I am also looking to add the article image and a custom field to the articles tab … do you have any experience with that in any previous projects …

Thanks again for the feedback.

progre55

Offline

#4 2009-05-18 22:48:34

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: Write Tab: Reorganizing Information

progre55 wrote:

…I am also looking to add the article image and a custom field to the articles tab … do you have any experience with that in any previous projects …

No, sorry, never tried that. I’m sure it can be done but it does surely involve more work.
If I had more free time I’d try to do it but unfortunately I’m too busy now so don’t rely on me.
Of course, should I incredibly manage to do it I’ll post it here (but I repeat: don’t rely on me).

Offline

#5 2009-05-19 02:21:28

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: Write Tab: Reorganizing Information

redbot:

Unfortunately your suggestion did not work … or at least I could not make it work … BUT … with your direction I was able to move the image arround the write tab by changing that code of the plug in. Although it is not above the article image field (which would be ideal) … I do have it now positioned on the top of my left column under another field.

progre55

Offline

#6 2009-05-19 11:26:22

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: Write Tab: Reorganizing Information

progre55,
if you can wait till tonight I can show you the correct code (I’m at work now)

Last edited by redbot (2009-05-19 11:26:35)

Offline

#7 2009-05-19 12:07:41

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: Write Tab: Reorganizing Information

redbot:

No problem. Thanks for the check in. Like I said, I was able to do a work around, but for future refernce it would be great to see.

progre55

Offline

#8 2009-05-19 23:03:19

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: Write Tab: Reorganizing Information

Ok forget what I told you before and try adding this line instead:

			'		$("#article-image").parent().insertBefore($("#article-col-1 h3.plain:first"));'.n.

Last edited by redbot (2009-05-19 23:26:41)

Offline

#9 2009-05-20 12:16:48

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: Write Tab: Reorganizing Information

redbot:

That worked perfectly.

One more thing, you mentioned using a “custom” homegrown plug in to move things around on the write tab. Not sure if applicable, but would it allow you to split up custom field and divide them from the left and right column. If so, is there any chance in taking a peak at you mastery ….

progre55

Offline

#10 2009-05-20 12:52:44

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: Write Tab: Reorganizing Information

Yes, you can move every page element (including custom fields) virtually everywere using jquery.
bot_show_image itself is only a portion of a more generic plugin that I used for a site.
I suggest you keep modifying bot_show_image adding some more lines (maybe asking here).
To tell the truth I planned a long time ago to write a tutorial to show how to build a plugin for this kind of admin customizations but I never had the time.
Don’t believe I’m a master at something, my knowlege is very limited. In fact I only have a very basic knowledge of jquery and php.
In brief I suggest you start to look at jquery, even if you (like me) don’t know anything about javascript. You don’t need to be a master but I assure you can learn what you need in a few days.
Coming to your question you have two alternatives:
1) add another line to bot_show_image and try to change selectors (you can move anything simply using insertBefore and inserAfter)
2) post here a specific question (i.e. how to move custom field 3 after article status) and later (I’m at work now) I’ll tell you how, so next time you can do it yourself.

Last edited by redbot (2009-05-20 12:53:49)

Offline

#11 2009-05-20 12:56:18

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: Write Tab: Reorganizing Information

redbot:

Thanks for the reply.

I will test tonight and I am sure will send you a question or two …

Now, get back to work :)

progre55

Offline

#12 2009-05-21 00:13:27

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: Write Tab: Reorganizing Information

Finally I’m back (this was a long day).
As I said before you can reposition a lot of page elements using insertBefore and insertAfter. For you convenience here are the right selectors to use for simpler tasks (use them exactly as they are written, just copy and paste):

custom_1 (change the number as you like), Keywords, Category1, Category2, Image, Body, Excerpt, url_title, override_form, textile_body, textile_excerpt, Status, Category1, Category2, Annotate, AnnotateInvite.

Note that you can achieve an even more extreme customization moving for example the excerpt textarea after custom field 3 (quite useless I know – just an example) or changing the entire page layout to a two column table etc. This is slightly more complicated but perfectly doable.
Next step (requires more work) is to move elements around on section change, maybe using “
rah_write_each_section
so you’ll have a different layout for each section … but ok, I think I’m going to far now.

Last edited by redbot (2009-05-21 00:35:35)

Offline

Board footer

Powered by FluxBB