Topic RSS
10:47 am
Your URL: www.sdamy.com
- The browser used: firefox
- cforms version: 6.41
- Your Wordpress version: 2.3
The plugin cforms run correctly but It's possible load the file css only in the page where I put a contact forms to reduce bandwitch on the server web?
The files loaded on every pageg:
…/wp-content/plugins/contactforms/styling/cforms.css
…/wp-content/plugins/contactforms/styling/calendar.css
…/wp-content/plugins/contactforms/js/cforms.js
total= 23kb
thanks
6:42 pm
March 6, 2005
OfflineThere is no elegant way of solving your requirement, since the header is being written far earlier than the content is being searched for possible forms. There is simply no way for the plugin to know beforehand…
However, you can certainly hard code an if(…) into cforms.php just before the stylesheets get added and check for your specific page, e.g. via $_SERVER[REQUEST_URI]
2:04 am
What about if we have a seperate template page designed just for the the contact page? I know how to do this, but I'm having a bit of a hard time finding what part of the plugin adds the stylesheets and javascript to *all* the pages (into header.php I presume). If I can just find that, then I can add it manually to my conact page to prevent it from being loaded on all the other pages that don't use cforms. Thanks!
7:31 am
March 6, 2005
OfflineThat won't help because even if you use a different page template, the header is still the same.
The easiest way would be to install a plugin (forgot what the name was) that allows you to run certain plugins only on certain pages of you blog, very easy to configure.
10:12 pm
Good point, but I could just copy and paste the contents of the header file into the template. I know I would have to change the page every time I changed the header, but that would be practically never and I could live with that. I found the functions I need (cforms_style(); and cforms_insert();) but I haven't tried them on a template page yet. Thanks for the help, and great plugin. Very extensive.
6:24 am
Hey Oliver,
I'm really interested in this plugin that you speak of….can you remember what it's called because i can't find it by searching through the wordpress plugins? is it WP-Cache?
my site would perform so much better with this plugin!
8:00 am
March 6, 2005
OfflineNope, WP-Cache only *caches* your WP pages in a static format.
I've tried searching google but can't seem to find it anymore…I'll look more and if I find it, I'll post it here.
8:05 pm
March 6, 2005
OfflineBen said:
that would be GREATLY appreciated!
thanks
I think I remember…something like "headspace" or so.
9:41 pm
yeh i found it here – http://urbangiraffe.com/plugins/headspace2/
i'll try it out, thanks so much for the help Oliver! I'm surprised this plugin isn't more popular?
11:15 pm
Well after trying out the plugin, it's actually harder than it sounded. You have to uninstall the plugin and then go to the pages that you want to use the plugin and choose to run the plugin…..sounds straight forward but it didn't work at all when i tried doing it.
I've read in another forum that i should try putting a conditional statement in the cforms code like:
if ( is_page('contact') ) {
// load css and js
}
would this work? and what exactly should the code be?
11:24 pm
March 6, 2005
OfflineIf you do it manually, like you described it, yes it will work.
Unfortuntely this can't be done by the plugin, since it can't know on which pages it will eventually be shown.
But I could think of a an configuration field in cforms that would allow you to enter all page IDs for which to load the cforms header…perhaps in the next release…
5:42 am
Hey Oliver,
Sorry to be such a noob, but where exactly should i put the code manually? i can't seem to find where i would put it in the cforms.php file?
7:29 am
March 6, 2005
OfflineI would simply wrap it around this line (at the bottom):
add_filter('wp_head', 'cforms_style');
e.g. (might want to include the next one too, while you're at it):
add_filter('wp_head', 'cforms_style');
add_filter('the_content', 'cforms_insert',10);
}
5:48 am
Hey Oliver,
cheers for the help….
tried doing it but couldn't get it working. I get it loading no script or css but then i couldn't get it loading on my contact page? i tried both:
if( is_page(’contact’) ){
add_filter(’wp_head’, ‘cforms_style’);
add_filter(’the_content’, ‘cforms_insert’,10);
}
&
if( is_page(’/contact’) ){
add_filter(’wp_head’, ‘cforms_style’);
add_filter(’the_content’, ‘cforms_insert’,10);
}
the testing url of my contact page is http://www.13thbeachboardriders.com/new/contact
am i skipping something obvious?
Most Users Ever Online: 959
Currently Online:
106 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
tracedef: 43
mores: 21
Gyrus: 20
frozenwaste: 18
asuffredini: 15
photoworks: 14
Member Stats:
Guest Posters: 3548
Members: 1464
Moderators: 3
Admins: 1
Forum Stats:
Groups: 1
Forums: 4
Topics: 5157
Posts: 18386
Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass
Moderators: Paul (421), cnymike (8), sonika (95)
Administrators: Oliver (6398)
FAQs
Home
Add Reply
Add Topic
Quote










