You are not logged in.
redbot wrote:
I hope I have shed some light on the matter …
Many thanks for taking the time to explain this. I understand the logic, and your explanation was very clear. Much appreciated :)
“People who value their privileges above their principles soon lose both.”
Dwight D. Eisenhower
Offline
This is really cool redbot. I don’t know if this is already possible: The option to register an expand/collapse label that would toggle a grouping. The grouping would also have to be registered. Like: Toggle1 (custom_1, custom_23, article_image, etc).
Eh?
Gerhard looks as though he’ll implement this sort of functionality in glz_custom_fields and because I am using that and your plugin extensively right now it occurred that the two should continue to jive together and do great things together.
txtstrap (Textpattern + Twitter Bootstrap + etc…)
Offline
whaleen wrote:
… The option to register an expand/collapse label that would toggle a grouping….
Hi Josh,
this feature is not provided by default but you can achieve what you want adding some lines of jquery in the “additional js code” field.
I can’t help you now but a similar – though simpler – request has already been answered here.
The principle should be the same: first add the same class to items you want to expand/collapse together (for example .toggle1 for cf1 +cf2 and .toggle 2 for cf3+cf4) and then – through jquery – add somewhere in your “write” tab one or more texts or links or buttons which trigger the expand/collapse behaviour.
Last edited by redbot (2010-01-28 12:17:01)
Offline
redbot wrote:
For the collapsible excerpt write this rules in the js box, after you have attached a “collapse” class to the excerpt:
<script type="text/javascript"> $(document).ready(function() { $(".collapse label").click(function(){ $(this).parent().find("textarea").slideToggle(); }); }); </script>
I am having problems inserting JS in the plugin, I am getting this warning:
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"> $(document).ready(function() { $(".collapse").click' at line 1 update txp_prefs set val= "", html="textarea" where name = "bot_wtc_script" in /home/sites/mlarino.com/public_html/asesoria/textpattern/lib/txplib_db.php on line 113
Last edited by mlarino (2010-01-29 01:35:35)
Offline
mlarino wrote:
I am having problems inserting JS in the plugin, I am getting this warning:
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"> $(document).ready(function() { $(".collapse").click' at line 1 update txp_prefs set val= "", html="textarea" where name = "bot_wtc_script" in /home/sites/mlarino.com/public_html/asesoria/textpattern/lib/txplib_db.php on line 113
mlarino,
this is strange I never had such an issue and it was never reported before.
Just to be sure: you have pasted the code in the js box and got this error after pressing “submit”?
Of course I have tried it myself but all works correctly… it looks like an escaping problem
A couple of questions:
1) are you using the latest version of the plugin?
2) which version of txp are you using?
Has anybody else experienced this problem?
Offline
redbot wrote:
A couple of questions:
1) are you using the latest version of the plugin?
2) which version of txp are you using?
Has anybody else experienced this problem?
It happens as you say, I paste the code in the JS box and get the message when I hit the “submit” button.
I have Textpattern 4.2.0 and
bot_write_tab_customize 0.5.2
The rest of the plugins I have installed are:
gbp_admin_library
glz_custom_fields
l10n
lam_image_uploader
rah_replace
smd_admin_themes
wet_haystack
zem_contact_lang-mlp
Last edited by mlarino (2010-01-29 15:07:06)
Offline
Ok, testing and testing I found out that instead of using " if I use ' in all the sintax, the plugin lets me save the javascript.
instead of this:
<script type="text/javascript"> $(document).ready(function() { $("toggle").click(function(){ $(this).parent().find("textarea").slideToggle(); }); }); </script>
I have to use this:
<script type='text/javascript'> $(document).ready(function() { $('toggle').click(function(){ $(this).parent().find('textarea').slideToggle(); }); }); </script>
Why do you think this hapends?
-Either way, the javascript is not doing anything to the custom field at all.
Last edited by mlarino (2010-01-29 15:29:46)
Offline
mlarino,
so if you use this code (escaping double quotes with “\”):
<script type=\"text/javascript\"> $(document).ready(function() { $(\".collapse label\").click(function(){ $(this).parent().find(\"textarea\").slideToggle(); }); }); </script>
it should also give no errors.
Anyway I’ll try to understand why it works for me and not for you…
-Either way, the javascript is not doing anything to the custom field at all.
What you mean? This code was an answer to this request (expland/collapse the escerpt box) while you are talking about custom fields…
Offline
mmm
yes, I guess you are right….
I just thought that adding the collampse calss to de cutom field, at least it would wrap that custom field… maybe I was wrong.
I will keep testing and trying and see if I can figure it out .
Thanks!
Offline