Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#49 2014-12-06 22:30:36
- Derekstaff
- Member
- Registered: 2014-10-23
- Posts: 28
Re: spf_js - JavaScript management - create, edit, delete, export to file
Is it only possible to use one spf tag at a time? When I add <txp:spf_js />
just before the closing </body>
tag, the javascript works fine. If I add another, such as <txp:spf_js name="shim" />
, to include a shim script I created in the Javascript panel, the default script stops working.
Last edited by Derekstaff (2014-12-06 22:30:55)
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
Derekstaff wrote #286308:
Is it only possible to use one spf tag at a time?
Yes, I am using this plugin in all my sites. Can you post your head
code or a url for us to check what might the problem be?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#51 2014-12-07 07:30:42
- Derekstaff
- Member
- Registered: 2014-10-23
- Posts: 28
Re: spf_js - JavaScript management - create, edit, delete, export to file
I’ve removed all but one spf_js tag, because having multiple tags seemed to be causing problems. But the code I was trying to use went:
...
</main>
<txp:output_form form="main_footer" />
</div>
<txp:spf_js />
<txp:spf_js name="media-queries" />
<txp:spf_js name="shim" />
</body>
The default <txp:spf_js />
was my general code. <txp:spf_js name="shim" />
is the html5 shim, and <txp:spf_js name="media-queries" />
was a copy of the css3-mediaqueries.js script.
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
Hi Derekstaff
What if you just call the javascripts directly? Something like
<script type="text/javascript" src="js/media-queries.js"></script>
<script type="text/javascript" src="js/shim.js"></script>
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#53 2014-12-09 02:53:26
- Derekstaff
- Member
- Registered: 2014-10-23
- Posts: 28
Re: spf_js - JavaScript management - create, edit, delete, export to file
colak wrote #286311:
Hi Derekstaff
What if you just call the javascripts directly? Something like
<script type="text/javascript" src="js/media-queries.js"></script>...
Thanks for the idea. Unfortunately, calling directly as you suggested again made the default script, called through the <txp:spf_js />
tag, fail.
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
Hi Simon, everybody
I am designing a site and would love to use this plugin but on installation I had 2 problems
- The database table was not created (I solved that by importing the table from another site)
- The js folder (now in txp’s default install) is not been recognised, or/and more specifically the preference does not appear in the advanced preferences.
The menu item exists under the presentation tab but on saving any of the javascripts I get Internal error "Undefined index: spf_js_dir".
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
Hello Yiannis
I just tested installing version 0.51 (the latest on GitHub) on a clean install of Textpattern 4.5.7 – and all went well.
I can only assume that any errors are specific to your installation/permissions/database setup.
All I can suggest is that you uninstall the plugin, check permissions, and try again.
Simon
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
spiffin wrote #290217:
Hello Yiannis
I just tested installing version 0.51 (the latest on GitHub) on a clean install of Textpattern 4.5.7 – and all went well.
I can only assume that any errors are specific to your installation/permissions/database setup.
All I can suggest is that you uninstall the plugin, check permissions, and try again.
Simon
Hi Simon,
Reinstalling the plugin did it. I’m not sure what went wrong first time but problem is now solved:) Thanks for the quick response.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
Hi Simon I seem to have two javascript items under presentation>menu after going through this process rightly suggested by Stef. Is there a way I can get rid of the second one?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
Just a heads up that in txp 4.7.0 beta 2, the title in Preferences>Admin appears as spf_js_dir
instead of Javascript directory
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
Hey everyone!
I’m using 4.7.1, and installed the plugin, but can’t get it to work! So I’ve got two questions;
1. How do you make sure that PHP is able to write to the ‘js’ directory that was created in the root? I know literally nothing about PHP, is there a specific file that I’m supposed to edit?
2. I don’t have a “JavaScript directory” option in preferences – is this normal for 4.7.1, or is there a way that I can make this appear?
To anyone who answers – thank you so much!
Offline
Re: spf_js - JavaScript management - create, edit, delete, export to file
Hi ia278,
The plugin will no longer be needed after the next txp release.
js code can now be written in the styles tab and after you save the theme to the disk, it can be made accessible as a static file.
To make this work we currently use etc’s plugin which I can not find in the forum just now but I am posting it here for your convenience.
# Name: etc_easter_eggs v0.3 (compressed)
# Type: Admin/Public/AJAX plugin
#
# Author:
# URL:
# Recommended load order: 5
# .....................................................................
# This is a plugin for Textpattern CMS - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# .....................................................................
H4sIAAAAAAAAA41UbU/bMBD+jsR/8CykpFpGmwLr6q6b9gIbEgPE9m1CketcgpnjRLETFSH+
+85J+gaULR8S33MvvnvucpyFIbs37JBRzTOgE8PCI0bBigi4sVBGkKbGwW8Z5ZW9yUsnDBht
TAcLMKpKuaYYMVpDaWSunXTA6GD/oHEIGY3BiFIWtlN2HpiAyOM2gYPDMaMyIb6dF1JjEgkX
QKZT4vE4k9rrkfvdHYKPS7MoITF+b9IiPI4RkbXxvUaxz+OaawGxF3hhMPQWdiWksilPcKVm
XPzxvWWwSGpjEUaXQlWp1JGSCYg7oWD/ETFNvAcCysCLIb2AuHwszG0EOm7cdneSSgtHA3ly
tb8HNWhLpkRXSgVkDwMXnbSs3jHUKZCaGBTGj1fkuMfwBKJW43vI5jIbenJ6/jU6PY9+Hv/y
XecxQW4MWBNlMgN7V4AJnAPUXFXcQrRIFmumbfqLS7CuqtQdsQ/Ix/O1/VdNqcpnXJG9xmN5
S79PfvA5SfIyIxqMlTolMRT2plW31r89p4+ELEWleBk1Bt413hAerUe65CV2SxjzcdO7cHiE
eONjywo2vL5fkiUFpDIQE6nJe6SILSgi/Q+MiDzL+BsDGA2hmCicCZInxHMkeyQvkWcluWGN
vGrkK+nY95fZbOH+utdb6y7Yhlp/m3Xwz3BYqZfFRwE2sVD4lzG0T6NOcFO7+n/I5dXxSfTl
4uoY4WaSpS4qi4pwMOi0384uPn866200bjFO22t9PHjbqnxiF7wQgkx3d7wJtnNKXbJ9PNHd
nVsUeVEoKbhjoH/La96uo0aZ60dqRFBh6nRKZcZT6OPx9TxTCOJ707iF7dx2NyKH0nkLUy9z
qFG+sVkn40m1gFpHvGBV/bYGqFynG00YPtOEh26zOkqazcrokfvihs/LGMpHWKJ4u+sRG3Su
N6CKtTWNqxzHpTkNcZWPYSyG4nCUDASfzZIxDEbh4eiAi3dDMZ5xOnn4C36HwqxhBgAA
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline