Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#145 2010-06-28 18:57:42
Re: bot_write_tab_customize: rearrange and style items in the write tab
What do you say about having a script to create auto articles titles for each section base on the data from custom-fields?
The idea is to have a jQuery script that will copy the typed content (live/onthefly) from specific custom fields,
and then write that content into the Title field.
so the user will not need to type a title and it will be automatically created.
For example if you post a release/song details into custom fields as “Artist”,“Title”,“Label”,“release date”
then the title will automatically be: redbot – Amazing plugins – TXP (2010)
because lets face it, it’s effort to require users to type details twice. (in custom-fields & Title)
of course you can also choose to hide the Title field or not for letting users the possibility to make changes.
If it’s hard so another idea is to create custom submit button instead of the regular ‘Publish’ button,
and then when you will click on it, first it will copy the content to the Title field and then do the submit.
I believe jQuery (our best friend LOL) can do this, will it be something hard to write a script for please?
BTW: I installed “bot_cat_per_section_hide” and it works great too =) so another thanks for it to you!
EDIT: here is a start point that I wrote:
<script type="text/javascript">
$(document).ready(function(){
$("form[name='article'] input[type='submit']").click(function(){
$("#title").attr("value",$("#custom-1").val());
$("form[name='article']").submit();
return false;
});
});
</script>
Now I need it to include more fields then just custom-1 value,
and that it will be base on section.
Last edited by THE BLUE DRAGON (2010-06-28 23:14:48)
Offline
#146 2010-06-29 11:23:06
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_write_tab_customize: rearrange and style items in the write tab
A simple and non tested example:
<script type="text/javascript">
$(document).ready(function() {
$(".publish").click(function(){
var cf1 = $("input[name=custom_1]").val();
var cf2 = $("input[name=custom_2]").val();
var cf3 = $("input[name=custom_3]").val();
var string = cf1 + cf2 + cf3;
$("#title").val(string);
})
});
</script>
I see you now want it to be section based so it becomes more difficult ad requires more attention (which I don’t have cos I’m at work now and I won’t have too much free time in the near future).
Offline
#147 2010-06-29 14:10:18
Re: bot_write_tab_customize: rearrange and style items in the write tab
redbot wrote:
A simple and non tested example:
Thanks =)
redbot wrote:
I see you now want it to be section based
I used your code from “bot_cat_per_section_hide” and it works ;)
<script type="text/javascript">
$(document).ready(function() {
$(".publish").click(function(){
var value = $("select#section.list option:selected").val();
var cf1 = $("input[name=custom_1]").val();
var cf2 = $("input[name=custom_2]").val();
var cf3 = $("input[name=custom_3]").val();
if (value=="default"){var string = cf1 + " - " + cf2;}
if (value=="articles"){var string = cf3;}
$("#title").val(string);
})
});
</script>
Cool 8-)
Offline
#148 2010-07-07 19:25:55
Re: bot_write_tab_customize: rearrange and style items in the write tab
this plugin doesn’t work right with rah_write_each_section and no way to hide some fields not by sections, by users ?
<txp:txp_me />
Offline
#149 2010-07-07 22:15:51
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_write_tab_customize: rearrange and style items in the write tab
Katalonian wrote:
this plugin doesn’t work right with rah_write_each_section…
Why? You should give more details. Of course they work ok for me
…and no way to hide some fields not by sections, by users ?
Offline
#150 2010-07-08 09:24:22
Re: bot_write_tab_customize: rearrange and style items in the write tab
redbot wrote:
this plugin doesn’t work right with rah_write_each_section…
Why? You should give more details. Of course they work ok for me
When i’m hide sections, and turn on rah_write_each_section, after entering to sections, the hided fields still showing
…and no way to hide some fields not by sections, by users ?
thanks
<txp:txp_me />
Offline
#151 2010-07-08 10:02:01
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_write_tab_customize: rearrange and style items in the write tab
Katalonian wrote:
…When i’m hide sections, and turn on rah_write_each_section, after entering to sections, the hided fields still showing
Do you mean that – when you hide some sections in the “Hide sections in sections dropdown” menu – these sections are still visible when you go to the write tab (and you see the rah_write_each_section interface)?
If this is the question that’s the expectded behaviour: rah_write_each_section has his own methods to show/hide sections in its menu.
If you read it’s instructions you’ll see that the inclusion in the menu is determined by the section having the option “Syndicate? “ (in the ‘sections’ tab) checked.
So you must take care of this to make the two work together: when you hide a section with bot_wtc you should also go in the ‘sections’ tab and uncheck “Syndicate?” for each hidden section.
Offline
#152 2010-07-15 17:00:14
Re: bot_write_tab_customize: rearrange and style items in the write tab
redbot do you think is possible,in future, to merge bot_write_tab_customize and ied_hide_in_admin to have a full controll of write tab?
Somewhat like: “which users can view which elements”
Last edited by wornout (2010-07-15 17:02:18)
Offline
#153 2010-07-15 18:32:52
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_write_tab_customize: rearrange and style items in the write tab
wornout wrote:
redbot do you think is possible,in future, to merge bot_write_tab_customize and ied_hide_in_admin to have a full controll of write tab?
Somewhat like: “which users can view which elements”
Hi,
to tell the truth this was my intention from the beginning but then I gave up because:
- it’s not so easy (at least for for me). Too many things to keep into consideration and more complexity = harder mantainability
- the plugins interface (which is already quite complex) would become a lot more complex
- all in all I think it isn’t worth the effort: these plugins can be used together and this should cover – if not all – a lot of possible scenarios
That said, I can’t exclude someday I’ll try to do it.
Is there a special reason you want the two merged together?
Offline
#154 2010-08-13 17:00:26
Re: bot_write_tab_customize: rearrange and style items in the write tab
Hi redbot,
sorry for the delay… I was very busy!
The reason why I ask that function is because many client don’t understand Txp easier.
So I’d like to decide what fields will be visible or not, and maybe turn on and off visibility at specific author level.
But this isn’t a big problem for now. I will send you a mockup if I can…
There is another question for you
I can’t upload any script from bot_write_tab_customize.
The page reports:
Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'text/javascript" src="path_to_script"> ", html="textarea" where name ' at line 1 update txp_prefs set val= " ", html="textarea" where name = "bot_wtc_script" in /var/www/vhosts/***.ip/httpdocs/textpattern/lib/txplib_db.php on line 85
It’s a problem with quote?
Last edited by wornout (2010-08-13 20:14:30)
Offline
#155 2010-08-13 18:01:54
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_write_tab_customize: rearrange and style items in the write tab
wornout wrote:
…There is another question for you
I can’t upload any script from bot_write_tab_customize.
Hi,
this bug is a nightmare… and I was sure I fixed it definitely with the last release :-(
before proceeding two questions:
1) are you using v. 0.6.2 ?
2) are you using txp 4.2?
Last edited by redbot (2010-08-14 02:28:15)
Offline
#156 2010-08-14 19:50:22
Re: bot_write_tab_customize: rearrange and style items in the write tab
I’m sorry…
I was deep in the past.
Uploading the version 0.6.2 the problem is no longer present.
Thanks redbot for all support!
Offline